Doc: Update connect syntax in I18n Widgets Example
Task-number: QTBUG-60635 Change-Id: Icfa0d09ac6c9ad4396fbe1138277bb1dd866a803 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>bb10
parent
5c240f380a
commit
5ffd47b764
|
|
@ -70,7 +70,10 @@ LanguageChooser::LanguageChooser(const QString& defaultLang, QWidget *parent)
|
|||
for (int i = 0; i < qmFiles.size(); ++i) {
|
||||
QCheckBox *checkBox = new QCheckBox(languageName(qmFiles[i]));
|
||||
qmFileForCheckBoxMap.insert(checkBox, qmFiles[i]);
|
||||
connect(checkBox, SIGNAL(toggled(bool)), this, SLOT(checkBoxToggled()));
|
||||
connect(checkBox,
|
||||
QOverload<bool>::of(&QCheckBox::toggled),
|
||||
this,
|
||||
&LanguageChooser::checkBoxToggled);
|
||||
if (languageMatch(defaultLang, qmFiles[i]))
|
||||
checkBox->setCheckState(Qt::Checked);
|
||||
groupBoxLayout->addWidget(checkBox, i / 2, i % 2);
|
||||
|
|
@ -84,8 +87,8 @@ LanguageChooser::LanguageChooser(const QString& defaultLang, QWidget *parent)
|
|||
hideAllButton = buttonBox->addButton("Hide All",
|
||||
QDialogButtonBox::ActionRole);
|
||||
|
||||
connect(showAllButton, SIGNAL(clicked()), this, SLOT(showAll()));
|
||||
connect(hideAllButton, SIGNAL(clicked()), this, SLOT(hideAll()));
|
||||
connect(showAllButton, &QAbstractButton::clicked, this, &LanguageChooser::showAll);
|
||||
connect(hideAllButton, &QAbstractButton::clicked, this, &LanguageChooser::hideAll);
|
||||
|
||||
QVBoxLayout *mainLayout = new QVBoxLayout;
|
||||
mainLayout->addWidget(groupBox);
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ MainWindow::MainWindow()
|
|||
centralWidget->setLayout(mainLayout);
|
||||
|
||||
exitAction = new QAction(tr("E&xit"), this);
|
||||
connect(exitAction, SIGNAL(triggered()), qApp, SLOT(quit()));
|
||||
connect(exitAction, &QAction::triggered, qApp, QApplication::quit);
|
||||
|
||||
fileMenu = menuBar()->addMenu(tr("&File"));
|
||||
fileMenu->setPalette(QPalette(Qt::red));
|
||||
|
|
|
|||
Loading…
Reference in New Issue