m_focusLed = new QLed(this); // I create a QLed
m_focusLed->setFixedSize(13,13);// set its size to 13, 13
m_encodingLed = new QLed(this); // the same for the other led
m_encodingLed->setFixedSize(13,13);
QLabel* activeLabel
= new QLabel(tr
("A"));
// create a QLabel activeLabel->setFixedSize(13,10); // set the size
encodingLabel->setFixedSize(13, 10);
gl->setAlignment(Qt::AlignLeft);
gl->setContentsMargins(0, 0, 0, 0);
gl->addWidget(activeLabel, 0, 0);
gl->addWidget(m_focusLed, 0, 1);
gl->addWidget(encodingLabel, 1, 0);
gl->addWidget(m_encodingLed, 1, 1);
m_focusLed = new QLed(this); // I create a QLed
m_focusLed->setFixedSize(13,13);// set its size to 13, 13
m_encodingLed = new QLed(this); // the same for the other led
m_encodingLed->setFixedSize(13,13);
QLabel* activeLabel = new QLabel(tr("A")); // create a QLabel
activeLabel->setFixedSize(13,10); // set the size
QLabel* encodingLabel = new QLabel(tr("E"));
encodingLabel->setFixedSize(13, 10);
QGridLayout* gl = new QGridLayout(); // create the grid and add the widgets
gl->setAlignment(Qt::AlignLeft);
gl->setContentsMargins(0, 0, 0, 0);
gl->addWidget(activeLabel, 0, 0);
gl->addWidget(m_focusLed, 0, 1);
gl->addWidget(encodingLabel, 1, 0);
gl->addWidget(m_encodingLed, 1, 1);
To copy to clipboard, switch view to plain text mode
/* main layout */
lo->setSpacing(0);
lo->addLayout(gl); // <--add the grid layout
/* add more widgets ( buttons ) */
//...
/* main layout */
QHBoxLayout* lo = new QHBoxLayout();
lo->setSpacing(0);
lo->addLayout(gl); // <--add the grid layout
/* add more widgets ( buttons ) */
//...
To copy to clipboard, switch view to plain text mode
Bookmarks