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

Add missing null check in QAbstractButtonPrivate::queryButtonList()

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • None
    • 5.12.2
    • None
    • All

    Description

      Add missing null check in QAbstractButtonPrivate::queryButtonList()

      This code path can be reached by

      QCheckBox cb;
      cb.setChecked(true);
      cb.setChecked(false); 
      

      Fix:

       QList<QAbstractButton *>QAbstractButtonPrivate::queryButtonList() const  {
       #if QT_CONFIG(buttongroup)
       if (group)
           return group->d_func()->buttonList;
       #endif
      
      +if (!parent) return {};
      +
       QList<QAbstractButton*>candidates = parent->findChildren<QAbstractButton *>();
       if (autoExclusive) {
           auto isNoMemberOfMyAutoExclusiveGroup = [](QAbstractButton *candidate) {
               return !candidate->autoExclusive()
       #if QT_CONFIG(buttongroup)
      

      Attachments

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

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            cwgthornton Chris Thornton
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes