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. Why can't I set an enabled property on a QWizard custom button?

Why can't I set an enabled property on a QWizard custom button?

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.2k 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.
  • A Offline
    A Offline
    astodolski
    wrote on last edited by
    #1

    I have a QWizardPage class:

    @
    void PageOne::Refresh()
    {
    setCursor(Qt::WaitCursor);
    UnregisterScannerNotification();
    ui->lblSearching->setText(tr("Searching..."));
    repaint();
    RegisterScannerNotification();
    unsetCursor();

    wizard()->button(QWizard::CustomButton1)->setEnabled(false);    
    

    }
    @

    The QWizard class has the following in its constructor:

    @
    setButtonText(QWizard::CustomButton1, tr("Refresh"));
    setOption(QWizard::HaveCustomButton1, true);

    QList<QWizard::WizardButton> layout;
    layout << QWizard::CustomButton1
           << QWizard::Stretch
           << QWizard::BackButton
           << QWizard::NextButton
           << QWizard::CommitButton
           << QWizard::FinishButton
           << QWizard::CancelButton;
    
    setButtonLayout(layout);
    

    @

    The line in the QWizardPage class @wizard()->button(QWizard::CustomButton1)->setEnabled(false);@

    causes a compile error:

    pageone.cpp:82: error: C2027: use of undefined type 'QAbstractButton'

    and:

    pageone.cpp:78: error: C2227: left of '->setEnabled' must point to class/struct/union/generic type

    How else would you set the enabled property on a custom button?

    1 Reply Last reply
    0
    • p3c0P Offline
      p3c0P Offline
      p3c0
      Moderators
      wrote on last edited by
      #2

      AFAIK it is the correct way.
      Try including it
      @
      #include <QAbstractButton>
      @

      More info "Here":http://qt-project.org/doc/qt-4.8/dialogs-licensewizard.html

      157

      1 Reply Last reply
      0
      • A Offline
        A Offline
        astodolski
        wrote on last edited by
        #3

        [quote author="p3c0" date="1405704001"]AFAIK it is the correct way.
        Try including it
        @
        #include <QAbstractButton>
        @

        More info "Here":http://qt-project.org/doc/qt-4.8/dialogs-licensewizard.html[/quote]

        It's always the little details. Thanks. Missed that one. Can't say enough for second set of eyes

        1 Reply Last reply
        0

        • Login

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