void SwitchMonitor::initOneScreenMode(){ // for one-screen mode for (int i = 0, length = m_ScreenList.length(); i < length; i++) { // one-screen mode item QWidget *item = new QWidget(m_MonitersWrapper); QVBoxLayout *vLayout = new QVBoxLayout(item); // image label for one-screen mode QSvgWidget *imageSvg = new QSvgWidget(item); imageSvg->setFixedSize(IMAGE_SIZE, IMAGE_SIZE); QLabel* imageLabel = new QLabel(item); imageLabel->setFixedSize(IMAGE_SIZE, IMAGE_SIZE); showThemeImage(getThemeIconPath("project_screen-onlyone-symbolic"), imageSvg, imageLabel); // text label for one-screen mode QLabel *textLabel = new QLabel(item); textLabel->setText(m_ScreenList[i]); textLabel->setAlignment(Qt::AlignCenter); textLabel->setStyleSheet(MONITOR_TEXT_NORMAL_STYLE); // store imagelabel and textlabel into lists, so that we can change their style later m_ImageSvgList << imageSvg; m_ImageLabelList << imageLabel; m_TextLabelList << textLabel; // add above 2 widgets if(getThemeIconPath("project_screen-onlyone-symbolic").endsWith(".svg")){ vLayout->addWidget(imageSvg, 0, Qt::AlignHCenter); }else{ vLayout->addWidget(imageLabel, 0, Qt::AlignHCenter); } vLayout->addWidget(textLabel, 0, Qt::AlignHCenter); m_HBoxLayout->addWidget(item); } }
void ProxyConfigWidget::layoutElements() { QFormLayout *fLayout = new QFormLayout(); fLayout->addRow(tr("Proxy type:"), proxyType); fLayout->addRow(tr("Proxy host:"), proxyHost); fLayout->addRow(tr("Proxy port:"), proxyPort); fLayout->addRow(tr("Username:"******"Password:"******":/images/web.svg"); pic->setFixedSize(100,100); hLayout->addWidget(pic); this->setLayout(hLayout); }