コード例 #1
0
ファイル: bitcoingui.cpp プロジェクト: nodexcoin/nodex
void BitcoinGUI::createToolBars()
{
    toolbar = new QToolBar(tr("Tabs toolbar"));
    toolbar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
    toolbar->setContextMenuPolicy(Qt::PreventContextMenu);
    toolbar->setObjectName("tabs");
    toolbar->setStyleSheet("QToolButton { color: #ffffff; }  } #tabs { color: #ffffff; background-color: #37c5db;}");

    QLabel* header = new QLabel();
    header->setMinimumSize(96, 96);
    header->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
    header->setPixmap(QPixmap(":/images/header"));
    header->setMaximumSize(96,96);
    header->setScaledContents(true);
    toolbar->addWidget(header);

    //QMenu *toolbarMenu = new QMenu();
    toolbar->addAction(overviewAction);
    toolbar->addAction(receiveCoinsAction);
    toolbar->addAction(sendCoinsAction);
    toolbar->addAction(historyAction);
    toolbar->addAction(addressBookAction);
    toolbar->addAction(masternodeManagerAction);
    toolbar->addAction(richListPageAction);
    toolbar->addAction(messageAction);

    toolbar->setOrientation(Qt::Horizontal);
    toolbar->setMovable(false);

    addToolBar(Qt::TopToolBarArea, toolbar);
}
コード例 #2
0
ファイル: bitcoingui.cpp プロジェクト: CandyCoinDev/c1
void BitcoinGUI::createToolBars()
{
    QToolBar *toolbar = addToolBar(tr("Tabs toolbar"));
    toolbar->setObjectName("toolbar");
    addToolBar(Qt::LeftToolBarArea,toolbar);
    toolbar->setOrientation(Qt::Vertical);
    toolbar->setFixedWidth(205);
    toolbar->setMovable( false );
    toolbar->setToolButtonStyle(Qt::ToolButtonTextOnly);

    QLabel* header = new QLabel();
    header->setMinimumSize(156,156);
    header->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
    header->setPixmap(QPixmap(":/images/header"));
    header->setMaximumSize(156,156);
    header->setContentsMargins(26,26,0,0);
    header->setScaledContents(true);
    toolbar->addWidget(header);

	QLabel *l = new QLabel(this);
    l->setPixmap(QPixmap(":/images/spacer"));
    toolbar->addWidget(l);
    toolbar->addAction(overviewAction);
    toolbar->addAction(sendCoinsAction);
    toolbar->addAction(receiveCoinsAction);
    toolbar->addAction(historyAction);
    toolbar->addAction(addressBookAction);
    toolbar->setStyleSheet("#toolbar {background: transparent; text-align: center; color: black;padding-right: 30px;} QToolBar QToolButton:hover {background-color: transparent;} QToolBar QToolButton:selected {background-color: transparent;} QToolBar QToolButton:checked {background-color: transparent;} QToolBar QToolButton:pressed {background-color: transparent;} QToolBar QToolButton {font-family:Steps; font-size:15px; font-weight: bold; min-width:125px;max-width:125px; min-height:25px;max-height:25px; color: white; text-align: left; }");

}
コード例 #3
0
void BitcoinGUI::createToolBars()
{
    toolbar = new QToolBar(tr("Tabs toolbar"));
    toolbar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
    toolbar->setContextMenuPolicy(Qt::PreventContextMenu);
    toolbar->setObjectName("tabs");
    toolbar->setStyleSheet("QToolButton { color: #ffffff; } QToolButton:hover { background-color: #050817 } QToolButton:checked { background-color: #152443 } QToolButton:pressed { background-color: #152443 } #tabs { color: #ffffff; background-color: qradialgradient(cx: -0.8, cy: 0, fx: -0.8, fy: 0, radius: 0.6, stop: 0 #404040, stop: 1 #101010);  }");

    QLabel* header = new QLabel();
    header->setMinimumSize(48, 48);
    header->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
    header->setPixmap(QPixmap(":/icons/bitcoin"));
    header->setMaximumSize(48,48);
    header->setScaledContents(true);
    toolbar->addWidget(header);

    //QMenu *toolbarMenu = new QMenu();
    toolbar->addAction(overviewAction);
    toolbar->addAction(receiveCoinsAction);
    toolbar->addAction(sendCoinsAction);
    toolbar->addAction(historyAction);
    toolbar->addAction(addressBookAction);
    toolbar->addAction(masternodeManagerAction);
    toolbar->addAction(messageAction);

    toolbar->setOrientation(Qt::Horizontal);
    toolbar->setMovable(false);

    addToolBar(Qt::TopToolBarArea, toolbar);
}
コード例 #4
0
void ChannelWidget::setChannels(const QList<DoubanChannel>& channels) {
    this->channels = channels;
    int curindex = 0;
    QList<QWidget *> labels;
    for (int i = 0; i < channels.size(); ++ i) {
        const DoubanChannel& channel = channels[i];
        QLabel *label = new QLabel(ui->slider);
        QFont font("Sans", 12);
        font.setStyleStrategy(QFont::PreferAntialias);
        label->setFont(font);
        label->setText(channel.name+" MHz");
        label->setStyleSheet(DARK_STYLE);
        label->setMinimumSize(ui->slider->width() / 3, ui->slider->height());
        label->setMaximumSize(ui->slider->width() / 3, ui->slider->height());
        label->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
        labels.append(label);
        if (channel.channel_id == this->channel) curindex = i;
        qDebug() << "Channel name=" << channel.name << " id=" << channel.channel_id;
    }
    ui->slider->setChildren(labels);
    ui->slider->scrollToIndex(curindex);
    ui->slider->currentObject()->setStyleSheet(HIGHTLIGHT_STYLE);

    //pnt->setText(pnt->text().replace("grey", "white").replace("<a>", "<b>").replace("</a>", "</b>"));
}
コード例 #5
0
ファイル: aboutdlg.cpp プロジェクト: WeiqiJust/CHER-Ob
QLayout *AboutDlg::initTitleLayout()
{
    // The title layout has the product title, a picture, a horizontal
    // user guide layout, and a GPL 3 label.

    titleLabel = new QLabel();
    titleLabel->setMaximumSize(250, 64);
    titleLabel->setAlignment(Qt::AlignCenter);

    QLabel * tombImage = new QLabel();
    tombImage->setMaximumSize(250, 250);
    tombImage->setPixmap(QPixmap(":/images/tomb.png"));
    tombImage->setScaledContents(true);
    tombImage->setAlignment(Qt::AlignCenter);

    gplLabel = new QLabel();
    gplLabel->setMaximumSize(250, 32);
    gplLabel->setAlignment(Qt::AlignCenter);

    QVBoxLayout * titleLayout = new QVBoxLayout();
    titleLayout->setSpacing(15);
    titleLayout->addSpacerItem(new QSpacerItem(1, 1, QSizePolicy::Fixed, QSizePolicy::MinimumExpanding));
    titleLayout->addWidget(titleLabel);
    titleLayout->addWidget(tombImage);
    titleLayout->addLayout(initUserGuideLayout());
    titleLayout->addWidget(gplLabel);
    titleLayout->addSpacerItem(new QSpacerItem(1, 1, QSizePolicy::Fixed, QSizePolicy::MinimumExpanding));

    return titleLayout;
}
コード例 #6
0
void KPrWebPresentationWizard::setupPage3()
{
    page3 = new QHBox( this );
    QWhatsThis::add( page3, i18n("This page allows you to specify the colors for "
                                 "your presentation display. Select individual "
                                 "items for more help on what they do.") );

    page3->setSpacing( KDialog::spacingHint() );
    page3->setMargin( KDialog::marginHint() );

    QLabel* sidebar = new QLabel( page3 );
    sidebar->setMinimumSize( 106, 318 );
    sidebar->setMaximumSize( 106, 318 );
    sidebar->setFrameShape( QFrame::Panel );
    sidebar->setFrameShadow( QFrame::Sunken );
    sidebar->setPixmap(locate("data", "kpresenter/pics/webslideshow-sidebar.png"));

    QWidget* canvas = new QWidget( page3 );
    QGridLayout *layout = new QGridLayout( canvas, 6, 2,
                                           KDialog::marginHint(), KDialog::spacingHint() );

    QLabel *helptext = new QLabel( canvas );
    helptext->setAlignment( Qt::WordBreak | Qt::AlignVCenter| Qt::AlignLeft );
    helptext->setText( i18n( "Now you can customize the colors of the web pages." ) );
    layout->addMultiCellWidget( helptext, 0, 0, 0, 1 );

    layout->addMultiCell( new QSpacerItem( 1, 50 ), 1, 1, 0, 1 );

    QLabel *label1 = new QLabel( i18n("Text color:"), canvas );
    label1->setAlignment( Qt::AlignVCenter | Qt::AlignRight );
    layout->addWidget( label1, 2, 0 );

    QLabel *label2 = new QLabel( i18n("Title color:"), canvas );
    label2->setAlignment( Qt::AlignVCenter | Qt::AlignRight );
    layout->addWidget( label2, 3, 0 );

    QLabel *label3 = new QLabel( i18n("Background color:"), canvas );
    label3->setAlignment( Qt::AlignVCenter | Qt::AlignRight );
    layout->addWidget( label3, 4, 0 );

    textColor = new KColorButton( webPres.getTextColor(), canvas );
    layout->addWidget( textColor, 2, 1 );

    titleColor = new KColorButton( webPres.getTitleColor(), canvas );
    layout->addWidget( titleColor, 3, 1 );

    backColor = new KColorButton( webPres.getBackColor(), canvas );
    layout->addWidget( backColor, 4, 1 );

    QSpacerItem* spacer = new QSpacerItem( 1, 10,
                                           QSizePolicy::Minimum, QSizePolicy::Expanding );
    layout->addMultiCell( spacer, 5, 5, 0, 1 );

    addPage( page3, i18n( "Step 3: Customize Colors" ) );

    setHelpEnabled(page3, false);  //doesn't do anything currently
}
コード例 #7
0
ファイル: aboutdlg.cpp プロジェクト: WeiqiJust/CHER-Ob
QLayout * AboutDlg::initMuseumLayout()
{
    // Lay out the IMLS and CHI logos.

    QLabel * ilmsLogo = new QLabel();
    ilmsLogo->setMaximumSize(211, 86);
    ilmsLogo->setPixmap(QPixmap(":/images/logo_imls.gif"));
    ilmsLogo->setAlignment(Qt::AlignCenter);

    QLabel * chiLogo = new QLabel();
    chiLogo->setMaximumSize(211, 80);
    chiLogo->setPixmap(QPixmap(":/images/chi-logo.png"));
    chiLogo->setAlignment(Qt::AlignCenter);

    QVBoxLayout * museumLayout = new QVBoxLayout();
    museumLayout->addWidget(ilmsLogo);
    museumLayout->addStretch(1);
    museumLayout->addWidget(chiLogo);

    return museumLayout;
}
コード例 #8
0
ファイル: aboutdlg.cpp プロジェクト: WeiqiJust/CHER-Ob
QLayout * AboutDlg::initUniversityLayout()
{
    // Lay out the university logos.

    QLabel * minhoLogo = new QLabel();
    minhoLogo->setMaximumSize(160, 120);
    minhoLogo->setPixmap(QPixmap(":/images/minho.jpeg"));
    minhoLogo->setAlignment(Qt::AlignCenter);

    QLabel * ucscLogo = new QLabel();
    ucscLogo->setMaximumSize(160, 44);
    ucscLogo->setPixmap(QPixmap(":/images/ucsantacruz_resize.png"));
    ucscLogo->setAlignment(Qt::AlignCenter);

    QVBoxLayout * universityLayout = new QVBoxLayout();
    universityLayout->addWidget(minhoLogo);
    universityLayout->addStretch(1);
    universityLayout->addWidget(ucscLogo);

    return universityLayout;
}
コード例 #9
0
ファイル: Progression.cpp プロジェクト: ThomasAy/Duplicateur
void Progression::addCopy(QString src, QString){
	QLabel * label = new QLabel(src, this);
	label->setObjectName(src);
	label->setMaximumSize(780, 30);
	label->setGeometry(label->x(), label->y(), 780, label->height());
	QProgressBar * prog = new QProgressBar(this);
	prog->setObjectName(src);
	prog->setMaximum(QFile(src).size());
	vbl->addWidget(label);
	vbl->addWidget(prog);
	ProgressBars[label->text()] = prog;
	qDebug() << label->text();
	this->adjustSize();
}
コード例 #10
0
void MainWindow::displayPictures(QList<ImageTags*>* imgs)
{
	if (imgs->size() <= 0)
	{
		ui->PhotoTable->clear();
		ui->PhotoTable->setRowCount(0);
		ui->PhotoTable->setColumnCount(0);
		ui->tags->clear();
		return;
	}
	m_selected_picture = 0;
	ui->PhotoTable->clear();
	int nbFiles = imgs->size();

	// Get the available size of the element PhotoTable on screen
	QSize tableSize = ui->PhotoTable->size();
	// Define the optimal number of rows and columns
	int nbColumns = (int) floor((double) tableSize.width()
								/ (double) minImageSize.width());
	if (nbColumns > nbFiles)
		nbColumns = nbFiles;
	int nbRows = (int) ceil((double) nbFiles / (double) nbColumns);

	ui->PhotoTable->setColumnCount(nbColumns);
	ui->PhotoTable->setRowCount(nbRows);


	// Maximise the width of the pictures
	int extraWidth = tableSize.width() - (nbColumns * minImageSize.width());
	extraWidth /= nbColumns;
	if (extraWidth >= (0.10 * minImageSize.width()))
			extraWidth = 0;

	for (int i = 0 ; i < imgs->size() ; i++)
	{
		QLabel* img = new QLabel();
		img->setMaximumSize(QSize(minImageSize.width() + extraWidth,
								  minImageSize.height()));
		QPixmap scaledPicture(imgs->at(i)->m_filename);
		scaledPicture = scaledPicture.scaled(
					QSize(
							minImageSize.width() + extraWidth,
							minImageSize.height()),
					Qt::KeepAspectRatio);
		img->setPixmap(scaledPicture);
		ui->PhotoTable->setCellWidget((int) floor((double) i / (double) nbColumns),
						 i % nbColumns,
						 img);
	}
}
コード例 #11
0
ファイル: darksilkgui.cpp プロジェクト: mbishop75/DarkSilk
void DarkSilkGUI::createToolBars() {
    QLabel* header = new QLabel();
    header->setMinimumSize(48, 48);
    header->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
    header->setPixmap(QPixmap(":/icons/darksilk"));
    header->setMaximumSize(48, 48);
    header->setScaledContents(true);

    toolbar = new QToolBar(tr("Tabs toolbar"));
    toolbar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
    toolbar->setContextMenuPolicy(Qt::PreventContextMenu);
    toolbar->setObjectName("tabs");
    toolbar->setStyleSheet("#tabs { background-color: qradialgradient(cx: -0.8, cy: 0, fx: -0.8, fy: 0, radius: 0.6, stop: 0 #000000, stop: 1 #000000);  }");
    toolbar->addWidget(header);

    QMenu *toolbarMenu = new QMenu();
    toolbarMenu->addAction(overviewAction);
    toolbarMenu->addAction(receiveCoinsAction);
    toolbarMenu->addAction(sendCoinsAction);
    toolbarMenu->addAction(historyAction);
    toolbarMenu->addAction(addressBookAction);
    toolbarMenu->addAction(statisticsAction);
    toolbarMenu->addAction(blockAction);
    toolbarMenu->addAction(stormnodeManagerAction);

    QAction* menuAction = new QAction(QIcon(":/icons/overview"), tr("&Menu"), this);
    menuAction->setToolTip(tr("Access DarkSilk Wallet Tabs"));
    menuAction->setCheckable(false);

    QToolButton* menuToolButton = new QToolButton();
    menuToolButton->setToolButtonStyle(Qt::ToolButtonIconOnly);
    menuToolButton->setMenu(toolbarMenu);
    menuToolButton->setPopupMode(QToolButton::InstantPopup);
    menuToolButton->setDefaultAction(menuAction);

    netLabel = new QLabel();
    netLabel->setObjectName("netLabel");
    netLabel->setStyleSheet("#netLabel { color: #ffffff; }");

    toolbar->addWidget(menuToolButton);
    toolbar->addWidget(makeToolBarSpacer());
    toolbar->addWidget(netLabel);
    toolbar->setOrientation(Qt::Horizontal);
    toolbar->setMovable(false);

    addToolBar(Qt::TopToolBarArea, toolbar);
}
コード例 #12
0
void NotificationWidget::addMessage(QString msg, QPixmap pic) {
//#ifndef Q_WS_MAC
    QHBoxLayout *l = new QHBoxLayout();
    QLabel *w = new QLabel();
    w->setMaximumSize(16,16);
    w->setPixmap(pic);
    w->setScaledContents(true);
    l->addWidget(w);
    w=new QLabel();
    w->setText(msg);
    l->addWidget(w);
    ((QBoxLayout*)layout())->addLayout(l);
//#endif
//#ifdef Q_WS_MAC
//	icons.append(pic);
//	text.append(msg);
//#endif
}
コード例 #13
0
ファイル: AMWorkflowView3.cpp プロジェクト: acquaman/acquaman
AMWorkflowView3::AMWorkflowView3(AMActionRunner3 *actionRunner, QWidget *parent) :
	QWidget(parent)
{
	layoutSpacer_ = 0;

	QHBoxLayout* hl = new QHBoxLayout();
	hl->setContentsMargins(12,12,12,12);
	hl->setSpacing(12);

	QLabel* titleIcon = new QLabel();
	titleIcon->setMaximumSize(36,36);
	titleIcon->setPixmap(QPixmap(":/user-away.png"));
	titleIcon->setScaledContents(true);
	hl->addWidget(titleIcon);
	QLabel* titleLabel = new QLabel(actionRunner->actionRunnerTitle());
	titleLabel->setStyleSheet("font: " AM_FONT_XLARGE_ "pt \"Lucida Grande\";\ncolor: rgb(79, 79, 79);");
	hl->addWidget(titleLabel);
	hl->addStretch(1);
	addActionButton_ = new QPushButton("Add Action...");
	hl->addWidget(addActionButton_);

	currentView_ = new AMActionRunnerCurrentView3(actionRunner);
	queueView_ = new AMActionRunnerQueueView3(actionRunner);
	historyView_ = new AMActionHistoryView3(actionRunner, actionRunner->loggingDatabase());
	addActionDialog_ = 0;

	QVBoxLayout* vl = new QVBoxLayout();
	vl->setContentsMargins(0,0,0,0);
	vl->setSpacing(0);

	vl->addLayout(hl);
	vl->addWidget(historyView_);
	vl->addSpacing(12);
	vl->addWidget(currentView_);
	vl->addSpacing(12);
	vl->addWidget(queueView_);

	setLayout(vl);

	connect(queueView_, SIGNAL(collapsed(bool)), this, SLOT(onViewCollapsed()));
	connect(historyView_, SIGNAL(collapsed(bool)), this, SLOT(onViewCollapsed()));
	connect(addActionButton_, SIGNAL(clicked()), this, SLOT(onAddActionButtonClicked()));
}
コード例 #14
0
ファイル: aboutdlg.cpp プロジェクト: WeiqiJust/CHER-Ob
QLayout * AboutDlg::initHPButtonLayout()
{
    // Lay out the HP logo and OK button

    QLabel * hpLogo = new QLabel();
    hpLogo->setMaximumSize(141, 116);
    hpLogo->setPixmap(QPixmap(":/images/hptran.png"));
    hpLogo->setAlignment(Qt::AlignCenter);

    QLayout * buttonLayout = initButtonLayout();

    QVBoxLayout * hpButtonLayout = new QVBoxLayout();
    hpButtonLayout->addWidget(hpLogo);
    hpButtonLayout->addStretch(1);
    hpButtonLayout->addLayout(buttonLayout);
    hpButtonLayout->addStretch(1);

    return hpButtonLayout;
}
コード例 #15
0
InfoBox::InfoBox(QWidget * parent):QWidget (parent) 
{
    //Set up title bar
    m_titleBar = new QWidget;
    m_titleBar->setAutoFillBackground(true);
    m_titleBar->setPalette(QApplication::palette());
    connect(KGlobalSettings::self(), SIGNAL(kdisplayPaletteChanged()), this, SLOT(updateTitleColors())); 
    
    QHBoxLayout * titleLayout = new QHBoxLayout;
    titleLayout->setContentsMargins(0,0,0,0);
    titleLayout->setSpacing(0);
    
    m_icon = new QLabel;
    m_icon->setMaximumSize(QSize(20,20));
    m_icon->setAlignment(Qt::AlignCenter);
    m_title = new QLabel;
    m_title->setFont(KGlobalSettings::smallestReadableFont());
    m_title->setAlignment(Qt::AlignCenter);
    QLabel * spacer = new QLabel;
    spacer->setMaximumSize(QSize(20,20));
    titleLayout->addWidget(m_icon);
    titleLayout->addWidget(m_title);
    titleLayout->addWidget(spacer);
    m_titleBar->setLayout(titleLayout);
    m_titleBar->setMinimumHeight(20);
    
    //Set up media view
    QVBoxLayout * layout = new QVBoxLayout;
    layout->setContentsMargins(0,0,0,0);
    layout->setSpacing(0);
    m_mediaView = new MediaView();
    m_mediaView->setFocusPolicy(Qt::ClickFocus);
    connect((MediaItemModel *)m_mediaView->sourceModel(), SIGNAL(mediaListChanged()), this, SLOT(mediaListChanged()));
    layout->addWidget(m_titleBar);
    layout->addWidget(m_mediaView);
    
    //Complete setup
    setLayout(layout);
}
コード例 #16
0
QLayout * ToolTipManager::generateToolTipLine( QModelIndex * item, QWidget * toolTip, QSize iconSize, bool comment )
{
    // Get MenuItem
    MenuItem * menuItem = d->view->model()->data( *item, Qt::UserRole ).value<MenuItem*>();

    QString text = menuItem->name();
    if ( comment ) {
        text = QString( "<b>%1</b>" ).arg( menuItem->name() );
    }

    // Generate text
    if ( comment ) {
        text += "<br />";
        if ( !menuItem->service()->comment().isEmpty() ) {
            text += menuItem->service()->comment();
        } else {
            int childCount = d->view->model()->rowCount( *item );
            text += i18np( "<i>Contains 1 item</i>", "<i>Contains %1 items</i>", childCount );
        }
    }
    QLabel * textLabel = new QLabel( toolTip );
    textLabel->setForegroundRole(QPalette::ToolTipText);
    textLabel->setText( text );

    // Get icon
    KIcon icon( menuItem->service()->icon() );
    QLabel * iconLabel = new QLabel( toolTip );
    iconLabel->setPixmap( icon.pixmap(iconSize) );
    iconLabel->setMaximumSize( iconSize );

    // Generate layout
    QHBoxLayout * layout = new QHBoxLayout();
    layout->addWidget( iconLabel );
    layout->addWidget( textLabel );

    return layout;
}
コード例 #17
0
ファイル: aboutdlg.cpp プロジェクト: WeiqiJust/CHER-Ob
QLayout *AboutDlg::initUserGuideLayout()
{
    // The user guide layout has a label (User Guide) and a PDF logo.

    guideLabel = new QLabel();
    guideLabel->setMaximumSize(112, 32);
    guideLabel->setAlignment(Qt::AlignCenter);

    QLabel * pdfLogo = new QLabel();
    pdfLogo->setMaximumSize(32, 32);
    pdfLogo->setPixmap(QPixmap(":/images/logo-pdf.png"));
    pdfLogo->setScaledContents(true);
    pdfLogo->setAlignment(Qt::AlignCenter);

    QHBoxLayout * userGuideLayout = new QHBoxLayout();
    userGuideLayout->setSizeConstraint(QLayout::SetMaximumSize);
    userGuideLayout->setSpacing(5);
	userGuideLayout->addSpacerItem(new QSpacerItem(100, 32, QSizePolicy::Maximum, QSizePolicy::Fixed));
    userGuideLayout->addWidget(guideLabel);
    userGuideLayout->addWidget(pdfLogo);
	userGuideLayout->addSpacerItem(new QSpacerItem(100, 32, QSizePolicy::Maximum, QSizePolicy::Fixed));

    return userGuideLayout;
}
コード例 #18
0
ファイル: openconnectauth.cpp プロジェクト: KDE/plasma-nm
void OpenconnectAuthWidget::addFormInfo(const QString &iconName, const QString &message)
{
    Q_D(OpenconnectAuthWidget);
    QHBoxLayout *layout = new QHBoxLayout();
    QLabel *icon = new QLabel(this);
    QSizePolicy sizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
    sizePolicy.setHorizontalStretch(0);
    sizePolicy.setVerticalStretch(0);
    sizePolicy.setHeightForWidth(icon->sizePolicy().hasHeightForWidth());
    icon->setSizePolicy(sizePolicy);
    icon->setMinimumSize(QSize(16, 16));
    icon->setMaximumSize(QSize(16, 16));
    layout->addWidget(icon);

    QLabel *text = new QLabel(this);
    text->setAlignment(Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter);
    text->setWordWrap(true);
    layout->addWidget(text);

    icon->setPixmap(QIcon::fromTheme(iconName).pixmap(KIconLoader::SizeSmall));
    text->setText(message);

    d->ui.loginBoxLayout->addLayout(layout);
}
コード例 #19
0
ファイル: ui_main_window.hpp プロジェクト: sauver/sauver_sys
    void setupUi(QMainWindow *Detection)
    {
        if (Detection->objectName().isEmpty())
            Detection->setObjectName(QString::fromUtf8("Detection"));
        Detection->resize(729, 480);
        actionE_xit = new QAction(Detection);
        actionE_xit->setObjectName(QString::fromUtf8("actionE_xit"));
        action_Load_Map = new QAction(Detection);
        action_Load_Map->setObjectName(QString::fromUtf8("action_Load_Map"));
        action_Connect = new QAction(Detection);
        action_Connect->setObjectName(QString::fromUtf8("action_Connect"));
        action_Disconnect = new QAction(Detection);
        action_Disconnect->setObjectName(QString::fromUtf8("action_Disconnect"));
        centralWidget = new QWidget(Detection);
        centralWidget->setObjectName(QString::fromUtf8("centralWidget"));
        gridLayoutWidget = new QWidget(centralWidget);
        gridLayoutWidget->setObjectName(QString::fromUtf8("gridLayoutWidget"));
        gridLayoutWidget->setGeometry(QRect(0, 0, 721, 421));
        gridLayout = new QGridLayout(gridLayoutWidget);
        gridLayout->setSpacing(6);
        gridLayout->setContentsMargins(11, 11, 11, 11);
        gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
        gridLayout->setSizeConstraint(QLayout::SetNoConstraint);
        gridLayout->setVerticalSpacing(5);
        gridLayout->setContentsMargins(0, 0, 0, 0);
        ugvFeedLabel = new QLabel(gridLayoutWidget);
        ugvFeedLabel->setObjectName(QString::fromUtf8("ugvFeedLabel"));
        QSizePolicy sizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
        sizePolicy.setHorizontalStretch(0);
        sizePolicy.setVerticalStretch(0);
        sizePolicy.setHeightForWidth(ugvFeedLabel->sizePolicy().hasHeightForWidth());
        ugvFeedLabel->setSizePolicy(sizePolicy);

        gridLayout->addWidget(ugvFeedLabel, 1, 2, 1, 1);

        connectionButton = new QCommandLinkButton(gridLayoutWidget);
        connectionButton->setObjectName(QString::fromUtf8("connectionButton"));

        gridLayout->addWidget(connectionButton, 0, 2, 1, 1);

        uavFeedLabel = new QLabel(gridLayoutWidget);
        uavFeedLabel->setObjectName(QString::fromUtf8("uavFeedLabel"));
        sizePolicy.setHeightForWidth(uavFeedLabel->sizePolicy().hasHeightForWidth());
        uavFeedLabel->setSizePolicy(sizePolicy);
        uavFeedLabel->setMaximumSize(QSize(16777215, 16777215));

        gridLayout->addWidget(uavFeedLabel, 1, 0, 1, 1);

        ugvMapLabel = new QLabel(gridLayoutWidget);
        ugvMapLabel->setObjectName(QString::fromUtf8("ugvMapLabel"));
        QSizePolicy sizePolicy1(QSizePolicy::MinimumExpanding, QSizePolicy::Expanding);
        sizePolicy1.setHorizontalStretch(0);
        sizePolicy1.setVerticalStretch(0);
        sizePolicy1.setHeightForWidth(ugvMapLabel->sizePolicy().hasHeightForWidth());
        ugvMapLabel->setSizePolicy(sizePolicy1);

        gridLayout->addWidget(ugvMapLabel, 1, 3, 1, 1);

        horizontalLayout_4 = new QHBoxLayout();
        horizontalLayout_4->setSpacing(6);
        horizontalLayout_4->setObjectName(QString::fromUtf8("horizontalLayout_4"));
        label_2 = new QLabel(gridLayoutWidget);
        label_2->setObjectName(QString::fromUtf8("label_2"));

        horizontalLayout_4->addWidget(label_2);

        uavTakeoffLandButton = new QPushButton(gridLayoutWidget);
        uavTakeoffLandButton->setObjectName(QString::fromUtf8("uavTakeoffLandButton"));

        horizontalLayout_4->addWidget(uavTakeoffLandButton);


        gridLayout->addLayout(horizontalLayout_4, 2, 0, 1, 1);

        horizontalLayout_2 = new QHBoxLayout();
        horizontalLayout_2->setSpacing(6);
        horizontalLayout_2->setObjectName(QString::fromUtf8("horizontalLayout_2"));
        label = new QLabel(gridLayoutWidget);
        label->setObjectName(QString::fromUtf8("label"));

        horizontalLayout_2->addWidget(label);

        ugvSpeedLCD = new QLCDNumber(gridLayoutWidget);
        ugvSpeedLCD->setObjectName(QString::fromUtf8("ugvSpeedLCD"));
        ugvSpeedLCD->setFrameShape(QFrame::Box);

        horizontalLayout_2->addWidget(ugvSpeedLCD);


        gridLayout->addLayout(horizontalLayout_2, 4, 2, 1, 1);

        horizontalLayout_6 = new QHBoxLayout();
        horizontalLayout_6->setSpacing(6);
        horizontalLayout_6->setObjectName(QString::fromUtf8("horizontalLayout_6"));
        label_3 = new QLabel(gridLayoutWidget);
        label_3->setObjectName(QString::fromUtf8("label_3"));

        horizontalLayout_6->addWidget(label_3);

        ugvSpeakerButton = new QPushButton(gridLayoutWidget);
        ugvSpeakerButton->setObjectName(QString::fromUtf8("ugvSpeakerButton"));

        horizontalLayout_6->addWidget(ugvSpeakerButton);


        gridLayout->addLayout(horizontalLayout_6, 2, 2, 1, 1);

        verticalLayout = new QVBoxLayout();
        verticalLayout->setSpacing(6);
        verticalLayout->setObjectName(QString::fromUtf8("verticalLayout"));
        label_4 = new QLabel(gridLayoutWidget);
        label_4->setObjectName(QString::fromUtf8("label_4"));
        label_4->setAlignment(Qt::AlignCenter);

        verticalLayout->addWidget(label_4);

        sauverStatus = new QTextBrowser(gridLayoutWidget);
        sauverStatus->setObjectName(QString::fromUtf8("sauverStatus"));
        sauverStatus->setEnabled(true);
        QSizePolicy sizePolicy2(QSizePolicy::Minimum, QSizePolicy::Minimum);
        sizePolicy2.setHorizontalStretch(0);
        sizePolicy2.setVerticalStretch(0);
        sizePolicy2.setHeightForWidth(sauverStatus->sizePolicy().hasHeightForWidth());
        sauverStatus->setSizePolicy(sizePolicy2);
        sauverStatus->setMaximumSize(QSize(777215, 215));

        verticalLayout->addWidget(sauverStatus);


        gridLayout->addLayout(verticalLayout, 4, 3, 1, 1);

        label_5 = new QLabel(gridLayoutWidget);
        label_5->setObjectName(QString::fromUtf8("label_5"));

        gridLayout->addWidget(label_5, 0, 0, 1, 1);

        Detection->setCentralWidget(centralWidget);
        menuBar = new QMenuBar(Detection);
        menuBar->setObjectName(QString::fromUtf8("menuBar"));
        menuBar->setGeometry(QRect(0, 0, 729, 23));
        menuFile = new QMenu(menuBar);
        menuFile->setObjectName(QString::fromUtf8("menuFile"));
        menu_Tools = new QMenu(menuBar);
        menu_Tools->setObjectName(QString::fromUtf8("menu_Tools"));
        menu_Help = new QMenu(menuBar);
        menu_Help->setObjectName(QString::fromUtf8("menu_Help"));
        Detection->setMenuBar(menuBar);
        mainToolBar = new QToolBar(Detection);
        mainToolBar->setObjectName(QString::fromUtf8("mainToolBar"));
        Detection->addToolBar(Qt::TopToolBarArea, mainToolBar);
        statusBar = new QStatusBar(Detection);
        statusBar->setObjectName(QString::fromUtf8("statusBar"));
        Detection->setStatusBar(statusBar);

        menuBar->addAction(menuFile->menuAction());
        menuBar->addAction(menu_Tools->menuAction());
        menuBar->addAction(menu_Help->menuAction());
        menuFile->addAction(action_Load_Map);
        menuFile->addAction(action_Disconnect);
        menuFile->addAction(actionE_xit);
        menu_Tools->addAction(action_Connect);

        retranslateUi(Detection);
        QObject::connect(actionE_xit, SIGNAL(activated()), Detection, SLOT(close()));
        QObject::connect(action_Connect, SIGNAL(activated()), connectionButton, SLOT(click()));

        QMetaObject::connectSlotsByName(Detection);
    } // setupUi
コード例 #20
0
void KPrWebPresentationWizard::setupPage2()
{
    page2 = new QHBox( this );
    QWhatsThis::add( page2, i18n("This page allows you to specify how the HTML "
                                 "for your presentation will be displayed. Select "
                                 "individual items for more help on what they do.") );
    page2->setSpacing( KDialog::spacingHint() );
    page2->setMargin( KDialog::marginHint() );

    QLabel* sidebar = new QLabel( page2 );
    sidebar->setMinimumSize( 106, 318 );
    sidebar->setMaximumSize( 106, 318 );
    sidebar->setFrameShape( QFrame::Panel );
    sidebar->setFrameShadow( QFrame::Sunken );
    sidebar->setPixmap(locate("data", "kpresenter/pics/webslideshow-sidebar.png"));

    QWidget* canvas = new QWidget( page2 );
    QGridLayout *layout = new QGridLayout( canvas, 6, 2,
                                           KDialog::marginHint(), KDialog::spacingHint() );

    QLabel *helptext = new QLabel( canvas );
    helptext->setAlignment( Qt::WordBreak | Qt::AlignVCenter| Qt::AlignLeft );
    QString help = i18n("Here you can configure the style of the web pages.");
    help += i18n( "You can also specify the zoom for the slides." );
    helptext->setText(help);

    layout->addMultiCellWidget( helptext, 0, 0, 0, 1 );

    layout->addMultiCell( new QSpacerItem( 1, 50 ), 1, 1, 0, 1 );

    QLabel *label1 = new QLabel( i18n("Zoom:"), canvas );
    label1->setAlignment( Qt::AlignVCenter | Qt::AlignRight );
    QWhatsThis::add( label1, i18n( "This selection allows you to specify "
                                   "the size of the slide image." ) );
    layout->addWidget( label1, 2, 0 );

    QLabel *label2 = new QLabel( i18n( "Encoding:" ), canvas );
    label2->setAlignment( Qt::AlignVCenter | Qt::AlignRight );

    layout->addWidget( label2, 3, 0 );

    QLabel *label3 = new QLabel( i18n( "Document type:" ), canvas );
    label3->setAlignment( Qt::AlignVCenter | Qt::AlignRight );
    layout->addWidget( label3, 4, 0 );

    zoom = new KIntNumInput( webPres.getZoom(), canvas );
    QWhatsThis::add( zoom, i18n( "This selection allows you to specify "
                                 "the size of the slide image." ) );
    layout->addWidget( zoom, 2, 1 );
    zoom->setSuffix( " %" );
    zoom->setRange( 25, 1000, 5 );

    encoding = new KComboBox( false, canvas );
    layout->addWidget( encoding, 3, 1 );

    // Fill encoding combo
    // Stolen from kdelibs/kate/part/katedialogs.cpp
    QStringList encodings(KGlobal::charsets()->descriptiveEncodingNames());
    int idx = 0;
    for (uint i = 0; i < encodings.count(); i++)
    {
      bool found = false;
      QTextCodec *codecForEnc = KGlobal::charsets()->codecForName(KGlobal::charsets()->encodingForName(encodings[i]), found);
      if (found)
      {
        encoding->insertItem(encodings[i]);

        if ( codecForEnc->name() == webPres.getEncoding() )
          encoding->setCurrentItem(idx);
        idx++;
      }
    }

    doctype = new KComboBox( false, canvas );
    layout->addWidget( doctype, 4, 1 );
    doctype->insertItem( "HTML 4.01", -1 );
    doctype->insertItem( "XHTML 1.0", -1 );

    doctype->setCurrentItem( webPres.isXML() ? 1 : 0 );

    QSpacerItem* spacer = new QSpacerItem( 1, 10,
                                           QSizePolicy::Minimum, QSizePolicy::Expanding );
    layout->addMultiCell( spacer, 5, 5, 0, 1 );

    addPage( page2, i18n( "Step 2: Configure HTML" ) );

    setHelpEnabled(page2, false);  //doesn't do anything currently
}
コード例 #21
0
VBoxDbgConsole::VBoxDbgConsole(VBoxDbgGui *a_pDbgGui, QWidget *a_pParent/* = NULL*/, IVirtualBox *a_pVirtualBox/* = NULL */)
    : VBoxDbgBaseWindow(a_pDbgGui, a_pParent, "Console"), m_pOutput(NULL), m_pInput(NULL), m_fInputRestoreFocus(false),
    m_pszInputBuf(NULL), m_cbInputBuf(0), m_cbInputBufAlloc(0),
    m_pszOutputBuf(NULL), m_cbOutputBuf(0), m_cbOutputBufAlloc(0),
    m_pTimer(NULL), m_fUpdatePending(false), m_Thread(NIL_RTTHREAD), m_EventSem(NIL_RTSEMEVENT),
    m_fTerminate(false), m_fThreadTerminated(false)
{
    /*
     * Create the output text box.
     */
    m_pOutput = new VBoxDbgConsoleOutput(this, a_pVirtualBox);

    /* try figure a suitable size */
    QLabel *pLabel = new QLabel(      "11111111111111111111111111111111111111111111111111111111111111111111111111111112222222222", this);
    pLabel->setFont(m_pOutput->font());
    QSize Size = pLabel->sizeHint();
    delete pLabel;
    Size.setWidth((int)(Size.width() * 1.10));
    Size.setHeight(Size.width() / 2);
    resize(Size);

    /*
     * Create the input combo box (with a label).
     */
    QHBoxLayout *pLayout = new QHBoxLayout();
    //pLayout->setSizeConstraint(QLayout::SetMaximumSize);

    pLabel = new QLabel(" Command ");
    pLayout->addWidget(pLabel);
    pLabel->setMaximumSize(pLabel->sizeHint());
    pLabel->setAlignment(Qt::AlignCenter);

    m_pInput = new VBoxDbgConsoleInput(NULL);
    pLayout->addWidget(m_pInput);
    m_pInput->setDuplicatesEnabled(false);
    connect(m_pInput, SIGNAL(commandSubmitted(const QString &)), this, SLOT(commandSubmitted(const QString &)));

# if 0//def Q_WS_MAC
    pLabel = new QLabel("  ");
    pLayout->addWidget(pLabel);
    pLabel->setMaximumSize(20, m_pInput->sizeHint().height() + 6);
    pLabel->setMinimumSize(20, m_pInput->sizeHint().height() + 6);
# endif

    QWidget *pHBox = new QWidget(this);
    pHBox->setLayout(pLayout);

    m_pInput->setEnabled(false);    /* (we'll get a ready notification) */


    /*
     * Vertical layout box on the whole widget.
     */
    QVBoxLayout *pVLayout = new QVBoxLayout();
    pVLayout->setContentsMargins(0, 0, 0, 0);
    pVLayout->setSpacing(5);
    pVLayout->addWidget(m_pOutput);
    pVLayout->addWidget(pHBox);
    setLayout(pVLayout);

    /*
     * The tab order is from input to output, not the other way around as it is by default.
     */
    setTabOrder(m_pInput, m_pOutput);
    m_fInputRestoreFocus = true; /* hack */

    /*
     * Setup the timer.
     */
    m_pTimer = new QTimer(this);
    connect(m_pTimer, SIGNAL(timeout()), SLOT(updateOutput()));

    /*
     * Init the backend structure.
     */
    m_Back.Core.pfnInput   = backInput;
    m_Back.Core.pfnRead    = backRead;
    m_Back.Core.pfnWrite   = backWrite;
    m_Back.Core.pfnSetReady = backSetReady;
    m_Back.pSelf = this;

    /*
     * Create the critical section, the event semaphore and the debug console thread.
     */
    int rc = RTCritSectInit(&m_Lock);
    AssertRC(rc);

    rc = RTSemEventCreate(&m_EventSem);
    AssertRC(rc);

    rc = RTThreadCreate(&m_Thread, backThread, this, 0, RTTHREADTYPE_DEBUGGER, RTTHREADFLAGS_WAITABLE, "VBoxDbgC");
    AssertRC(rc);
    if (RT_FAILURE(rc))
        m_Thread = NIL_RTTHREAD;

    /*
     * Shortcuts.
     */
    m_pFocusToInput = new QAction("", this);
    m_pFocusToInput->setShortcut(QKeySequence("Ctrl+L"));
    addAction(m_pFocusToInput);
    connect(m_pFocusToInput, SIGNAL(triggered(bool)), this, SLOT(actFocusToInput()));

    m_pFocusToOutput = new QAction("", this);
    m_pFocusToOutput->setShortcut(QKeySequence("Ctrl+O"));
    addAction(m_pFocusToOutput);
    connect(m_pFocusToOutput, SIGNAL(triggered(bool)), this, SLOT(actFocusToOutput()));

    addAction(m_pOutput->m_pBlackOnWhiteAction);
    addAction(m_pOutput->m_pGreenOnBlackAction);
    addAction(m_pOutput->m_pCourierFontAction);
    addAction(m_pOutput->m_pMonospaceFontAction);
}
コード例 #22
0
ファイル: tCurrentInfoDialog.cpp プロジェクト: dulton/53_hero
// --------------------------------------------------------------------------
//!
// --------------------------------------------------------------------------
tCurrentInfoDialog::tCurrentInfoDialog( tAt5CurrentsQuickInfoObject* pAt5Obj, QWidget* pParent )
: tDialog( tDialog::Full, pParent ), 
m_pDateLineEdit( NULL ), 
m_pDateLabel( NULL ),
m_pCurrentInfoObj( pAt5Obj )
{
    setWindowTitle( tr("Currents") + " - " + pAt5Obj->Name() );

    QGridLayout* pLayout = new QGridLayout();
    SoftKeyBar()->ExplicitHide();

    m_ActiveDate = QDate::currentDate();

    if ( tUiConfig::Instance()->CanSupportTouch() )
    {
        QHBoxLayout* pDateLayout = new QHBoxLayout();

        tPushButton* pPreviousDayButton = new tPushButton( style()->standardIcon( QStyle::SP_ArrowLeft ), "", this );
        pPreviousDayButton->setFixedWidth( style()->pixelMetric( NPM( tNOSStyle::NPM_DatePickerPrevNextButtonWidth ) ) );
        pPreviousDayButton->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
        pPreviousDayButton->setFocusPolicy( Qt::NoFocus );
        Connect( pPreviousDayButton, SIGNAL( clicked() ), this, SLOT( OnPreviousDay() ) );
        pDateLayout->addWidget( pPreviousDayButton );

        m_pDateLineEdit = new tDateLineEdit( m_ActiveDate, tSystemSettings::Instance()->DateFormatString(), this );
        m_pDateLineEdit->SetTitle( tr("Tide Date") );
        m_pDateLineEdit->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
        m_pDateLineEdit->setFocusPolicy( Qt::NoFocus );
        Connect( m_pDateLineEdit, SIGNAL( ValueChanged() ), this, SLOT( OnCalendarInput() ) );
        pDateLayout->addWidget( m_pDateLineEdit );

        tPushButton* pNextDayButton = new tPushButton( style()->standardIcon( QStyle::SP_ArrowRight ), "", this );
        pNextDayButton->setFixedWidth( style()->pixelMetric( NPM( tNOSStyle::NPM_DatePickerPrevNextButtonWidth ) ) );
        pNextDayButton->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
        pNextDayButton->setFocusPolicy( Qt::NoFocus );
        Connect( pNextDayButton, SIGNAL( clicked() ), this, SLOT( OnNextDay() ) );
        pDateLayout->addWidget( pNextDayButton );

        pLayout->addLayout( pDateLayout, 0, 0, 1, 3, Qt::AlignCenter ); 
    }
    else
    {
        // Add date time label
        m_pDateLabel = new QLabel( m_ActiveDate.toString( tSystemSettings::Instance()->DateFormatString() ) );
        pLayout->addWidget( m_pDateLabel, 0, 0 );

        QSize arrowSize(14,14);
        QLabel* pPreviousDayArrow = new QLabel( this );
        pPreviousDayArrow->setPixmap( style()->standardIcon(QStyle::SP_ArrowUp).pixmap(arrowSize) );
        pPreviousDayArrow->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
        pPreviousDayArrow->setMaximumSize( arrowSize );
        QLabel* pNextDayArrow = new QLabel( this );
        pNextDayArrow->setPixmap( style()->standardIcon(QStyle::SP_ArrowDown).pixmap(arrowSize) );
        pNextDayArrow->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
        pNextDayArrow->setMaximumSize( arrowSize );
        QLabel* pPreviousDayLabel = new QLabel( this );
        pPreviousDayLabel->setText( tr("Previous day") );
        QLabel* pNextDayLabel = new QLabel( this );
        pNextDayLabel->setText( tr("Next day") );

        pLayout->addWidget( pPreviousDayArrow, 0, 2 );   
        pLayout->addWidget( pNextDayArrow, 2, 2 );   
        pLayout->addWidget( pPreviousDayLabel, 0, 1, Qt::AlignRight );   
        pLayout->addWidget( pNextDayLabel, 2, 1, Qt::AlignRight );   
    }

    m_pGraph = new tCurrentGraph( this );
    m_pGraph->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding );
    m_pGraph->installEventFilter( this );
    Connect( m_pGraph, SIGNAL( NextPrevDay( bool ) ), this, SLOT( OnNextPrevDay( bool ) ) );
    pLayout->addWidget( m_pGraph, 1, 0, 1, 3 );   

    setLayout( pLayout );

    // Start the update timer
    m_pUpdateTimer = new QTimer( this );
    m_pUpdateTimer->setSingleShot( false );
    m_pUpdateTimer->setInterval( 60 * 1000 ); // x * 1000 ms = x seconds
    Connect( m_pUpdateTimer, SIGNAL( timeout() ), this, SLOT( OnUpdateTimer() ) );
    m_pUpdateTimer->start();

    // Initial update
    UpdateDialog();
}
コード例 #23
0
TrayNotificationWidget::TrayNotificationWidget(QPixmap pixmapIcon, QString headerText, QString messageText) : QWidget(0)
{
    setWindowFlags(
        #ifdef Q_OS_MAC
            Qt::SubWindow | // This type flag is the second point
        #else
            Qt::Tool |
        #endif
            Qt::FramelessWindowHint |
            Qt::WindowSystemMenuHint |
            Qt::WindowStaysOnTopHint
        );
    setAttribute(Qt::WA_NoSystemBackground, true);
    // set the parent widget's background to translucent
    setAttribute(Qt::WA_TranslucentBackground, true);

    //setAttribute(Qt::WA_ShowWithoutActivating, true);

    setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
    // create a display widget for displaying child widgets
    QWidget* displayWidget = new QWidget;
    displayWidget->setStyleSheet(".QWidget { background-color: rgba(0, 0, 0, 75%); border-width: 1px; border-style: solid; border-radius: 10px; border-color: #555555; } .QWidget:hover { background-color: rgba(68, 68, 68, 75%); border-width: 2px; border-style: solid; border-radius: 10px; border-color: #ffffff; }");

    QLabel* icon = new QLabel;
    icon->setPixmap(pixmapIcon);
    icon->setMaximumSize(32, 32);
    QLabel* header = new QLabel;
    header->setMaximumSize(250, 50);
    header->setWordWrap(true);
    header->setText(headerText);
    header->setStyleSheet("QLabel { color: #ffffff; font-weight: bold; font-size: 12px; }");
    QTextEdit *message = new QTextEdit;
    message->setReadOnly(true);
    message->setFrameStyle(QFrame::NoFrame);
    message->setLineWrapMode(QTextEdit::WidgetWidth);
    message->setWordWrapMode(QTextOption::WrapAnywhere);
    QPalette pal = palette();
    pal.setColor(QPalette::Base, Qt::transparent);
    message->setPalette(pal);
    message->setStyleSheet("QTextEdit { color: #ffffff; font-size: 10px; }");
    message->setText(messageText);
    message->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);

    QVBoxLayout* vl = new QVBoxLayout;
    vl->addWidget(header);
    vl->addWidget(message);

    QHBoxLayout* displayMainLayout = new QHBoxLayout;
    displayMainLayout->addWidget(icon);
    displayMainLayout->addLayout(vl);
    displayWidget->setLayout(displayMainLayout);

    QHBoxLayout* containerLayout = new QHBoxLayout;
    containerLayout->addWidget(displayWidget);
    setLayout(containerLayout);

    show();
    setMinimumHeight((int)(message->document()->size().height() *1.5 + header->height() +70));

    timeout = new QTimer(this);
    connect(timeout, SIGNAL(timeout()), this, SLOT(fadeOut()));
    timeout->start(3000);
}
コード例 #24
0
ファイル: gui_groups.cpp プロジェクト: codepr/linqedin
Gui_Groups::Gui_Groups(LinqClient* c, QWidget* parent) : QGridLayout(parent), _client(c) {
    Gui_Avatar* portrait = new Gui_Avatar(QString::fromStdString(_client->avatar()));
    QPushButton* create = new QPushButton("CREATE");
    QLabel* title = new QLabel("NEW GROUP");
    showgrp = new Gui_DisplayInfo;
    newpost = new QTextEdit;
    newgrp = new QLineEdit;
    search = new QLineEdit;
    newbox = new QGroupBox;
    memlbl = new QLabel("Members");
    memlbl->setMaximumSize(80,20);

    grpname = new QLineEdit;
    newgrplayout = new QFormLayout;
    newgrplayout->setSpacing(15);
    newgrplayout->addRow(title);
    newgrplayout->addRow("Group name:", grpname);
    newgrplayout->addRow("Group description:", newgrp);
    newgrplayout->addRow(create);

    newbox->setLayout(newgrplayout);
    if(_client->level() < executive) newbox->hide();

    search->setPlaceholderText("Search group..");
    search->hide();
    connect(search,  SIGNAL(returnPressed()), this, SLOT(searchGroup()));

    post = new QPushButton("POST");
    grplist = new QListWidget;
    memlist = new QListWidget;
    QLabel* grplbl = new QLabel("Groups");
    grplbl->setMaximumSize(120,20);
    createGroups();
    QFormLayout* frm = new QFormLayout;
    mbuttons[0] = new QPushButton;
    mbuttons[0]->setIcon(QPixmap("img/document185.png"));
    mbuttons[0]->setToolTip("New group");
    mbuttons[1] = new QPushButton;
    mbuttons[1]->setIcon(QPixmap("img/cross108.png"));
    mbuttons[1]->setToolTip("Delete group");
    mbuttons[2] = new QPushButton;
    mbuttons[2]->setIcon(QPixmap("img/mop2.png"));
    mbuttons[2]->setToolTip("Delete all posts");
    mbuttons[3] = new QPushButton;
    mbuttons[3]->setIcon(QPixmap("img/exit6.png"));
    mbuttons[3]->setToolTip("Leave this group");
    mbuttons[4] = new QPushButton;
    mbuttons[4]->setIcon(QPixmap("img/enter3.png"));
    mbuttons[4]->setToolTip("Join this group");

    frm->addRow(mbuttons[0]);
    frm->addRow(mbuttons[3]);
    frm->addRow(mbuttons[4]);
    frm->addRow(mbuttons[1]);
    frm->addRow(mbuttons[2]);

    connect(mbuttons[0], SIGNAL(clicked()), this, SLOT(showNewGroup()));
    connect(create, SIGNAL(clicked()), this, SLOT(newGroup()));
    connect(mbuttons[1], SIGNAL(clicked()), this, SLOT(deleteGroup()));
    connect(mbuttons[2], SIGNAL(clicked()), this, SLOT(clearPosts()));
    connect(mbuttons[3], SIGNAL(clicked()), this, SLOT(leaveGroup()));
    connect(mbuttons[4], SIGNAL(clicked()), this, SLOT(addGroup()));

    mbuttons[0]->hide();
    mbuttons[1]->hide();
    mbuttons[2]->hide();
    mbuttons[3]->hide();
    mbuttons[4]->hide();
    if(_client->level() >= executive)
        mbuttons[0]->show();
    tbar = new QToolBar;
    tbuttons[0] = new QToolButton(tbar);
    tbuttons[0]->setIcon(QPixmap("img/cross108.png"));
    tbar->addWidget(tbuttons[0]);

    newpost->setStyleSheet("background: #1a1a1a; font-weight:400");
    newpost->setPlaceholderText("Insert new post into this group.");
    newpost->hide();
    post->hide();
    showgrp->hide();
    memlbl->hide();
    memlist->hide();
    memlist->setContextMenuPolicy(Qt::CustomContextMenu);
    connect(memlist, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(memListMenu(const QPoint&)));

    addWidget(newbox, 0, 1, 1, 1);
    addWidget(portrait, 0, 0, 1, 1, Qt::AlignTop);
    addWidget(showgrp, 0, 1, 3, 1);
    addLayout(frm, 0, 2, 1, 1, Qt::AlignRight);
    addWidget(newpost, 3, 1, 2, 3);
    addWidget(post, 5, 4, 1, 1, Qt::AlignRight);
    addWidget(grplbl, 1, 0, 1, 1);
    addWidget(grplist, 2, 0, 1, 1);
    addWidget(memlbl, 3, 0, 1, 1);
    addWidget(memlist, 4, 0, 1, 1);
    addWidget(search, 5, 0, 1, 1);
    setRowStretch(0, 0);
    setRowStretch(1, 10);
    setColumnStretch(0, 1);
    setColumnStretch(1, 5);
    connect(grplist, SIGNAL(clicked(QModelIndex)), this, SLOT(showGroup()));
    connect(post, SIGNAL(clicked()), this, SLOT(sendPost()));
    connect(this, SIGNAL(created(int)), this, SLOT(refresh(int)));
}
コード例 #25
0
ファイル: Dash.cpp プロジェクト: MoonLightDE/MoonLightDE
void Dash::build() {
    QTime time;
    time.start();

    const QRect screen = qApp->desktop()->screenGeometry();

    const QSize iconSize(64, 64);
    const QSize boxSize(100, 100);
    const int maxColumnApps = m_ui.tabs->size().width() / (boxSize.width() + 32);
    
    GridLayoutVExpanding* layoutApps = new GridLayoutVExpanding(maxColumnApps, m_ui.tabApps);
    
    layoutApps->setSpacing(0);
    layoutApps->setMargin(16);
    
    GridLayoutVExpanding* layoutSettings = new GridLayoutVExpanding(maxColumnApps, m_ui.tabSettings);
    
    layoutSettings->setSpacing(0);
    layoutSettings->setMargin(16);
    
    qDebug() << "Layouts init: " << time.elapsed();
    // Individual items are released inside the AppButton class
    QList<XdgDesktopFile*> appList = XdgDesktopFileCache::getAllFiles();
    std::sort(appList.begin(), appList.end(), XdgDesktopFileComparisonFunctor());
    //    qSort(appList.begin(), appList.end());
    qDebug() << "XdgDesktopFile lockup: " << time.elapsed();

    foreach(XdgDesktopFile * app, appList) {
        if (app->type() != XdgDesktopFile::ApplicationType) {
            delete app;
            continue;
        }
        AppButton *bttn = new AppButton(app, this);

        QLabel *label = new QLabel(app->name());
        label->setAlignment(Qt::AlignHCenter);

        label->setWordWrap(true);
        label->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding);
        label->setMaximumSize(boxSize.width(), 35);
        
        bttn->setFlat(true);
        bttn->setIconSize(iconSize);
        bttn->setMinimumSize(boxSize);
        bttn->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);

        connect(bttn, &AppButton::released, this, &Dash::hide);
        
        //Layout for widget
        QVBoxLayout* vBoxLayout = new QVBoxLayout();            
        vBoxLayout->addWidget(bttn);
        vBoxLayout->addWidget(label);
        
        QString appCategories = app->value("Categories", "None").toString();
        
        if (appCategories.contains("Settings", Qt::CaseInsensitive)) {
            
            layoutSettings->addLayout(vBoxLayout);
        } else {
            
            layoutApps->addLayout(vBoxLayout);
        }

    }
    qDebug() << "Layouts built: " << time.elapsed();

    qDebug() << "appcontainerSize" << m_ui.tabs->size();

    m_ui.apps->setGeometry(0, 0, m_ui.scrollArea->size().width() - (layoutApps->spacing() * maxColumnApps) 
                         , layoutApps->getCurrentRow() * boxSize.height());
    m_ui.apps->setLayout(layoutApps);


    m_ui.settings->setGeometry(0, 0, m_ui.scrollAreaSettings->size().width()
                             , layoutApps->getCurrentRow() * boxSize.height());
    m_ui.settings->setLayout(layoutSettings);

}
コード例 #26
0
void KPrWebPresentationWizard::setupPage4()
{
    page4 = new QHBox( this );
    QWhatsThis::add( page4, i18n("This page allows you to modify the titles of "
                                 "each slide, if required. You normally do not need "
                                 "to do this, but it is available if required.") );
    page4->setSpacing( KDialog::spacingHint() );
    page4->setMargin( KDialog::marginHint() );

    QLabel* sidebar = new QLabel( page4 );
    sidebar->setMinimumSize( 106, 318 );
    sidebar->setMaximumSize( 106, 318 );
    sidebar->setFrameShape( QFrame::Panel );
    sidebar->setFrameShadow( QFrame::Sunken );
    sidebar->setPixmap(locate("data", "kpresenter/pics/webslideshow-sidebar.png"));

    QWidget* canvas = new QWidget( page4 );
    QGridLayout *layout = new QGridLayout( canvas, 3, 2,
                                           KDialog::marginHint(), KDialog::spacingHint() );

    QLabel *helptext = new QLabel( canvas );
    helptext->setAlignment( Qt::WordBreak | Qt::AlignVCenter| Qt::AlignLeft );
    helptext->setText( i18n( "Here you can specify titles for "
                             "each slide. Click on a slide in "
                             "the list and then enter the title "
                             "in the textbox below. If you "
                             "click on a title, KPresenter "
                             "mainview will display the slide.") );

    layout->addMultiCellWidget( helptext, 0, 0, 0, 1 );

    QLabel *label = new QLabel( i18n( "Slide title:" ), canvas );
    label->setAlignment( Qt::AlignVCenter | Qt::AlignRight );
    layout->addWidget( label, 1, 0 );

    slideTitle = new KLineEdit( canvas );
    layout->addWidget( slideTitle, 1, 1 );
    connect( slideTitle, SIGNAL( textChanged( const QString & ) ), this,
             SLOT( slideTitleChanged( const QString & ) ) );

    slideTitles = new KListView( canvas );
    layout->addMultiCellWidget( slideTitles, 2, 2, 0, 1 );
    slideTitles->addColumn( i18n( "No." ) );
    slideTitles->addColumn( i18n( "Slide Title" ) );
    connect( slideTitles, SIGNAL( selectionChanged( QListViewItem * ) ), this,
             SLOT( slideTitleChanged( QListViewItem * ) ) );
    slideTitles->setSorting( -1 );
    slideTitles->setAllColumnsShowFocus( true );
    slideTitles->setResizeMode( QListView::LastColumn );
    slideTitles->header()->setMovingEnabled( false );

    QValueList<KPrWebPresentation::SlideInfo> infos = webPres.getSlideInfos();
    for ( int i = infos.count() - 1; i >= 0; --i ) {
        KListViewItem *item = new KListViewItem( slideTitles );
        item->setText( 0, QString::number( i + 1 ) );
        //kdDebug(33001) << "KPrWebPresentationWizard::setupPage3 " << infos[ i ].slideTitle << endl;
        item->setText( 1, infos[ i ].slideTitle );
    }

    slideTitles->setSelected( slideTitles->firstChild(), true );

    addPage( page4, i18n( "Step 4: Customize Slide Titles" ) );

    setHelpEnabled(page4, false);  //doesn't do anything currently
}
コード例 #27
0
static void parseFrame(QWidget *parent){
    // first parse the pos block
    
    ConfigRect pos = ConfigManager::parseRect();
    
    // followed by some optional stuff
    bool borderless=false;
    int spacing=2;
    bool done=false;
    
    char label[256];
    bool hasLabel=false;
    
    while(!done){
        switch(tok.getnext()){
        case T_BORDERLESS:
            borderless=true;
            break;
        case T_LABEL:
            if(!tok.getnextstring(label))
                throw UnexpException(&tok,"frame label");
            hasLabel=true;
            break;
        case T_SPACING:
            spacing=tok.getnextint();
            break;
        case T_OCURLY:
            done = true;
            break;
        default:
            throw UnexpException(&tok,"frame option or {");
        }
    }
    
    // create frame and layout
    QFrame *f = new QFrame;
    
    f->setFrameStyle(borderless?
                     QFrame::NoFrame:
                     QFrame::Panel);
    QGridLayout *l = new QGridLayout;
    l->setSpacing(spacing);
    f->setLayout(l);
    parseContainer(f);
    
    // if there's a label, we need a containing vbox
    if(hasLabel){
        QFrame *cont = new QFrame;
        QVBoxLayout *bl = new QVBoxLayout;
        cont->setLayout(bl);
        QLabel *lab = new QLabel(label);
        lab->setMaximumSize(10000,20);
        bl->addWidget(lab);
        bl->addWidget(f);
        
        f=cont;
    }
    
    
    // add to the parent's layout
    ((QGridLayout*)parent->layout())->addWidget(f,pos.y,pos.x,pos.h,pos.w);
}
コード例 #28
0
ファイル: openconnectauth.cpp プロジェクト: KDE/plasma-nm
void OpenconnectAuthWidget::validatePeerCert(const QString &fingerprint,
                                             const QString &peerCert, const QString &reason, bool *accepted)
{
    Q_D(OpenconnectAuthWidget);

    const QString host = QLatin1String(openconnect_get_hostname(d->vpninfo));
    const QString port = QString::number(openconnect_get_port(d->vpninfo));
    const QString key = QString("certificate:%1:%2").arg(host,  port);
    const QString value = d->secrets.value(key);

#if !OPENCONNECT_CHECK_VER(5,0)
#define openconnect_check_peer_cert_hash(v,d) strcmp(d, fingerprint.toUtf8().data())
#endif

    if (openconnect_check_peer_cert_hash(d->vpninfo, value.toUtf8().data())) {
        QWidget *widget = new QWidget();
        QVBoxLayout *verticalLayout;
        QHBoxLayout *horizontalLayout;
        QLabel *icon;
        QLabel *infoText;
        QTextBrowser *certificate;

        verticalLayout = new QVBoxLayout(widget);
        horizontalLayout = new QHBoxLayout(widget);
        icon = new QLabel(widget);
        QSizePolicy sizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
        sizePolicy.setHorizontalStretch(0);
        sizePolicy.setVerticalStretch(0);
        sizePolicy.setHeightForWidth(icon->sizePolicy().hasHeightForWidth());
        icon->setSizePolicy(sizePolicy);
        icon->setMinimumSize(QSize(48, 48));
        icon->setMaximumSize(QSize(48, 48));

        horizontalLayout->addWidget(icon);

        infoText = new QLabel(widget);
        infoText->setAlignment(Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter);

        horizontalLayout->addWidget(infoText);

        verticalLayout->addLayout(horizontalLayout);

        certificate = new QTextBrowser(widget);
        certificate->setTextInteractionFlags(Qt::TextSelectableByMouse);
        certificate->setOpenLinks(false);

        verticalLayout->addWidget(certificate);

        icon->setPixmap(QIcon::fromTheme("dialog-information").pixmap(KIconLoader::SizeLarge));
        infoText->setText(i18n("Check failed for certificate from VPN server \"%1\".\n"
                               "Reason: %2\nAccept it anyway?", openconnect_get_hostname(d->vpninfo),reason));
        infoText->setWordWrap(true);
        certificate->setText(peerCert);

        QPointer<QDialog> dialog = new QDialog(this);
        dialog.data()->setWindowModality(Qt::WindowModal);
        dialog->setLayout(new QVBoxLayout);
        QDialogButtonBox* buttons = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel, dialog);
        connect(buttons, &QDialogButtonBox::accepted, dialog.data(), &QDialog::accept);
        connect(buttons, &QDialogButtonBox::rejected, dialog.data(), &QDialog::reject);
        dialog->layout()->addWidget(widget);
        dialog->layout()->addWidget(buttons);
        if(dialog.data()->exec() == QDialog::Accepted) {
            *accepted = true;
        } else {
            *accepted = false;
        }
        if (dialog) {
            dialog.data()->deleteLater();
        }
        widget->deleteLater();
    } else {
        *accepted = true;
    }
    if (*accepted) {
        d->secrets.insert(key, QString(fingerprint));
    }
    d->mutex.lock();
    d->workerWaiting.wakeAll();
    d->mutex.unlock();
}
コード例 #29
0
void KPrWebPresentationWizard::setupPage5()
{
    page5 = new QHBox( this );
    QWhatsThis::add( page5, i18n("This page allows you to specify some options for "
                                 "presentations which run unattended, such as time "
                                 "elapsed before advancing to the next slide, looping "
                                 "and the presence of headers. If you do not want "
                                 "an unattended presentation, just leave defaults unchanged.") );
    page5->setSpacing( KDialog::spacingHint() );
    page5->setMargin( KDialog::marginHint() );

    QLabel* sidebar = new QLabel( page5 );
    sidebar->setMinimumSize( 106, 318 );
    sidebar->setMaximumSize( 106, 318 );
    sidebar->setFrameShape( QFrame::Panel );
    sidebar->setFrameShadow( QFrame::Sunken );
    sidebar->setPixmap(locate("data", "kpresenter/pics/webslideshow-sidebar.png"));

    QWidget* canvas = new QWidget( page5 );
    QGridLayout *layout = new QGridLayout( canvas, 6, 2,
                                           KDialog::marginHint(), KDialog::spacingHint() );

    QLabel *helptext = new QLabel( canvas );
    helptext->setAlignment( Qt::WordBreak | Qt::AlignVCenter| Qt::AlignLeft );
    QString help = i18n("Here you can configure some options for unattended "
                        "presentations, such as time elapsed before automatically advance to "
                        "the next slide, looping and the presence of headers.");
    helptext->setText(help);

    layout->addMultiCellWidget( helptext, 0, 0, 0, 1 );

    layout->addMultiCell( new QSpacerItem( 1, 50 ), 1, 1, 0, 1 );

    QLabel *label1 = new QLabel( i18n("Advance after:"), canvas );
    label1->setAlignment( Qt::AlignVCenter | Qt::AlignRight );
    QWhatsThis::add( label1, i18n( "This selection allows you to specify "
                                   "the time between slides." ) );
    layout->addWidget( label1, 2, 0 );

    timeBetweenSlides = new KIntNumInput( webPres.getTimeBetweenSlides(), canvas );
    timeBetweenSlides->setSpecialValueText(i18n( "Disabled" ));
    QWhatsThis::add( timeBetweenSlides, i18n( "This selection allows you to specify "
                                 "the time between slides." ) );
    layout->addWidget( timeBetweenSlides, 2, 1 );
    timeBetweenSlides->setSuffix( " seconds" );
    timeBetweenSlides->setRange( 0, 900, 1 );

    layout->addMultiCell( new QSpacerItem( 1, 10 ), 1, 1, 0, 1 );

    writeHeader=new QCheckBox( i18n("Write header to the slides"), canvas);
    QWhatsThis::add( writeHeader, i18n( "This checkbox allows you to specify if you "
                                       "want to write the navigation buttons on top "
                                       "of the slide." ) );
    writeHeader->setChecked( webPres.wantHeader() );
    layout->addWidget( writeHeader, 3, 1);

    writeFooter=new QCheckBox( i18n("Write footer to the slides"), canvas);
    QWhatsThis::add( writeFooter, i18n( "This checkbox allows you to specify if you "
                                       "want to write an imprint consisting on the author "
                                       "and the software used to create these slides." ) );
    writeFooter->setChecked( webPres.wantFooter() );
    layout->addWidget( writeFooter, 4, 1);

    loopSlides=new QCheckBox( i18n("Loop presentation"), canvas);
    QWhatsThis::add( loopSlides, i18n( "This checkbox allows you to specify if you "
                                       "want the presentation to start again once "
                                       "the latest slide is reached." ) );
    loopSlides->setChecked( webPres.wantLoopSlides() );
    layout->addWidget( loopSlides, 5, 1);

    QSpacerItem* spacer = new QSpacerItem( 1, 10,
                                           QSizePolicy::Minimum, QSizePolicy::Expanding );
    layout->addMultiCell( spacer, 5, 5, 0, 1 );

    addPage( page5, i18n( "Step 5: Options for Unattended Presentations" ) );

    setHelpEnabled(page5, false);  //doesn't do anything currently

    setFinish( page5, true );
}
コード例 #30
0
ファイル: gui_adminwindow.cpp プロジェクト: codepr/linqedin
Gui_AdminWindow::Gui_AdminWindow(QWidget* parent) : QWidget(parent) {
    _admin = new LinqAdmin;
    setWindowFlags(Qt::FramelessWindowHint);
    setWindowOpacity(0.95);
    setStyleSheet(QStringLiteral("QGroupBox{border:1px solid #000;border-radius:15px;} QGroupBox::title {subcontrol-origin: margin;subcontrol-position: top center;top:-6px;}"));
    QLabel* linkLabel = new QLabel("User list");
    QLabel* groupLabel = new QLabel("Group list");
    QPushButton* add = new QPushButton("Insert");
    add->setIcon(QPixmap("img/add70.png"));
    linkLabel->setMaximumSize(120,20);
    groupLabel->setMaximumSize(120,20);
    _level = new QComboBox;
    _level->addItem("Basic", QVariant(0));
    _level->addItem("Business", QVariant(1));
    _level->addItem("Executive", QVariant(2));
    tbar = new QToolBar;
    QToolButton* rm = new QToolButton(tbar);
    QToolButton* ok = new QToolButton(tbar);
    QToolButton* next = new QToolButton(tbar);
    QToolButton* delG = new QToolButton(tbar);
    rm->setIcon(QPixmap("img/cross108.png"));
    rm->setToolTip("Remove this user from Linqedin");
    ok->setIcon(QPixmap("img/check67.png"));
    ok->setToolTip("Upgrade this user");
    next->setIcon(QPixmap("img/right244.png"));
    next->setToolTip("Next result");
    delG->setIcon(QPixmap("img/cross108.png"));
    delG->setToolTip("Delete group");
    connect(rm, SIGNAL(clicked()), this, SLOT(removeUser()));
    connect(add, SIGNAL(clicked()), this, SLOT(addUser()));
    connect(ok, SIGNAL(clicked()), this, SLOT(upgradeUser()));
    connect(next, SIGNAL(clicked()), this, SLOT(nextResult()));
    connect(delG, SIGNAL(clicked()), this, SLOT(deleteGroup()));
    tbar->addWidget(rm);
    tbar->addWidget(ok);
    tbar->addWidget(next);
    tbar->addWidget(delG);
    tbar->actions().at(1)->setVisible(false);
    tbar->hide();
    QGroupBox* _admbox = new QGroupBox;
    QGroupBox* _admins = new QGroupBox;
    for(int i = 0; i < 5; ++i)
        edt[i] = new QLineEdit;
    // search bar
    edt[3]->setEchoMode(QLineEdit::Password);
    edt[4]->setPlaceholderText("Search user");
    createSearch();
    connect(edt[4], SIGNAL(returnPressed()), this, SLOT(startSearch()));
    QVBoxLayout* _mainLayout = new QVBoxLayout;
    _mainLayout->setSpacing(20);
    QGridLayout* _layout = new QGridLayout;
    QGridLayout* _inslay = new QGridLayout;
    QFormLayout* frmsx = new QFormLayout;
    QFormLayout* frmdx = new QFormLayout;

    _userList = new QListWidget;
    _groupList = new QListWidget;

    _userInfo = new Gui_DisplayInfo;
    _userInfo->setReadOnly(true);
    QPushButton* quit = new QPushButton;
    quit->setIcon(QPixmap("img/prohibited1.png"));
    connect(quit, SIGNAL(clicked()), this, SLOT(close()));
    createUserList();
    createGroupList();
    _mainLayout->addWidget(quit, 0, Qt::AlignTop | Qt::AlignRight);
    _layout->addWidget(linkLabel, 0, 0, 1, 1);
    _layout->addWidget(_userInfo, 0, 1, 4, 1);
    _layout->addWidget(_userList, 1, 0, 1, 1);
    _layout->addWidget(groupLabel, 2, 0, 1, 1);
    _layout->addWidget(_groupList, 3, 0, 1, 1);
    _layout->addWidget(edt[4], 4, 0, 1, 1);
    _layout->addWidget(tbar, 4, 1, 1, 1, Qt::AlignCenter);
    _layout->setRowStretch(0,0);
    _layout->setRowStretch(1,1);
    _layout->setRowStretch(2,0);
    _layout->setColumnStretch(0,1);
    _layout->setColumnStretch(1,5);
    frmsx->addRow("Name:", edt[0]);
    frmdx->addRow("Surname:", edt[1]);
    frmsx->addRow("Username:"******"Password:"******"Privilege:", _level);

    _inslay->addLayout(frmsx, 0, 0, 1, 1);
    _inslay->addLayout(frmdx, 0, 1, 1, 1);
    _inslay->addWidget(add, 1, 1, 1, 1, Qt::AlignCenter);

    _admbox->setLayout(_layout);
    _admins->setLayout(_inslay);

    _mainLayout->addWidget(_admbox);
    _mainLayout->addWidget(_admins);
    setLayout(_mainLayout);
    connect(this, SIGNAL(modified()), this, SLOT(refreshLists()));
    move(100, 30);
    resize(1150, 720);
}