summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2014-12-17 14:02:29 +0100
committerJoerg Bornemann <joerg.bornemann@theqtcompany.com>2014-12-22 15:13:14 +0100
commit90f0b3bf752c03393a62dae04db9d536453fb97c (patch)
treeb3cea785c54d3a780fec76b054c23b435c601b9d
parentdd224e5abf924e7e3927110a2a903bb496366d1e (diff)
downloadqtactiveqt-90f0b3bf752c03393a62dae04db9d536453fb97c.tar.gz
Use Qt 5 signals & slots syntax.
Change-Id: I92c4df2ca8a75d6caafa1900db0730d2e0abaf07 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
-rw-r--r--examples/activeqt/comapp/main.cpp2
-rw-r--r--examples/activeqt/menus/menus.cpp20
-rw-r--r--examples/activeqt/simple/main.cpp4
-rw-r--r--src/activeqt/container/qaxselect.cpp16
-rw-r--r--tools/testcon/ambientproperties.cpp2
-rw-r--r--tools/testcon/mainwindow.cpp7
6 files changed, 25 insertions, 26 deletions
diff --git a/examples/activeqt/comapp/main.cpp b/examples/activeqt/comapp/main.cpp
index 4c855dd..db002d5 100644
--- a/examples/activeqt/comapp/main.cpp
+++ b/examples/activeqt/comapp/main.cpp
@@ -264,7 +264,7 @@ int main(int argc, char **argv)
appobject.setVisible(true);
- QObject::connect(qApp, SIGNAL(lastWindowClosed()), &appobject, SLOT(quit()));
+ QObject::connect(&app, &QGuiApplication::lastWindowClosed, &appobject, &Application::quit);
return app.exec();
}
diff --git a/examples/activeqt/menus/menus.cpp b/examples/activeqt/menus/menus.cpp
index 908c88c..07c33d3 100644
--- a/examples/activeqt/menus/menus.cpp
+++ b/examples/activeqt/menus/menus.cpp
@@ -58,12 +58,12 @@ QMenus::QMenus(QWidget *parent)
action = new QAction(QPixmap((const char**)fileopen), "&Open", this);
action->setShortcut(tr("CTRL+O"));
- connect(action, SIGNAL(triggered()), this, SLOT(fileOpen()));
+ connect(action, &QAction::triggered, this, &QMenus::fileOpen);
file->addAction(action);
action = new QAction(QPixmap((const char**)filesave),"&Save", this);
action->setShortcut(tr("CTRL+S"));
- connect(action, SIGNAL(triggered()), this, SLOT(fileSave()));
+ connect(action, &QAction::triggered, this, &QMenus::fileSave);
file->addAction(action);
QMenu *edit = new QMenu(this);
@@ -73,28 +73,28 @@ QMenus::QMenus(QWidget *parent)
action->setToolTip("Normal");
action->setStatusTip("Toggles Normal");
action->setCheckable(true);
- connect(action, SIGNAL(triggered()), this, SLOT(editNormal()));
+ connect(action, &QAction::triggered, this, &QMenus::editNormal);
edit->addAction(action);
action = new QAction("&Bold", this);
action->setShortcut(tr("CTRL+B"));
action->setCheckable(true);
- connect(action, SIGNAL(triggered()), this, SLOT(editBold()));
+ connect(action, &QAction::triggered, this, &QMenus::editBold);
edit->addAction(action);
action = new QAction("&Underline", this);
action->setShortcut(tr("CTRL+U"));
action->setCheckable(true);
- connect(action, SIGNAL(triggered()), this, SLOT(editUnderline()));
+ connect(action, &QAction::triggered, this, &QMenus::editUnderline);
edit->addAction(action);
QMenu *advanced = new QMenu(this);
action = new QAction("&Font...", this);
- connect(action, SIGNAL(triggered()), this, SLOT(editAdvancedFont()));
+ connect(action, &QAction::triggered, this, &QMenus::editAdvancedFont);
advanced->addAction(action);
action = new QAction("&Style...", this);
- connect(action, SIGNAL(triggered()), this, SLOT(editAdvancedStyle()));
+ connect(action, &QAction::triggered, this, &QMenus::editAdvancedStyle);
advanced->addAction(action);
edit->addMenu(advanced)->setText("&Advanced");
@@ -105,18 +105,18 @@ QMenus::QMenus(QWidget *parent)
action->setShortcut(tr("CTRL+V"));
action->setCheckable(true);
action->setEnabled(false);
- connect(action, SIGNAL(triggered()), this, SLOT(editUnderline()));
+ connect(action, &QAction::triggered, this, &QMenus::editUnderline);
edit->addAction(action);
QMenu *help = new QMenu(this);
action = new QAction("&About...", this);
action->setShortcut(tr("F1"));
- connect(action, SIGNAL(triggered()), this, SLOT(helpAbout()));
+ connect(action, &QAction::triggered, this, &QMenus::helpAbout);
help->addAction(action);
action = new QAction("&About Qt...", this);
- connect(action, SIGNAL(triggered()), this, SLOT(helpAboutQt()));
+ connect(action, &QAction::triggered, this, &QMenus::helpAboutQt);
help->addAction(action);
if (!QAxFactory::isServer())
diff --git a/examples/activeqt/simple/main.cpp b/examples/activeqt/simple/main.cpp
index 487ccfa..44ee896 100644
--- a/examples/activeqt/simple/main.cpp
+++ b/examples/activeqt/simple/main.cpp
@@ -63,8 +63,8 @@ public:
LCD = new QLCDNumber( 3, this );
edit = new QLineEdit( this );
- connect( slider, SIGNAL(valueChanged(int)), this, SLOT(setValue(int)) );
- connect( edit, SIGNAL(textChanged(QString)), this, SLOT(setText(QString)) );
+ connect( slider, &QAbstractSlider::valueChanged, this, &QSimpleAX::setValue );
+ connect( edit, &QLineEdit::textChanged, this, &QSimpleAX::setText );
vbox->addWidget( slider );
vbox->addWidget( LCD );
diff --git a/src/activeqt/container/qaxselect.cpp b/src/activeqt/container/qaxselect.cpp
index a6234de..16e659a 100644
--- a/src/activeqt/container/qaxselect.cpp
+++ b/src/activeqt/container/qaxselect.cpp
@@ -298,20 +298,20 @@ QAxSelect::QAxSelect(QWidget *parent, Qt::WindowFlags flags)
d->filterModel->setSourceModel(new ControlList(this));
d->selectUi.ActiveXList->setModel(d->filterModel);
- connect(d->selectUi.ActiveXList->selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)),
- this, SLOT(onActiveXListCurrentChanged(QModelIndex)));
- connect(d->selectUi.ActiveXList, SIGNAL(activated(QModelIndex)),
- this, SLOT(onActiveXListActivated()));
+ connect(d->selectUi.ActiveXList->selectionModel(), &QItemSelectionModel::currentChanged,
+ this, &QAxSelect::onActiveXListCurrentChanged);
+ connect(d->selectUi.ActiveXList, &QAbstractItemView::activated,
+ this, &QAxSelect::onActiveXListActivated);
#ifndef QT_NO_CURSOR
QApplication::restoreOverrideCursor();
#endif
d->selectUi.ActiveXList->setFocus();
- connect(d->selectUi.buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
- connect(d->selectUi.buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
- connect(d->selectUi.filterLineEdit, SIGNAL(textChanged(QString)),
- this, SLOT(onFilterLineEditChanged(QString)));
+ connect(d->selectUi.buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
+ connect(d->selectUi.buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
+ connect(d->selectUi.filterLineEdit, &QLineEdit::textChanged,
+ this, &QAxSelect::onFilterLineEditChanged);
}
/*!
diff --git a/tools/testcon/ambientproperties.cpp b/tools/testcon/ambientproperties.cpp
index 449faa9..1972803 100644
--- a/tools/testcon/ambientproperties.cpp
+++ b/tools/testcon/ambientproperties.cpp
@@ -45,7 +45,7 @@ AmbientProperties::AmbientProperties(QWidget *parent)
{
setupUi(this);
- connect(buttonClose, SIGNAL(clicked()), this, SLOT(close()));
+ connect(buttonClose, &QAbstractButton::clicked, this, &QWidget::close);
}
void AmbientProperties::setControl(QWidget *widget)
diff --git a/tools/testcon/mainwindow.cpp b/tools/testcon/mainwindow.cpp
index 9af2693..b96a468 100644
--- a/tools/testcon/mainwindow.cpp
+++ b/tools/testcon/mainwindow.cpp
@@ -85,8 +85,8 @@ MainWindow::MainWindow(QWidget *parent)
layout->addWidget(mdiArea);
layout->setMargin(0);
- connect(mdiArea, SIGNAL(subWindowActivated(QMdiSubWindow*)), this, SLOT(updateGUI()));
- connect(actionFileExit, SIGNAL(triggered()), qApp, SLOT(quit()));
+ connect(mdiArea, &QMdiArea::subWindowActivated, this, &MainWindow::updateGUI);
+ connect(actionFileExit, &QAction::triggered, QCoreApplication::quit);
}
MainWindow::~MainWindow()
@@ -340,8 +340,7 @@ void MainWindow::on_actionScriptingLoad_triggered()
QAxScript *script = scripts->load(file, file);
if (script) {
- connect(script, SIGNAL(error(int,QString,int,QString)),
- this, SLOT(logMacro(int,QString,int,QString)));
+ connect(script, &QAxScript::error, this, &MainWindow::logMacro);
actionScriptingRun->setEnabled(true);
}
#else