Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-86315

Warning message from Accessible, TableViewColumn

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.15.2
    • 5.15.0
    • Quick: Controls 1
    • None
    • fc0bbf8a78c19a71287c5f37a23d74b723fb35c0 (qt/qtquickcontrols/5.15)

    Description

      Commit 22d708697f6 (27-Apr-2020) added a new warning message in Accessible if attached to a non-Item:
       

      --- a/src/quick/items/qquickaccessibleattached.cpp
      +++ b/src/quick/items/qquickaccessibleattached.cpp
      @@ -335,14 +337,15 @@   
        QQuickAccessibleAttached::QQuickAccessibleAttached(QObject *parent) 
            : QObject(parent), m_role(QAccessible::NoRole)
        { 
            Q_ASSERT(parent);
      -     QQuickItem *item = qobject_cast<QQuickItem*>(parent);
      -     if (!item)
      +     if (!item()) {
      +         qmlWarning(parent) << "Accessible must be attached to an Item";
                return;
      +     }

      This prints a warning when loading TableViewColumn.qml, because TableViewColumn extends QtObject, not Item, but sets Accessible.role at line 139:
       

         Accessible.role: Accessible.ColumnHeader     

      Since it's just a warning, the program still runs, but the spurious terminal output is annoying.

      Attachments

        Issue Links

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

          Activity

            People

              andysh Andy Shaw
              russell_zahniser Russell Zahniser
              Votes:
              20 Vote for this issue
              Watchers:
              24 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes