Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Disabled widget hogs scrollEvents... how to disable?



  • Hey

    If I disable a widget inside QScrollAray & hover over it & scroll. The scroll area does not get the event. How can I properly push the event to the scroll area? I looked at installing event filters and trying to push it, but then the next widget(parent) is also disabled, and so on so on... seems like a recursive never-ending tree of disabled widgets. Is there a proper flag/etc I can set on the widget?

    TIA



  • This is example >

    # -*- coding: utf-8 -*-
    
    ################################################################################
    ## Form generated from reading UI file 'designersSbOqr.ui'
    ##
    ## Created by: Qt User Interface Compiler version 6.0.0
    ##
    ## WARNING! All changes made in this file will be lost when recompiling UI file!
    ################################################################################
    
    from PySide6.QtCore import *
    from PySide6.QtGui import *
    from PySide6.QtWidgets import *
    
    
    class Ui_Form(object):
        def setupUi(self, Form):
            if not Form.objectName():
                Form.setObjectName(u"Form")
            Form.resize(782, 717)
            self.gridLayout_5 = QGridLayout(Form)
            self.gridLayout_5.setObjectName(u"gridLayout_5")
            self.scrollArea = QScrollArea(Form)
            self.scrollArea.setObjectName(u"scrollArea")
            self.scrollArea.setWidgetResizable(True)
            self.scrollAreaWidgetContents = QWidget()
            self.scrollAreaWidgetContents.setObjectName(u"scrollAreaWidgetContents")
            self.scrollAreaWidgetContents.setGeometry(QRect(0, 0, 745, 1164))
            self.gridLayout_4 = QGridLayout(self.scrollAreaWidgetContents)
            self.gridLayout_4.setObjectName(u"gridLayout_4")
            self.widget_4 = QWidget(self.scrollAreaWidgetContents)
            self.widget_4.setObjectName(u"widget_4")
            self.verticalLayout = QVBoxLayout(self.widget_4)
            self.verticalLayout.setObjectName(u"verticalLayout")
            self.widget_3 = QWidget(self.widget_4)
            self.widget_3.setObjectName(u"widget_3")
            self.gridLayout_3 = QGridLayout(self.widget_3)
            self.gridLayout_3.setObjectName(u"gridLayout_3")
            self.pushButton_25 = QPushButton(self.widget_3)
            self.pushButton_25.setObjectName(u"pushButton_25")
            self.pushButton_25.setEnabled(False)
    
            self.gridLayout_3.addWidget(self.pushButton_25, 0, 0, 1, 1)
    
            self.pushButton_26 = QPushButton(self.widget_3)
            self.pushButton_26.setObjectName(u"pushButton_26")
            self.pushButton_26.setEnabled(False)
    
            self.gridLayout_3.addWidget(self.pushButton_26, 1, 0, 1, 1)
    
            self.pushButton_27 = QPushButton(self.widget_3)
            self.pushButton_27.setObjectName(u"pushButton_27")
            self.pushButton_27.setEnabled(False)
    
            self.gridLayout_3.addWidget(self.pushButton_27, 2, 0, 1, 1)
    
            self.pushButton_28 = QPushButton(self.widget_3)
            self.pushButton_28.setObjectName(u"pushButton_28")
            self.pushButton_28.setEnabled(False)
    
            self.gridLayout_3.addWidget(self.pushButton_28, 3, 0, 1, 1)
    
            self.pushButton_29 = QPushButton(self.widget_3)
            self.pushButton_29.setObjectName(u"pushButton_29")
            self.pushButton_29.setEnabled(False)
    
            self.gridLayout_3.addWidget(self.pushButton_29, 4, 0, 1, 1)
    
            self.pushButton_30 = QPushButton(self.widget_3)
            self.pushButton_30.setObjectName(u"pushButton_30")
            self.pushButton_30.setEnabled(False)
    
            self.gridLayout_3.addWidget(self.pushButton_30, 5, 0, 1, 1)
    
            self.pushButton_31 = QPushButton(self.widget_3)
            self.pushButton_31.setObjectName(u"pushButton_31")
            self.pushButton_31.setEnabled(False)
    
            self.gridLayout_3.addWidget(self.pushButton_31, 6, 0, 1, 1)
    
            self.pushButton_32 = QPushButton(self.widget_3)
            self.pushButton_32.setObjectName(u"pushButton_32")
            self.pushButton_32.setEnabled(False)
    
            self.gridLayout_3.addWidget(self.pushButton_32, 7, 0, 1, 1)
    
            self.pushButton_33 = QPushButton(self.widget_3)
            self.pushButton_33.setObjectName(u"pushButton_33")
            self.pushButton_33.setEnabled(False)
    
            self.gridLayout_3.addWidget(self.pushButton_33, 8, 0, 1, 1)
    
            self.pushButton_34 = QPushButton(self.widget_3)
            self.pushButton_34.setObjectName(u"pushButton_34")
            self.pushButton_34.setEnabled(False)
    
            self.gridLayout_3.addWidget(self.pushButton_34, 9, 0, 1, 1)
    
            self.pushButton_35 = QPushButton(self.widget_3)
            self.pushButton_35.setObjectName(u"pushButton_35")
            self.pushButton_35.setEnabled(False)
    
            self.gridLayout_3.addWidget(self.pushButton_35, 10, 0, 1, 1)
    
            self.pushButton_36 = QPushButton(self.widget_3)
            self.pushButton_36.setObjectName(u"pushButton_36")
            self.pushButton_36.setEnabled(False)
    
            self.gridLayout_3.addWidget(self.pushButton_36, 11, 0, 1, 1)
    
    
            self.verticalLayout.addWidget(self.widget_3)
    
            self.widget = QWidget(self.widget_4)
            self.widget.setObjectName(u"widget")
            self.gridLayout = QGridLayout(self.widget)
            self.gridLayout.setObjectName(u"gridLayout")
            self.pushButton = QPushButton(self.widget)
            self.pushButton.setObjectName(u"pushButton")
            self.pushButton.setEnabled(False)
    
            self.gridLayout.addWidget(self.pushButton, 0, 0, 1, 1)
    
            self.pushButton_2 = QPushButton(self.widget)
            self.pushButton_2.setObjectName(u"pushButton_2")
            self.pushButton_2.setEnabled(False)
    
            self.gridLayout.addWidget(self.pushButton_2, 1, 0, 1, 1)
    
            self.pushButton_3 = QPushButton(self.widget)
            self.pushButton_3.setObjectName(u"pushButton_3")
            self.pushButton_3.setEnabled(False)
    
            self.gridLayout.addWidget(self.pushButton_3, 2, 0, 1, 1)
    
            self.pushButton_4 = QPushButton(self.widget)
            self.pushButton_4.setObjectName(u"pushButton_4")
            self.pushButton_4.setEnabled(False)
    
            self.gridLayout.addWidget(self.pushButton_4, 3, 0, 1, 1)
    
            self.pushButton_5 = QPushButton(self.widget)
            self.pushButton_5.setObjectName(u"pushButton_5")
            self.pushButton_5.setEnabled(False)
    
            self.gridLayout.addWidget(self.pushButton_5, 4, 0, 1, 1)
    
            self.pushButton_6 = QPushButton(self.widget)
            self.pushButton_6.setObjectName(u"pushButton_6")
            self.pushButton_6.setEnabled(False)
    
            self.gridLayout.addWidget(self.pushButton_6, 5, 0, 1, 1)
    
            self.pushButton_7 = QPushButton(self.widget)
            self.pushButton_7.setObjectName(u"pushButton_7")
            self.pushButton_7.setEnabled(False)
    
            self.gridLayout.addWidget(self.pushButton_7, 6, 0, 1, 1)
    
            self.pushButton_8 = QPushButton(self.widget)
            self.pushButton_8.setObjectName(u"pushButton_8")
            self.pushButton_8.setEnabled(False)
    
            self.gridLayout.addWidget(self.pushButton_8, 7, 0, 1, 1)
    
            self.pushButton_9 = QPushButton(self.widget)
            self.pushButton_9.setObjectName(u"pushButton_9")
            self.pushButton_9.setEnabled(False)
    
            self.gridLayout.addWidget(self.pushButton_9, 8, 0, 1, 1)
    
            self.pushButton_10 = QPushButton(self.widget)
            self.pushButton_10.setObjectName(u"pushButton_10")
            self.pushButton_10.setEnabled(False)
    
            self.gridLayout.addWidget(self.pushButton_10, 9, 0, 1, 1)
    
            self.pushButton_11 = QPushButton(self.widget)
            self.pushButton_11.setObjectName(u"pushButton_11")
            self.pushButton_11.setEnabled(False)
    
            self.gridLayout.addWidget(self.pushButton_11, 10, 0, 1, 1)
    
            self.pushButton_12 = QPushButton(self.widget)
            self.pushButton_12.setObjectName(u"pushButton_12")
            self.pushButton_12.setEnabled(False)
    
            self.gridLayout.addWidget(self.pushButton_12, 11, 0, 1, 1)
    
    
            self.verticalLayout.addWidget(self.widget)
    
            self.widget_2 = QWidget(self.widget_4)
            self.widget_2.setObjectName(u"widget_2")
            self.gridLayout_2 = QGridLayout(self.widget_2)
            self.gridLayout_2.setObjectName(u"gridLayout_2")
            self.pushButton_13 = QPushButton(self.widget_2)
            self.pushButton_13.setObjectName(u"pushButton_13")
            self.pushButton_13.setEnabled(False)
    
            self.gridLayout_2.addWidget(self.pushButton_13, 0, 0, 1, 1)
    
            self.pushButton_14 = QPushButton(self.widget_2)
            self.pushButton_14.setObjectName(u"pushButton_14")
            self.pushButton_14.setEnabled(False)
    
            self.gridLayout_2.addWidget(self.pushButton_14, 1, 0, 1, 1)
    
            self.pushButton_15 = QPushButton(self.widget_2)
            self.pushButton_15.setObjectName(u"pushButton_15")
            self.pushButton_15.setEnabled(False)
    
            self.gridLayout_2.addWidget(self.pushButton_15, 2, 0, 1, 1)
    
            self.pushButton_16 = QPushButton(self.widget_2)
            self.pushButton_16.setObjectName(u"pushButton_16")
            self.pushButton_16.setEnabled(False)
    
            self.gridLayout_2.addWidget(self.pushButton_16, 3, 0, 1, 1)
    
            self.pushButton_17 = QPushButton(self.widget_2)
            self.pushButton_17.setObjectName(u"pushButton_17")
            self.pushButton_17.setEnabled(False)
    
            self.gridLayout_2.addWidget(self.pushButton_17, 4, 0, 1, 1)
    
            self.pushButton_18 = QPushButton(self.widget_2)
            self.pushButton_18.setObjectName(u"pushButton_18")
            self.pushButton_18.setEnabled(False)
    
            self.gridLayout_2.addWidget(self.pushButton_18, 5, 0, 1, 1)
    
            self.pushButton_19 = QPushButton(self.widget_2)
            self.pushButton_19.setObjectName(u"pushButton_19")
            self.pushButton_19.setEnabled(False)
    
            self.gridLayout_2.addWidget(self.pushButton_19, 6, 0, 1, 1)
    
            self.pushButton_20 = QPushButton(self.widget_2)
            self.pushButton_20.setObjectName(u"pushButton_20")
            self.pushButton_20.setEnabled(False)
    
            self.gridLayout_2.addWidget(self.pushButton_20, 7, 0, 1, 1)
    
            self.pushButton_21 = QPushButton(self.widget_2)
            self.pushButton_21.setObjectName(u"pushButton_21")
            self.pushButton_21.setEnabled(False)
    
            self.gridLayout_2.addWidget(self.pushButton_21, 8, 0, 1, 1)
    
            self.pushButton_22 = QPushButton(self.widget_2)
            self.pushButton_22.setObjectName(u"pushButton_22")
            self.pushButton_22.setEnabled(False)
    
            self.gridLayout_2.addWidget(self.pushButton_22, 9, 0, 1, 1)
    
            self.pushButton_23 = QPushButton(self.widget_2)
            self.pushButton_23.setObjectName(u"pushButton_23")
            self.pushButton_23.setEnabled(False)
    
            self.gridLayout_2.addWidget(self.pushButton_23, 10, 0, 1, 1)
    
            self.pushButton_24 = QPushButton(self.widget_2)
            self.pushButton_24.setObjectName(u"pushButton_24")
            self.pushButton_24.setEnabled(False)
    
            self.gridLayout_2.addWidget(self.pushButton_24, 11, 0, 1, 1)
    
    
            self.verticalLayout.addWidget(self.widget_2)
    
    
            self.gridLayout_4.addWidget(self.widget_4, 0, 0, 1, 1)
    
            self.scrollArea.setWidget(self.scrollAreaWidgetContents)
    
            self.gridLayout_5.addWidget(self.scrollArea, 0, 0, 1, 1)
    
    
            self.retranslateUi(Form)
    
            QMetaObject.connectSlotsByName(Form)
        # setupUi
    
        def retranslateUi(self, Form):
            Form.setWindowTitle(QCoreApplication.translate("Form", u"Form", None))
            self.pushButton_25.setText(QCoreApplication.translate("Form", u"PushButton", None))
            self.pushButton_26.setText(QCoreApplication.translate("Form", u"PushButton", None))
            self.pushButton_27.setText(QCoreApplication.translate("Form", u"PushButton", None))
            self.pushButton_28.setText(QCoreApplication.translate("Form", u"PushButton", None))
            self.pushButton_29.setText(QCoreApplication.translate("Form", u"PushButton", None))
            self.pushButton_30.setText(QCoreApplication.translate("Form", u"PushButton", None))
            self.pushButton_31.setText(QCoreApplication.translate("Form", u"PushButton", None))
            self.pushButton_32.setText(QCoreApplication.translate("Form", u"PushButton", None))
            self.pushButton_33.setText(QCoreApplication.translate("Form", u"PushButton", None))
            self.pushButton_34.setText(QCoreApplication.translate("Form", u"PushButton", None))
            self.pushButton_35.setText(QCoreApplication.translate("Form", u"PushButton", None))
            self.pushButton_36.setText(QCoreApplication.translate("Form", u"PushButton", None))
            self.pushButton.setText(QCoreApplication.translate("Form", u"PushButton", None))
            self.pushButton_2.setText(QCoreApplication.translate("Form", u"PushButton", None))
            self.pushButton_3.setText(QCoreApplication.translate("Form", u"PushButton", None))
            self.pushButton_4.setText(QCoreApplication.translate("Form", u"PushButton", None))
            self.pushButton_5.setText(QCoreApplication.translate("Form", u"PushButton", None))
            self.pushButton_6.setText(QCoreApplication.translate("Form", u"PushButton", None))
            self.pushButton_7.setText(QCoreApplication.translate("Form", u"PushButton", None))
            self.pushButton_8.setText(QCoreApplication.translate("Form", u"PushButton", None))
            self.pushButton_9.setText(QCoreApplication.translate("Form", u"PushButton", None))
            self.pushButton_10.setText(QCoreApplication.translate("Form", u"PushButton", None))
            self.pushButton_11.setText(QCoreApplication.translate("Form", u"PushButton", None))
            self.pushButton_12.setText(QCoreApplication.translate("Form", u"PushButton", None))
            self.pushButton_13.setText(QCoreApplication.translate("Form", u"PushButton", None))
            self.pushButton_14.setText(QCoreApplication.translate("Form", u"PushButton", None))
            self.pushButton_15.setText(QCoreApplication.translate("Form", u"PushButton", None))
            self.pushButton_16.setText(QCoreApplication.translate("Form", u"PushButton", None))
            self.pushButton_17.setText(QCoreApplication.translate("Form", u"PushButton", None))
            self.pushButton_18.setText(QCoreApplication.translate("Form", u"PushButton", None))
            self.pushButton_19.setText(QCoreApplication.translate("Form", u"PushButton", None))
            self.pushButton_20.setText(QCoreApplication.translate("Form", u"PushButton", None))
            self.pushButton_21.setText(QCoreApplication.translate("Form", u"PushButton", None))
            self.pushButton_22.setText(QCoreApplication.translate("Form", u"PushButton", None))
            self.pushButton_23.setText(QCoreApplication.translate("Form", u"PushButton", None))
            self.pushButton_24.setText(QCoreApplication.translate("Form", u"PushButton", None))
        # retranslateUi
    
    
    

  • Moderators

    You can change widget's focus policy to StrongFocus when you disable it and then back to WheelFocus when you enable it.



  • @Chris-Kawa said in Disabled widget hogs scrollEvents... how to disable?:

    You can change widget's focus policy to StrongFocus when you disable it and then back to WheelFocus when you enable it.

    Looking at the example... the QPushButton is already in strong focus. And changing policy to other ones does not help...

    Bug?


  • Moderators

    Sorry, I didn't read through all that code. I assumed the widget that stole the wheel event is something like a spinbox in which case it would've worked. QPushButton doesn't do anything with mouse wheel and it shouldn't even take that event. I just made a small test and it doesn't so it must be something specific to your code.
    I don't have pyside set up to test it though.



  • @Chris-Kawa Not python related, I run it from qtDesigner. Here is ui/code >

    /********************************************************************************
    ** Form generated from reading UI file 'designerOyuTJS.ui'
    **
    ** Created by: Qt User Interface Compiler version 6.0.0
    **
    ** WARNING! All changes made in this file will be lost when recompiling UI file!
    ********************************************************************************/
    
    #ifndef DESIGNEROYUTJS_H
    #define DESIGNEROYUTJS_H
    
    #include <QtCore/QVariant>
    #include <QtWidgets/QApplication>
    #include <QtWidgets/QGridLayout>
    #include <QtWidgets/QPushButton>
    #include <QtWidgets/QScrollArea>
    #include <QtWidgets/QVBoxLayout>
    #include <QtWidgets/QWidget>
    
    QT_BEGIN_NAMESPACE
    
    class Ui_Form
    {
    public:
        QGridLayout *gridLayout_5;
        QScrollArea *scrollArea;
        QWidget *scrollAreaWidgetContents;
        QGridLayout *gridLayout_4;
        QWidget *widget_4;
        QVBoxLayout *verticalLayout;
        QWidget *widget_3;
        QGridLayout *gridLayout_3;
        QPushButton *pushButton_33;
        QPushButton *pushButton_31;
        QPushButton *pushButton_26;
        QPushButton *pushButton_29;
        QPushButton *pushButton_30;
        QPushButton *pushButton_34;
        QPushButton *pushButton_36;
        QPushButton *pushButton_32;
        QPushButton *pushButton_27;
        QPushButton *pushButton_35;
        QPushButton *pushButton_25;
        QPushButton *pushButton_28;
        QWidget *widget;
        QGridLayout *gridLayout;
        QPushButton *pushButton;
        QPushButton *pushButton_2;
        QPushButton *pushButton_9;
        QPushButton *pushButton_12;
        QPushButton *pushButton_7;
        QPushButton *pushButton_6;
        QPushButton *pushButton_11;
        QPushButton *pushButton_8;
        QPushButton *pushButton_10;
        QPushButton *pushButton_3;
        QPushButton *pushButton_4;
        QPushButton *pushButton_5;
        QWidget *widget_2;
        QGridLayout *gridLayout_2;
        QPushButton *pushButton_14;
        QPushButton *pushButton_21;
        QPushButton *pushButton_22;
        QPushButton *pushButton_16;
        QPushButton *pushButton_19;
        QPushButton *pushButton_15;
        QPushButton *pushButton_18;
        QPushButton *pushButton_23;
        QPushButton *pushButton_17;
        QPushButton *pushButton_13;
        QPushButton *pushButton_20;
        QPushButton *pushButton_24;
    
        void setupUi(QWidget *Form)
        {
            if (Form->objectName().isEmpty())
                Form->setObjectName(QString::fromUtf8("Form"));
            Form->resize(1058, 1046);
            gridLayout_5 = new QGridLayout(Form);
            gridLayout_5->setObjectName(QString::fromUtf8("gridLayout_5"));
            scrollArea = new QScrollArea(Form);
            scrollArea->setObjectName(QString::fromUtf8("scrollArea"));
            scrollArea->setWidgetResizable(true);
            scrollAreaWidgetContents = new QWidget();
            scrollAreaWidgetContents->setObjectName(QString::fromUtf8("scrollAreaWidgetContents"));
            scrollAreaWidgetContents->setGeometry(QRect(0, 0, 1021, 1164));
            gridLayout_4 = new QGridLayout(scrollAreaWidgetContents);
            gridLayout_4->setObjectName(QString::fromUtf8("gridLayout_4"));
            widget_4 = new QWidget(scrollAreaWidgetContents);
            widget_4->setObjectName(QString::fromUtf8("widget_4"));
            verticalLayout = new QVBoxLayout(widget_4);
            verticalLayout->setObjectName(QString::fromUtf8("verticalLayout"));
            widget_3 = new QWidget(widget_4);
            widget_3->setObjectName(QString::fromUtf8("widget_3"));
            gridLayout_3 = new QGridLayout(widget_3);
            gridLayout_3->setObjectName(QString::fromUtf8("gridLayout_3"));
            pushButton_33 = new QPushButton(widget_3);
            pushButton_33->setObjectName(QString::fromUtf8("pushButton_33"));
            pushButton_33->setEnabled(false);
    
            gridLayout_3->addWidget(pushButton_33, 8, 0, 1, 1);
    
            pushButton_31 = new QPushButton(widget_3);
            pushButton_31->setObjectName(QString::fromUtf8("pushButton_31"));
            pushButton_31->setEnabled(false);
    
            gridLayout_3->addWidget(pushButton_31, 6, 0, 1, 1);
    
            pushButton_26 = new QPushButton(widget_3);
            pushButton_26->setObjectName(QString::fromUtf8("pushButton_26"));
            pushButton_26->setEnabled(false);
    
            gridLayout_3->addWidget(pushButton_26, 1, 0, 1, 1);
    
            pushButton_29 = new QPushButton(widget_3);
            pushButton_29->setObjectName(QString::fromUtf8("pushButton_29"));
            pushButton_29->setEnabled(false);
    
            gridLayout_3->addWidget(pushButton_29, 4, 0, 1, 1);
    
            pushButton_30 = new QPushButton(widget_3);
            pushButton_30->setObjectName(QString::fromUtf8("pushButton_30"));
            pushButton_30->setEnabled(false);
    
            gridLayout_3->addWidget(pushButton_30, 5, 0, 1, 1);
    
            pushButton_34 = new QPushButton(widget_3);
            pushButton_34->setObjectName(QString::fromUtf8("pushButton_34"));
            pushButton_34->setEnabled(false);
    
            gridLayout_3->addWidget(pushButton_34, 9, 0, 1, 1);
    
            pushButton_36 = new QPushButton(widget_3);
            pushButton_36->setObjectName(QString::fromUtf8("pushButton_36"));
            pushButton_36->setEnabled(false);
    
            gridLayout_3->addWidget(pushButton_36, 11, 0, 1, 1);
    
            pushButton_32 = new QPushButton(widget_3);
            pushButton_32->setObjectName(QString::fromUtf8("pushButton_32"));
            pushButton_32->setEnabled(false);
    
            gridLayout_3->addWidget(pushButton_32, 7, 0, 1, 1);
    
            pushButton_27 = new QPushButton(widget_3);
            pushButton_27->setObjectName(QString::fromUtf8("pushButton_27"));
            pushButton_27->setEnabled(false);
    
            gridLayout_3->addWidget(pushButton_27, 2, 0, 1, 1);
    
            pushButton_35 = new QPushButton(widget_3);
            pushButton_35->setObjectName(QString::fromUtf8("pushButton_35"));
            pushButton_35->setEnabled(false);
    
            gridLayout_3->addWidget(pushButton_35, 10, 0, 1, 1);
    
            pushButton_25 = new QPushButton(widget_3);
            pushButton_25->setObjectName(QString::fromUtf8("pushButton_25"));
            pushButton_25->setEnabled(false);
    
            gridLayout_3->addWidget(pushButton_25, 0, 0, 1, 1);
    
            pushButton_28 = new QPushButton(widget_3);
            pushButton_28->setObjectName(QString::fromUtf8("pushButton_28"));
            pushButton_28->setEnabled(false);
    
            gridLayout_3->addWidget(pushButton_28, 3, 0, 1, 1);
    
    
            verticalLayout->addWidget(widget_3);
    
            widget = new QWidget(widget_4);
            widget->setObjectName(QString::fromUtf8("widget"));
            gridLayout = new QGridLayout(widget);
            gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
            pushButton = new QPushButton(widget);
            pushButton->setObjectName(QString::fromUtf8("pushButton"));
            pushButton->setEnabled(false);
    
            gridLayout->addWidget(pushButton, 0, 0, 1, 1);
    
            pushButton_2 = new QPushButton(widget);
            pushButton_2->setObjectName(QString::fromUtf8("pushButton_2"));
            pushButton_2->setEnabled(false);
    
            gridLayout->addWidget(pushButton_2, 1, 0, 1, 1);
    
            pushButton_9 = new QPushButton(widget);
            pushButton_9->setObjectName(QString::fromUtf8("pushButton_9"));
            pushButton_9->setEnabled(false);
    
            gridLayout->addWidget(pushButton_9, 8, 0, 1, 1);
    
            pushButton_12 = new QPushButton(widget);
            pushButton_12->setObjectName(QString::fromUtf8("pushButton_12"));
            pushButton_12->setEnabled(false);
    
            gridLayout->addWidget(pushButton_12, 11, 0, 1, 1);
    
            pushButton_7 = new QPushButton(widget);
            pushButton_7->setObjectName(QString::fromUtf8("pushButton_7"));
            pushButton_7->setEnabled(false);
    
            gridLayout->addWidget(pushButton_7, 6, 0, 1, 1);
    
            pushButton_6 = new QPushButton(widget);
            pushButton_6->setObjectName(QString::fromUtf8("pushButton_6"));
            pushButton_6->setEnabled(false);
    
            gridLayout->addWidget(pushButton_6, 5, 0, 1, 1);
    
            pushButton_11 = new QPushButton(widget);
            pushButton_11->setObjectName(QString::fromUtf8("pushButton_11"));
            pushButton_11->setEnabled(false);
    
            gridLayout->addWidget(pushButton_11, 10, 0, 1, 1);
    
            pushButton_8 = new QPushButton(widget);
            pushButton_8->setObjectName(QString::fromUtf8("pushButton_8"));
            pushButton_8->setEnabled(false);
    
            gridLayout->addWidget(pushButton_8, 7, 0, 1, 1);
    
            pushButton_10 = new QPushButton(widget);
            pushButton_10->setObjectName(QString::fromUtf8("pushButton_10"));
            pushButton_10->setEnabled(false);
    
            gridLayout->addWidget(pushButton_10, 9, 0, 1, 1);
    
            pushButton_3 = new QPushButton(widget);
            pushButton_3->setObjectName(QString::fromUtf8("pushButton_3"));
            pushButton_3->setEnabled(false);
    
            gridLayout->addWidget(pushButton_3, 2, 0, 1, 1);
    
            pushButton_4 = new QPushButton(widget);
            pushButton_4->setObjectName(QString::fromUtf8("pushButton_4"));
            pushButton_4->setEnabled(false);
    
            gridLayout->addWidget(pushButton_4, 3, 0, 1, 1);
    
            pushButton_5 = new QPushButton(widget);
            pushButton_5->setObjectName(QString::fromUtf8("pushButton_5"));
            pushButton_5->setEnabled(false);
    
            gridLayout->addWidget(pushButton_5, 4, 0, 1, 1);
    
    
            verticalLayout->addWidget(widget);
    
            widget_2 = new QWidget(widget_4);
            widget_2->setObjectName(QString::fromUtf8("widget_2"));
            gridLayout_2 = new QGridLayout(widget_2);
            gridLayout_2->setObjectName(QString::fromUtf8("gridLayout_2"));
            pushButton_14 = new QPushButton(widget_2);
            pushButton_14->setObjectName(QString::fromUtf8("pushButton_14"));
            pushButton_14->setEnabled(false);
    
            gridLayout_2->addWidget(pushButton_14, 1, 0, 1, 1);
    
            pushButton_21 = new QPushButton(widget_2);
            pushButton_21->setObjectName(QString::fromUtf8("pushButton_21"));
            pushButton_21->setEnabled(false);
    
            gridLayout_2->addWidget(pushButton_21, 8, 0, 1, 1);
    
            pushButton_22 = new QPushButton(widget_2);
            pushButton_22->setObjectName(QString::fromUtf8("pushButton_22"));
            pushButton_22->setEnabled(false);
    
            gridLayout_2->addWidget(pushButton_22, 9, 0, 1, 1);
    
            pushButton_16 = new QPushButton(widget_2);
            pushButton_16->setObjectName(QString::fromUtf8("pushButton_16"));
            pushButton_16->setEnabled(false);
    
            gridLayout_2->addWidget(pushButton_16, 3, 0, 1, 1);
    
            pushButton_19 = new QPushButton(widget_2);
            pushButton_19->setObjectName(QString::fromUtf8("pushButton_19"));
            pushButton_19->setEnabled(false);
    
            gridLayout_2->addWidget(pushButton_19, 6, 0, 1, 1);
    
            pushButton_15 = new QPushButton(widget_2);
            pushButton_15->setObjectName(QString::fromUtf8("pushButton_15"));
            pushButton_15->setEnabled(false);
    
            gridLayout_2->addWidget(pushButton_15, 2, 0, 1, 1);
    
            pushButton_18 = new QPushButton(widget_2);
            pushButton_18->setObjectName(QString::fromUtf8("pushButton_18"));
            pushButton_18->setEnabled(false);
    
            gridLayout_2->addWidget(pushButton_18, 5, 0, 1, 1);
    
            pushButton_23 = new QPushButton(widget_2);
            pushButton_23->setObjectName(QString::fromUtf8("pushButton_23"));
            pushButton_23->setEnabled(false);
    
            gridLayout_2->addWidget(pushButton_23, 10, 0, 1, 1);
    
            pushButton_17 = new QPushButton(widget_2);
            pushButton_17->setObjectName(QString::fromUtf8("pushButton_17"));
            pushButton_17->setEnabled(false);
    
            gridLayout_2->addWidget(pushButton_17, 4, 0, 1, 1);
    
            pushButton_13 = new QPushButton(widget_2);
            pushButton_13->setObjectName(QString::fromUtf8("pushButton_13"));
            pushButton_13->setEnabled(false);
    
            gridLayout_2->addWidget(pushButton_13, 0, 0, 1, 1);
    
            pushButton_20 = new QPushButton(widget_2);
            pushButton_20->setObjectName(QString::fromUtf8("pushButton_20"));
            pushButton_20->setEnabled(false);
    
            gridLayout_2->addWidget(pushButton_20, 7, 0, 1, 1);
    
            pushButton_24 = new QPushButton(widget_2);
            pushButton_24->setObjectName(QString::fromUtf8("pushButton_24"));
            pushButton_24->setEnabled(false);
    
            gridLayout_2->addWidget(pushButton_24, 11, 0, 1, 1);
    
    
            verticalLayout->addWidget(widget_2);
    
    
            gridLayout_4->addWidget(widget_4, 0, 0, 1, 1);
    
            scrollArea->setWidget(scrollAreaWidgetContents);
    
            gridLayout_5->addWidget(scrollArea, 0, 0, 1, 1);
    
    
            retranslateUi(Form);
    
            QMetaObject::connectSlotsByName(Form);
        } // setupUi
    
        void retranslateUi(QWidget *Form)
        {
            Form->setWindowTitle(QCoreApplication::translate("Form", "Form", nullptr));
            pushButton_33->setText(QCoreApplication::translate("Form", "PushButton", nullptr));
            pushButton_31->setText(QCoreApplication::translate("Form", "PushButton", nullptr));
            pushButton_26->setText(QCoreApplication::translate("Form", "PushButton", nullptr));
            pushButton_29->setText(QCoreApplication::translate("Form", "PushButton", nullptr));
            pushButton_30->setText(QCoreApplication::translate("Form", "PushButton", nullptr));
            pushButton_34->setText(QCoreApplication::translate("Form", "PushButton", nullptr));
            pushButton_36->setText(QCoreApplication::translate("Form", "PushButton", nullptr));
            pushButton_32->setText(QCoreApplication::translate("Form", "PushButton", nullptr));
            pushButton_27->setText(QCoreApplication::translate("Form", "PushButton", nullptr));
            pushButton_35->setText(QCoreApplication::translate("Form", "PushButton", nullptr));
            pushButton_25->setText(QCoreApplication::translate("Form", "PushButton", nullptr));
            pushButton_28->setText(QCoreApplication::translate("Form", "PushButton", nullptr));
            pushButton->setText(QCoreApplication::translate("Form", "PushButton", nullptr));
            pushButton_2->setText(QCoreApplication::translate("Form", "PushButton", nullptr));
            pushButton_9->setText(QCoreApplication::translate("Form", "PushButton", nullptr));
            pushButton_12->setText(QCoreApplication::translate("Form", "PushButton", nullptr));
            pushButton_7->setText(QCoreApplication::translate("Form", "PushButton", nullptr));
            pushButton_6->setText(QCoreApplication::translate("Form", "PushButton", nullptr));
            pushButton_11->setText(QCoreApplication::translate("Form", "PushButton", nullptr));
            pushButton_8->setText(QCoreApplication::translate("Form", "PushButton", nullptr));
            pushButton_10->setText(QCoreApplication::translate("Form", "PushButton", nullptr));
            pushButton_3->setText(QCoreApplication::translate("Form", "PushButton", nullptr));
            pushButton_4->setText(QCoreApplication::translate("Form", "PushButton", nullptr));
            pushButton_5->setText(QCoreApplication::translate("Form", "PushButton", nullptr));
            pushButton_14->setText(QCoreApplication::translate("Form", "PushButton", nullptr));
            pushButton_21->setText(QCoreApplication::translate("Form", "PushButton", nullptr));
            pushButton_22->setText(QCoreApplication::translate("Form", "PushButton", nullptr));
            pushButton_16->setText(QCoreApplication::translate("Form", "PushButton", nullptr));
            pushButton_19->setText(QCoreApplication::translate("Form", "PushButton", nullptr));
            pushButton_15->setText(QCoreApplication::translate("Form", "PushButton", nullptr));
            pushButton_18->setText(QCoreApplication::translate("Form", "PushButton", nullptr));
            pushButton_23->setText(QCoreApplication::translate("Form", "PushButton", nullptr));
            pushButton_17->setText(QCoreApplication::translate("Form", "PushButton", nullptr));
            pushButton_13->setText(QCoreApplication::translate("Form", "PushButton", nullptr));
            pushButton_20->setText(QCoreApplication::translate("Form", "PushButton", nullptr));
            pushButton_24->setText(QCoreApplication::translate("Form", "PushButton", nullptr));
        } // retranslateUi
    
    };
    
    namespace Ui {
        class Form: public Ui_Form {};
    } // namespace Ui
    
    QT_END_NAMESPACE
    
    #endif // DESIGNEROYUTJS_H
    
    

    UI:

    <?xml version="1.0" encoding="UTF-8"?>
    <ui version="4.0">
     <class>Form</class>
     <widget class="QWidget" name="Form">
      <property name="geometry">
       <rect>
        <x>0</x>
        <y>0</y>
        <width>1058</width>
        <height>1046</height>
       </rect>
      </property>
      <property name="windowTitle">
       <string>Form</string>
      </property>
      <layout class="QGridLayout" name="gridLayout_5">
       <item row="0" column="0">
        <widget class="QScrollArea" name="scrollArea">
         <property name="widgetResizable">
          <bool>true</bool>
         </property>
         <widget class="QWidget" name="scrollAreaWidgetContents">
          <property name="geometry">
           <rect>
            <x>0</x>
            <y>0</y>
            <width>1021</width>
            <height>1164</height>
           </rect>
          </property>
          <layout class="QGridLayout" name="gridLayout_4">
           <item row="0" column="0">
            <widget class="QWidget" name="widget_4" native="true">
             <layout class="QVBoxLayout" name="verticalLayout">
              <item>
               <widget class="QWidget" name="widget_3" native="true">
                <layout class="QGridLayout" name="gridLayout_3">
                 <item row="8" column="0">
                  <widget class="QPushButton" name="pushButton_33">
                   <property name="enabled">
                    <bool>false</bool>
                   </property>
                   <property name="text">
                    <string>PushButton</string>
                   </property>
                  </widget>
                 </item>
                 <item row="6" column="0">
                  <widget class="QPushButton" name="pushButton_31">
                   <property name="enabled">
                    <bool>false</bool>
                   </property>
                   <property name="text">
                    <string>PushButton</string>
                   </property>
                  </widget>
                 </item>
                 <item row="1" column="0">
                  <widget class="QPushButton" name="pushButton_26">
                   <property name="enabled">
                    <bool>false</bool>
                   </property>
                   <property name="text">
                    <string>PushButton</string>
                   </property>
                  </widget>
                 </item>
                 <item row="4" column="0">
                  <widget class="QPushButton" name="pushButton_29">
                   <property name="enabled">
                    <bool>false</bool>
                   </property>
                   <property name="text">
                    <string>PushButton</string>
                   </property>
                  </widget>
                 </item>
                 <item row="5" column="0">
                  <widget class="QPushButton" name="pushButton_30">
                   <property name="enabled">
                    <bool>false</bool>
                   </property>
                   <property name="text">
                    <string>PushButton</string>
                   </property>
                  </widget>
                 </item>
                 <item row="9" column="0">
                  <widget class="QPushButton" name="pushButton_34">
                   <property name="enabled">
                    <bool>false</bool>
                   </property>
                   <property name="text">
                    <string>PushButton</string>
                   </property>
                  </widget>
                 </item>
                 <item row="11" column="0">
                  <widget class="QPushButton" name="pushButton_36">
                   <property name="enabled">
                    <bool>false</bool>
                   </property>
                   <property name="text">
                    <string>PushButton</string>
                   </property>
                  </widget>
                 </item>
                 <item row="7" column="0">
                  <widget class="QPushButton" name="pushButton_32">
                   <property name="enabled">
                    <bool>false</bool>
                   </property>
                   <property name="text">
                    <string>PushButton</string>
                   </property>
                  </widget>
                 </item>
                 <item row="2" column="0">
                  <widget class="QPushButton" name="pushButton_27">
                   <property name="enabled">
                    <bool>false</bool>
                   </property>
                   <property name="text">
                    <string>PushButton</string>
                   </property>
                  </widget>
                 </item>
                 <item row="10" column="0">
                  <widget class="QPushButton" name="pushButton_35">
                   <property name="enabled">
                    <bool>false</bool>
                   </property>
                   <property name="text">
                    <string>PushButton</string>
                   </property>
                  </widget>
                 </item>
                 <item row="0" column="0">
                  <widget class="QPushButton" name="pushButton_25">
                   <property name="enabled">
                    <bool>false</bool>
                   </property>
                   <property name="text">
                    <string>PushButton</string>
                   </property>
                  </widget>
                 </item>
                 <item row="3" column="0">
                  <widget class="QPushButton" name="pushButton_28">
                   <property name="enabled">
                    <bool>false</bool>
                   </property>
                   <property name="text">
                    <string>PushButton</string>
                   </property>
                  </widget>
                 </item>
                </layout>
               </widget>
              </item>
              <item>
               <widget class="QWidget" name="widget" native="true">
                <layout class="QGridLayout" name="gridLayout">
                 <item row="0" column="0">
                  <widget class="QPushButton" name="pushButton">
                   <property name="enabled">
                    <bool>false</bool>
                   </property>
                   <property name="text">
                    <string>PushButton</string>
                   </property>
                  </widget>
                 </item>
                 <item row="1" column="0">
                  <widget class="QPushButton" name="pushButton_2">
                   <property name="enabled">
                    <bool>false</bool>
                   </property>
                   <property name="text">
                    <string>PushButton</string>
                   </property>
                  </widget>
                 </item>
                 <item row="8" column="0">
                  <widget class="QPushButton" name="pushButton_9">
                   <property name="enabled">
                    <bool>false</bool>
                   </property>
                   <property name="text">
                    <string>PushButton</string>
                   </property>
                  </widget>
                 </item>
                 <item row="11" column="0">
                  <widget class="QPushButton" name="pushButton_12">
                   <property name="enabled">
                    <bool>false</bool>
                   </property>
                   <property name="text">
                    <string>PushButton</string>
                   </property>
                  </widget>
                 </item>
                 <item row="6" column="0">
                  <widget class="QPushButton" name="pushButton_7">
                   <property name="enabled">
                    <bool>false</bool>
                   </property>
                   <property name="text">
                    <string>PushButton</string>
                   </property>
                  </widget>
                 </item>
                 <item row="5" column="0">
                  <widget class="QPushButton" name="pushButton_6">
                   <property name="enabled">
                    <bool>false</bool>
                   </property>
                   <property name="text">
                    <string>PushButton</string>
                   </property>
                  </widget>
                 </item>
                 <item row="10" column="0">
                  <widget class="QPushButton" name="pushButton_11">
                   <property name="enabled">
                    <bool>false</bool>
                   </property>
                   <property name="text">
                    <string>PushButton</string>
                   </property>
                  </widget>
                 </item>
                 <item row="7" column="0">
                  <widget class="QPushButton" name="pushButton_8">
                   <property name="enabled">
                    <bool>false</bool>
                   </property>
                   <property name="text">
                    <string>PushButton</string>
                   </property>
                  </widget>
                 </item>
                 <item row="9" column="0">
                  <widget class="QPushButton" name="pushButton_10">
                   <property name="enabled">
                    <bool>false</bool>
                   </property>
                   <property name="text">
                    <string>PushButton</string>
                   </property>
                  </widget>
                 </item>
                 <item row="2" column="0">
                  <widget class="QPushButton" name="pushButton_3">
                   <property name="enabled">
                    <bool>false</bool>
                   </property>
                   <property name="text">
                    <string>PushButton</string>
                   </property>
                  </widget>
                 </item>
                 <item row="3" column="0">
                  <widget class="QPushButton" name="pushButton_4">
                   <property name="enabled">
                    <bool>false</bool>
                   </property>
                   <property name="text">
                    <string>PushButton</string>
                   </property>
                  </widget>
                 </item>
                 <item row="4" column="0">
                  <widget class="QPushButton" name="pushButton_5">
                   <property name="enabled">
                    <bool>false</bool>
                   </property>
                   <property name="text">
                    <string>PushButton</string>
                   </property>
                  </widget>
                 </item>
                </layout>
               </widget>
              </item>
              <item>
               <widget class="QWidget" name="widget_2" native="true">
                <layout class="QGridLayout" name="gridLayout_2">
                 <item row="1" column="0">
                  <widget class="QPushButton" name="pushButton_14">
                   <property name="enabled">
                    <bool>false</bool>
                   </property>
                   <property name="text">
                    <string>PushButton</string>
                   </property>
                  </widget>
                 </item>
                 <item row="8" column="0">
                  <widget class="QPushButton" name="pushButton_21">
                   <property name="enabled">
                    <bool>false</bool>
                   </property>
                   <property name="text">
                    <string>PushButton</string>
                   </property>
                  </widget>
                 </item>
                 <item row="9" column="0">
                  <widget class="QPushButton" name="pushButton_22">
                   <property name="enabled">
                    <bool>false</bool>
                   </property>
                   <property name="text">
                    <string>PushButton</string>
                   </property>
                  </widget>
                 </item>
                 <item row="3" column="0">
                  <widget class="QPushButton" name="pushButton_16">
                   <property name="enabled">
                    <bool>false</bool>
                   </property>
                   <property name="text">
                    <string>PushButton</string>
                   </property>
                  </widget>
                 </item>
                 <item row="6" column="0">
                  <widget class="QPushButton" name="pushButton_19">
                   <property name="enabled">
                    <bool>false</bool>
                   </property>
                   <property name="text">
                    <string>PushButton</string>
                   </property>
                  </widget>
                 </item>
                 <item row="2" column="0">
                  <widget class="QPushButton" name="pushButton_15">
                   <property name="enabled">
                    <bool>false</bool>
                   </property>
                   <property name="text">
                    <string>PushButton</string>
                   </property>
                  </widget>
                 </item>
                 <item row="5" column="0">
                  <widget class="QPushButton" name="pushButton_18">
                   <property name="enabled">
                    <bool>false</bool>
                   </property>
                   <property name="text">
                    <string>PushButton</string>
                   </property>
                  </widget>
                 </item>
                 <item row="10" column="0">
                  <widget class="QPushButton" name="pushButton_23">
                   <property name="enabled">
                    <bool>false</bool>
                   </property>
                   <property name="text">
                    <string>PushButton</string>
                   </property>
                  </widget>
                 </item>
                 <item row="4" column="0">
                  <widget class="QPushButton" name="pushButton_17">
                   <property name="enabled">
                    <bool>false</bool>
                   </property>
                   <property name="text">
                    <string>PushButton</string>
                   </property>
                  </widget>
                 </item>
                 <item row="0" column="0">
                  <widget class="QPushButton" name="pushButton_13">
                   <property name="enabled">
                    <bool>false</bool>
                   </property>
                   <property name="text">
                    <string>PushButton</string>
                   </property>
                  </widget>
                 </item>
                 <item row="7" column="0">
                  <widget class="QPushButton" name="pushButton_20">
                   <property name="enabled">
                    <bool>false</bool>
                   </property>
                   <property name="text">
                    <string>PushButton</string>
                   </property>
                  </widget>
                 </item>
                 <item row="11" column="0">
                  <widget class="QPushButton" name="pushButton_24">
                   <property name="enabled">
                    <bool>false</bool>
                   </property>
                   <property name="text">
                    <string>PushButton</string>
                   </property>
                  </widget>
                 </item>
                </layout>
               </widget>
              </item>
             </layout>
            </widget>
           </item>
          </layout>
         </widget>
        </widget>
       </item>
      </layout>
     </widget>
     <resources/>
     <connections/>
    </ui>
    
    

  • Moderators

    Works fine for me on Windows with Qt 5.12.2. What Qt version and OS are you using?



  • @Chris-Kawa Win10x64 Qt6 Perhaps its qt? Yea I tried qt5, all works, but 6 breaks. Bug or different setting/mechanic ? mhm


  • Moderators

    I can't think of a reason why a button would need a wheel event in Qt6, let alone one that can't be disabled, so I suggest you report a bug at bugreports.qt.io with (possibly smaller) repro.



  • @Chris-Kawa Its not just Qbutton, QradioButton also has it.


Log in to reply