Updated Hello GL2 Example to new Signal/Slot syntax
The Hello GL2 Example was using the older Signal/Slot syntax that made use of the macros `SIGNAL()` and `SLOT()`. I changed it to the newer one. Change-Id: I8e55015383847a04b07f751fe9fc94b81956a896 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
This commit is contained in:
parent
2a81516835
commit
2a526b12ce
@ -51,7 +51,7 @@ MainWindow::MainWindow()
|
||||
QAction *addNew = new QAction(menuWindow);
|
||||
addNew->setText(tr("Add new"));
|
||||
menuWindow->addAction(addNew);
|
||||
connect(addNew, SIGNAL(triggered()), this, SLOT(onAddNew()));
|
||||
connect(addNew, &QAction::triggered, this, &MainWindow::onAddNew);
|
||||
setMenuBar(menuBar);
|
||||
|
||||
onAddNew();
|
||||
|
@ -59,12 +59,12 @@ Window::Window(MainWindow *mw)
|
||||
ySlider = createSlider();
|
||||
zSlider = createSlider();
|
||||
|
||||
connect(xSlider, SIGNAL(valueChanged(int)), glWidget, SLOT(setXRotation(int)));
|
||||
connect(glWidget, SIGNAL(xRotationChanged(int)), xSlider, SLOT(setValue(int)));
|
||||
connect(ySlider, SIGNAL(valueChanged(int)), glWidget, SLOT(setYRotation(int)));
|
||||
connect(glWidget, SIGNAL(yRotationChanged(int)), ySlider, SLOT(setValue(int)));
|
||||
connect(zSlider, SIGNAL(valueChanged(int)), glWidget, SLOT(setZRotation(int)));
|
||||
connect(glWidget, SIGNAL(zRotationChanged(int)), zSlider, SLOT(setValue(int)));
|
||||
connect(xSlider, &QSlider::valueChanged, glWidget, &GLWidget::setXRotation);
|
||||
connect(glWidget, &GLWidget::xRotationChanged, xSlider, &QSlider::setValue);
|
||||
connect(ySlider, &QSlider::valueChanged, glWidget, &GLWidget::setYRotation);
|
||||
connect(glWidget, &GLWidget::yRotationChanged, ySlider, &QSlider::setValue);
|
||||
connect(zSlider, &QSlider::valueChanged, glWidget, &GLWidget::setZRotation);
|
||||
connect(glWidget, &GLWidget::zRotationChanged, zSlider, &QSlider::setValue);
|
||||
|
||||
QVBoxLayout *mainLayout = new QVBoxLayout;
|
||||
QHBoxLayout *container = new QHBoxLayout;
|
||||
@ -77,7 +77,7 @@ Window::Window(MainWindow *mw)
|
||||
w->setLayout(container);
|
||||
mainLayout->addWidget(w);
|
||||
dockBtn = new QPushButton(tr("Undock"), this);
|
||||
connect(dockBtn, SIGNAL(clicked()), this, SLOT(dockUndock()));
|
||||
connect(dockBtn, &QPushButton::clicked, this, &Window::dockUndock);
|
||||
mainLayout->addWidget(dockBtn);
|
||||
|
||||
setLayout(mainLayout);
|
||||
|
Loading…
Reference in New Issue
Block a user