Uploaded image for project: 'Qt Safe Renderer'
  1. Qt Safe Renderer
  2. QSR-2730

If dynamic text is set using a property, the boundary check fails.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • QSR 2.1, QSR 2.2
    • Tooling
    • None

    Description

      If text is set using property, the property name is used in boundary check calculation.

      See the following code text->text()

      QString QSafeTextGenerator::generateTextLayout(const Node *node, QSize &size, const Text *text)
      {
          auto metrics = QFontMetrics(text->font());
          QRect boundingRect = metrics.boundingRect(text->text());
          const qint32 actualHeight = boundingRect.height();
          const qint32 actualWidth = boundingRect.width();    if (actualHeight > size.height() || actualWidth > size.width()) {
              QDebug err = qCriticalContext(text->text().context());
              err.setAutoInsertSpaces(false);
              err << "The actual text area of the SafeText " << node->id() << " ("<< actualWidth << '*' << actualHeight
                  << ") does not fit into the defined text area (" << size.width() << '*' << size.height()
                  << ") for runtime-editable text. Overflowing text: " << text;
              return QString();
          } 

      Instead, we should first evaluate the text value in JSEngine: QJSValue textValue = m_engine->evaluate(text->text());

      Overall, we should reconsider whether doing a boundary check for the dynamic text makes sense.

       

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qtsaferendererteam Qt Safe Renderer Team
            teemu.holappa Teemu Holappa
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes