0

In specific dialog I want to disable the back button on Android. I read this, but I have an error:

expected unqualified-id before '->' token CLanguageDialogManager->button(QWizard::BackButton)->setEnabled(false);

Here is my code:

#include <QtWidgets>
#include <QWizard>
#include "languagedialog.h"

CLanguageDialogManager::CLanguageDialogManager(QWidget *parent)
    : QDialog(parent)
{
    // ...
    CLanguageDialogManager->button(QWizard::BackButton)->setEnabled(false);
    // ...
}
Community
  • 1
  • 1
Farzan Najipour
  • 2,442
  • 7
  • 42
  • 81

1 Answers1

0

There are a couple of problems with your code:

  1. Your syntax is wrong. CLanguageDialogManager is the name of your class, but the function you want to call - button() - is a class member. Rather than writing

CLanguageDialogManager->button(QWizard::BackButton)->setEnabled(false);

you should write

this->button(QWizard::BackButton)->setEnabled(false);

  1. The function you want to call - button() - is a member of QWizard, not a member of QDialog. It looks like CLanguageDialogManager inherits QDialog, perhaps you mean for it to inherit QWizard instead. If so, your constructor should begin CLanguageDialogManager::CLanguageDialogManager(QWidget *parent):QWizard(parent)
docsteer
  • 2,506
  • 16
  • 16