[Resolved] How to disable a button in a button box?



  • bq.
    C:\Qt_Projects\Hello10\dialog.cpp:9: error: invalid use of incomplete type 'class QPushButton'
    ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
    ^

    caused by

    @
    ui->setupUi(this);
    ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
    @

    What does it mean ?
    I tried to read the doc but this seems to be ok.

    'ui' is a form designer generated form
    'buttonBox' is the objectName of a ... buttonBox



  • I found the answer:

    in the dialog header i have to do this:

    @
    #include <QPushButton>
    @



  • Hi, Realtebo,

    mark it as solved.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.