Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QDialogButtonBox does not react when it gets styled

QDialogButtonBox does not react when it gets styled

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 247 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Q Offline
    Q Offline
    Quorn Julio
    wrote on last edited by
    #1

    now i have a proxy style called
    class ButtonProxyStyle : public QProxyStyle {}

    when i give that style to the buttons, they gets styled but does not react on clicks.

      QPushButton* buttonApply = this->ui->buttonBox->button(QDialogButtonBox::Apply);
      buttonApply->setDefault(true);
      buttonApply->setStyle(&this->buttonProxyStyle);
      QPushButton* buttonReset = this->ui->buttonBox->button(QDialogButtonBox::Reset);
      buttonReset->setStyle(&this->buttonProxyStyle);
    
      QObject::connect(buttonApply, &QPushButton::clicked, this, &MyWidget::accept);
      QObject::connect(buttonReset, &QPushButton::clicked, this, &MyWidget::reject);
    

    i do not have any idea why. can someone help?

    MacOS 12.1 - Qt 6.2.2

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      What if you set the style on the QApplication object ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • Q Offline
        Q Offline
        Quorn Julio
        wrote on last edited by
        #3

        i read this post:
        How to correctly use QProxyStyles?

        for me the important step is:

        this->buttonProxyStyle->setBaseStyle(buttonApply->style());
        

        MacOS 12.1 - Qt 6.2.2

        1 Reply Last reply
        1

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved