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

Can't popup combobox widget on mouse release

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.14.0
    • None
    • All

    Description

      If the QStyleHints::setFocusOnTouchRelease value is "true" and the combobox widget no focus, then it can't popup on mouse release.

      See code:

          QFontComboBox *box = new QFontComboBox();
          box->setEditable(false);
          box->setFocusPolicy(Qt::NoFocus);
          box->show();
      

      Copy form https://github.com/qt/qtbase/blob/dev/src/widgets/widgets/qcombobox.cpp#L3288 :

      // Why "&& hasFocus()" in mouseReleaseEvent?
      void QComboBox::mouseReleaseEvent(QMouseEvent *e)
      {
          Q_D(QComboBox);
          d->updateArrow(QStyle::State_None);
          if (QGuiApplication::styleHints()->setFocusOnTouchRelease() && hasFocus())
              d->showPopupFromMouseEvent(e);
      }
      

      Is this a bug?

      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
            zccrs JiDe Zhang
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes