February 2019
Beginner
136 pages
3h 7m
English
In this section, we shall concern ourselves with how to connect a single signal to multiple slots.
Examine the following program:
#include <QApplication>#include <QVBoxLayout>#include <QLabel>#include <QDial>#include <QLCDNumber>int main(int argc, char *argv[]){ QApplication app(argc, argv); QWidget *window = new QWidget; QVBoxLayout *layout = new QVBoxLayout; QLabel *volumeLabel = new QLabel("0"); QDial *volumeDial= new QDial; QLCDNumber *volumeLCD = new QLCDNumber; volumeLCD->setPalette(Qt::red); volumeLabel->setAlignment(Qt::AlignHCenter); volumeDial->setNotchesVisible(true); volumeDial->setMinimum(0); volumeDial->setMaximum(100); layout->addWidget(volumeDial); layout->addWidget(volumeLabel); layout->addWidget(volumeLCD); ...Read now
Unlock full access