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

Warning message from Accessible, TableViewColumn

XMLWordPrintable

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

      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.

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

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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes