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

Warning message from Accessible, TableViewColumn

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3: Somewhat important
    • Resolution: Done
    • Affects Version/s: 5.15.0
    • Fix Version/s: None
    • Component/s: Quick: Controls 1
    • Labels:
      None
    • Commits:
      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

          For Gerrit Dashboard: QTBUG-86315
          # Subject Branch Project Status CR V

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes