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

QGroupBox discards left mouse press events

    XMLWordPrintable

Details

    • 4ac94480c33caa8c95254fc9db3352a832f55b7e

    Description

      QGroupBox does not propagate left mouse button press events to its parent. The following patch would fix this for non-checkable groupboxes and provide a small performance improvement at the same time.

      --- qgroupbox.cpp.orig	2010-11-22 16:49:33.786298601 +0100
      +++ qgroupbox.cpp	2010-11-22 16:50:18.514298602 +0100
      @@ -693,7 +693,7 @@
       /*! \reimp */
       void QGroupBox::mousePressEvent(QMouseEvent *event)
       {
      -    if (event->button() != Qt::LeftButton) {
      +    if (event->button() != Qt::LeftButton || !d->checkable) {
               event->ignore();
               return;
           }
      @@ -703,7 +703,7 @@
           initStyleOption(&box);
           d->pressedControl = style()->hitTestComplexControl(QStyle::CC_GroupBox, &box,
                                                              event->pos(), this);
      -    if (d->checkable && (d->pressedControl & (QStyle::SC_GroupBoxCheckBox | QStyle::SC_GroupBoxLabel))) {
      +    if (d->pressedControl & (QStyle::SC_GroupBoxCheckBox | QStyle::SC_GroupBoxLabel)) {
               d->overCheckBox = true;
               update(style()->subControlRect(QStyle::CC_GroupBox, &box, QStyle::SC_GroupBoxCheckBox, this));
           }
      

      Attachments

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

        Activity

          People

            peppe Giuseppe D'Angelo
            ton Ton van den Heuvel
            Votes:
            3 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes