Esempio n. 1
0
void DWindowUI::AddProcessUI(QBoxLayout * top) {
    QVBoxLayout *process = new QVBoxLayout();

    QSpacerItem *sp = new QSpacerItem(64,64,QSizePolicy::Minimum, QSizePolicy::Expanding);
    process->addSpacerItem(sp);

    isoLabel_ = new DRoteAnimation(QPixmap(":/ui/images/iso-inactive.png"));
    process->addWidget(isoLabel_);
    process->setAlignment(isoLabel_, Qt::AlignCenter);

    processLabel_ =new QLabel();
    processLabel_->setPixmap(QPixmap(":/ui/images/process-inactive.png"));
    process->addWidget(processLabel_);
    process->setAlignment(processLabel_, Qt::AlignCenter);

    usbLabel_ =new QLabel("");
    QPixmap usbPixmap(":/ui/images/usb-inactive.png");
    usbLabel_->setFixedSize(usbPixmap.size());
    usbLabel_->setStyleSheet("QLabel { background : url(:/ui/images/usb-inactive.png); }");
    usbLabel_->setAlignment(Qt::AlignCenter);
    process->addWidget(usbLabel_);
    process->setAlignment(usbLabel_, Qt::AlignCenter);

    process->addSpacerItem(sp);

    top->addLayout(process);

}
QVBoxLayout* VirtualKeyboardMouseWidget::setupAuxKeyboardLayout()
{
    QHBoxLayout *tempHBoxLayout = new QHBoxLayout();
    QVBoxLayout *tempVBoxLayout = new QVBoxLayout();
    QGridLayout *tempGridLayout = new QGridLayout();

    tempHBoxLayout->setSpacing(0);
    tempHBoxLayout->addWidget(createNewKey("Print"));
    tempHBoxLayout->addWidget(createNewKey("Scroll_Lock"));
    tempHBoxLayout->addWidget(createNewKey("Pause"));
    tempVBoxLayout->addLayout(tempHBoxLayout);

    tempVBoxLayout->addSpacerItem(new QSpacerItem(20, 20, QSizePolicy::Minimum, QSizePolicy::Fixed));

    tempGridLayout->setSpacing(0);
    tempGridLayout->addWidget(createNewKey("Insert"), 1, 1, 1, 1);
    tempGridLayout->addWidget(createNewKey("Home"), 1, 2, 1, 1);
    tempGridLayout->addWidget(createNewKey("Prior"), 1, 3, 1, 1);
    tempGridLayout->addWidget(createNewKey("Delete"), 2, 1, 1, 1);
    tempGridLayout->addWidget(createNewKey("End"), 2, 2, 1, 1);
    tempGridLayout->addWidget(createNewKey("Next"), 2, 3, 1, 1);
    tempVBoxLayout->addLayout(tempGridLayout);

    tempVBoxLayout->addSpacerItem(new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Fixed));

    tempGridLayout = new QGridLayout();
    tempGridLayout->setSpacing(0);
    tempGridLayout->addWidget(createNewKey("Up"), 1, 2, 1, 1);
    tempGridLayout->addWidget(createNewKey("Left"), 2, 1, 1, 1);
    tempGridLayout->addWidget(createNewKey("Down"), 2, 2, 1, 1);
    tempGridLayout->addWidget(createNewKey("Right"), 2, 3, 1, 1);
    tempVBoxLayout->addLayout(tempGridLayout);

    return tempVBoxLayout;
}
Esempio n. 3
0
DeviceSettingUpm::DeviceSettingUpm(Device *device, QWidget *parent)
 : DeviceSetting(device, parent)
{
	QVBoxLayout *layout = new QVBoxLayout(this);
	layout->addSpacerItem( new QSpacerItem(20, 109, QSizePolicy::Minimum, QSizePolicy::Expanding) );
	QGridLayout *gl = new QGridLayout;

	QLabel *houseLabel = new QLabel( tr("House"), this);
	houseLabel->setAlignment( Qt::AlignCenter );
	gl->addWidget(houseLabel, 0, 0);

	house.setMinimum(0);
	house.setMaximum(4095);
	gl->addWidget(&house, 1, 0);

	QLabel *buttonLabel = new QLabel( tr("Button"), this);
	buttonLabel->setAlignment( Qt::AlignCenter );
	gl->addWidget(buttonLabel, 0, 1);

	int choosedButton = device->parameter("unit", "1").toInt();
	QVBoxLayout *vl = new QVBoxLayout;
	for (int i = 1; i <= 4; ++i) {
		QRadioButton *button = new QRadioButton( tr("Button %1").arg(i), this);
		if (i == 1 || choosedButton == i) {
			button->setChecked( true );
		}
		vl->addWidget(button);
	}
	gl->addLayout(vl, 1, 1);

	layout->addLayout( gl );
	layout->addSpacerItem( new QSpacerItem(20, 109, QSizePolicy::Minimum, QSizePolicy::Expanding) );

	house.setValue( device->parameter("house", "0").toInt() );
}
Esempio n. 4
0
void MainWindow::addRow( int fileId, const QString &fileName, int progress )
{
    int rowId = ui->files->rowCount();

    ui->files->insertRow( rowId );
    QTableWidgetItem *id = new QTableWidgetItem( QString::number(fileId) );
    QTableWidgetItem *fn = new QTableWidgetItem( fileName );

    QWidget          *wt = new QWidget();
    QSpacerItem      *s1 = new QSpacerItem(1, 1, QSizePolicy::Fixed, QSizePolicy::Expanding );
    QSpacerItem      *s2 = new QSpacerItem(1, 7, QSizePolicy::Fixed, QSizePolicy::Expanding );
    QVBoxLayout      *lt = new QVBoxLayout( wt );
    QProgressBar     *pb = new QProgressBar( wt );
    pb->setObjectName( "PROGRESS_BAR" );
    pb->setParent( this );
    pb->setValue( progress );
    pb->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding );

    lt->addSpacerItem( s1 );
    lt->addWidget( pb );
    lt->addSpacerItem( s2 );

    lt->setMargin( 0 );
    wt->setLayout( lt );

    ui->files->setItem( rowId,       0, id );
    ui->files->setItem( rowId,       1, fn );
    ui->files->setCellWidget( rowId, 2, wt );
}
Esempio n. 5
0
Ui::NameAndStatusWidget::NameAndStatusWidget(QWidget* _parent, int _nameBaseline, int _statusBaseline)
    : QWidget(_parent)
    , name_(NULL)
    , status_(NULL)
{
    setContentsMargins(0, 0, 0, 0);

    QVBoxLayout* rootLayout = Utils::emptyVLayout();
    rootLayout->setAlignment(Qt::AlignLeft);
    setLayout(rootLayout);

    rootLayout->addSpacerItem(new QSpacerItem(1, 1, QSizePolicy::Minimum, QSizePolicy::Expanding));

    QFont font = QApplication::font();
    font.setStyleStrategy(QFont::PreferAntialias);

    name_ = new voipTools::BoundBox<ShadowedWidget<TextEmojiLabel>>(this);
    name_->setFont(font);
    name_->setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding));
    name_->setSizeToBaseline(_nameBaseline); // SORRY, MANKIND!!! THIS IS NECCESSARY EVIL BECAUSE TextEmojiLabel IS TERRIBLE!!!
    layout()->addWidget(name_);

    status_ = new voipTools::BoundBox<ShadowedWidget<TextEmojiLabel> >(this);
    status_->setFont(font);
    status_->setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding));
    status_->setSizeToBaseline(_statusBaseline);// SORRY, MANKIND!!! THIS IS NECCESSARY EVIL BECAUSE TextEmojiLabel IS TERRIBLE!!!
    layout()->addWidget(status_);

    rootLayout->addSpacerItem(new QSpacerItem(1, 1, QSizePolicy::Minimum, QSizePolicy::Expanding));
}
Esempio n. 6
0
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;
}
Esempio n. 7
0
MainMenu::MainMenu(QWidget *parent) :
    SimpleNavigateableWidget(tr("Main menu"), parent),
    lblViewName(new QLabel(tr("Ergonomieapp"))),
    btnMetaDataView(new IconButton(this, "commentIcon", tr("Head Data"))),
    btnWorkplaceList(new IconButton(this, "workplaceIcon", tr("Workplaces"))),
    btnRessourceManagement(new IconButton(this, "equipmentIcon", tr ("Ressource Management"))),
    btnShift(new IconButton(this, "calendarIcon", tr("Shift Data"))),
    btnSettings(new QPushButton(this)),
    btnNewRecording(new QPushButton(this)),
    btnSendDatabase(new QPushButton(this)),
    btnImport(new QPushButton(this))
{
    QVBoxLayout *mainLayout = new QVBoxLayout;

    btnMetaDataView->setMinimumSize(300, 60);
    btnWorkplaceList->setMinimumSize(300, 60);
    btnRessourceManagement->setMinimumSize(300, 60);
    btnShift->setMinimumSize(300, 60);

    btnSettings->setObjectName("settingsIcon");
    btnSettings->setFixedSize(45, 45);

    btnSendDatabase->setObjectName("sendIcon");
    btnSendDatabase->setFixedSize(45, 45);

    btnImport->setObjectName("receiveIcon");
    btnImport->setFixedSize(45, 45);

    btnNewRecording->setObjectName("quickRecordingIcon");
    btnNewRecording->setFixedSize(45, 45);

    connect(btnMetaDataView, SIGNAL(clicked()), this, SLOT(btnMetaDataViewClicked()));
    connect(btnWorkplaceList, SIGNAL(clicked()), this, SLOT(btnWorkplaceListClicked()));
    connect(btnRessourceManagement, SIGNAL(clicked()), this, SLOT(btnRessourceManagementClicked()));
    connect(btnShift, SIGNAL(clicked()), this, SLOT(btnShiftClicked()));
    connect(btnNewRecording, SIGNAL(clicked()), this, SLOT(btnNewRecordingClicked()));
    connect(btnSettings, SIGNAL(clicked()), this, SLOT(btnSettingsClicked()));
    connect(btnImport, SIGNAL(clicked()), this, SLOT(btnImportClicked()));
    connect(btnSendDatabase, SIGNAL(clicked()), this, SLOT(btnSendDatabaseClicked()));

    lblViewName->setObjectName("lblHeader");

    mainLayout->addSpacerItem(new QSpacerItem(0,0,QSizePolicy::Expanding, QSizePolicy::Expanding));
    mainLayout->addWidget(btnMetaDataView, 0, Qt::AlignCenter);
    mainLayout->addSpacerItem(new QSpacerItem(0,60, QSizePolicy::Minimum, QSizePolicy::Fixed));
    mainLayout->addWidget(btnWorkplaceList, 0, Qt::AlignCenter);
    mainLayout->addSpacerItem(new QSpacerItem(0,60,QSizePolicy::Minimum, QSizePolicy::Fixed));
    mainLayout->addWidget(btnRessourceManagement, 0, Qt::AlignCenter);
    mainLayout->addSpacerItem(new QSpacerItem(0,60,QSizePolicy::Minimum, QSizePolicy::Fixed));
    mainLayout->addWidget(btnShift, 0, Qt::AlignCenter);
    mainLayout->addSpacerItem(new QSpacerItem(0,0,QSizePolicy::Minimum, QSizePolicy::Expanding));

    setLayout(mainLayout);

}
Esempio n. 8
0
VoreenSettingsDialog::VoreenSettingsDialog(QWidget* parent)
    : QDialog(parent, Qt::Tool | Qt::Window)
{
    setWindowTitle(tr("Voreen Settings Editor"));

    QVBoxLayout* mainLayout = new QVBoxLayout();
    setLayout(mainLayout);

    // scroll area
    QScrollArea* scrollArea = new QScrollArea(this);
    scrollArea->setWidgetResizable(true);
    scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    scrollArea->setContentsMargins(0, 0, 0, 0);
    mainLayout->addWidget(scrollArea);

    // container widget for PropertyOwnerWidgets
    QWidget* containerWidget = new QWidget();
    scrollArea->setWidget(containerWidget);
    QVBoxLayout* widgetLayout = new QVBoxLayout();
    containerWidget->setLayout(widgetLayout);

    // application widget
    PropertyOwnerWidget* appPow = new PropertyOwnerWidget(this, VoreenApplication::app(), "Application Settings", true, false);
    widgetLayout->addWidget(appPow);

    // module widgets
    VoreenApplication* va = VoreenApplication::app();
    const std::vector<VoreenModule*>& modules = va->getModules();
    for(size_t i=0; i<modules.size(); i++) {
        if(!modules[i]->getProperties().empty()) {
            widgetLayout->addSpacerItem(new QSpacerItem(1, 8));
            PropertyOwnerWidget* modulePow = new PropertyOwnerWidget(this, modules[i], "Module: " + modules[i]->getID(), true, false);
            widgetLayout->addWidget(modulePow);
        }
    }
    widgetLayout->addStretch();

    // button row
    mainLayout->addSpacerItem(new QSpacerItem(1, 4));
    QHBoxLayout* buttonLayout = new QHBoxLayout();
    resetButton_ = new QPushButton("Reset");
    buttonLayout->addWidget(resetButton_);
    buttonLayout->addStretch();
    closeButton_ = new QPushButton("Close");
    buttonLayout->addWidget(closeButton_);
    mainLayout->addLayout(buttonLayout);

    connect(resetButton_, SIGNAL(clicked()), this, SLOT(resetSettings()));
    connect(closeButton_, SIGNAL(clicked()), this, SIGNAL(closeSettings()));
}
Esempio n. 9
0
void OutputWindow::createLayout()	{
	//Left layout
	QVBoxLayout *leftLayout = new QVBoxLayout;
	leftLayout->addWidget(yourPriceLabel);
	leftLayout->addWidget(yourPrice);

	QSpacerItem *vSpacer = new QSpacerItem(1,10,QSizePolicy::Minimum, QSizePolicy::Fixed);

	leftLayout->addSpacerItem(vSpacer);
	leftLayout->addWidget(bestPriceLabel);
	leftLayout->addWidget(bestPrice);
	leftLayout->addStretch();

	//Right layout - list
	QListView *listView = new QListView;

	//Left-right layout
	QHBoxLayout *layout = new QHBoxLayout;
	layout->addLayout(leftLayout);
	layout->addWidget(listView);

	//Bottom buttons
	bottomLayout = new QHBoxLayout;
	bottomLayout->addStretch();
	bottomLayout->addWidget(resumeButton);
	bottomLayout->addWidget(cancelButton);

	//Main layout
	commonLayout = new QVBoxLayout;
	commonLayout->addLayout(layout);
	commonLayout->addLayout(bottomLayout);

	setLayout(commonLayout);
}
Esempio n. 10
0
FinishPage::FinishPage(QWidget * parent)
: QWizardPage(parent)
{
   setTitle(tr("Completing the Maverick Setup Wizard"));
   QVBoxLayout * vb = new QVBoxLayout;
   QLabel * lbl = new QLabel(tr("Setup has finished installing Maverick Poker Bot on your computer. The application may be launched by selecting the installed icons."), this);
   lbl->setWordWrap(true);
   QLabel * lbl1 = new QLabel(tr("Maverick Poker Bot has been installed in the folder:"), this);
   lblTo_ = new QLabel(this);
   lblTo_->setWordWrap(true);
   //lblTo_->setFrameStyle(QFrame::StyledPanel | QFrame::Sunken);
   //lblTo_->setMinimumHeight(24);
   //QLabel * lbl2 = new QLabel(tr("The shortcut with the same name was created on the Desktop.<p>This path was generated automatically for security purposes."), this);
   
   checkDesk_ = new QCheckBox(tr("Create a &desktop icon"), this);
   //checkStart_ = new QCheckBox(tr("Create a &folder in the Start menu"), this);
   checkCanny_ = new QCheckBox(tr("&Launch Maverick Poker Bot Configuration"), this);
   checkRemove_ = new QCheckBox(tr("Remove the &Installer of Maverick Poker Bot"), this);
   checkDesk_->setChecked(true);
   //checkStart_->setChecked(true);
   checkCanny_->setChecked(true);
   checkRemove_->setChecked(true);
   vb->addWidget(lbl);
   vb->addWidget(lbl1);
   vb->addWidget(lblTo_);
   //vb->addWidget(lbl2);
   vb->addSpacerItem(new QSpacerItem(1, 12));
   vb->addWidget(checkDesk_);
   //vb->addWidget(checkStart_);
   vb->addWidget(checkCanny_);
   vb->addWidget(checkRemove_);
   vb->addStretch(1);
   setLayout(vb);
}
void ParametersToolBox::setupUi()
{
	this->removeItem(0); // remove dummy page used in .ui
	QWidget * currentItem = 0;
	const ParametersMap & parameters = Settings::getParameters();
	for(ParametersMap::const_iterator iter=parameters.constBegin();
			iter!=parameters.constEnd();
			++iter)
	{
		QStringList splitted = iter.key().split('/');
		QString group = splitted.first();
		QString name = splitted.last();
		if(currentItem == 0 || currentItem->objectName().compare(group) != 0)
		{
			currentItem = new QWidget(this);
			this->addItem(currentItem, group);
			currentItem->setObjectName(group);
			QVBoxLayout * layout = new QVBoxLayout(currentItem);
			currentItem->setLayout(layout);
			layout->setContentsMargins(0,0,0,0);
			layout->setSpacing(0);
			layout->addSpacerItem(new QSpacerItem(0,0, QSizePolicy::Minimum, QSizePolicy::Expanding));

			addParameter(layout, iter.key(), iter.value());
		}
		else
		{
			addParameter((QVBoxLayout*)currentItem->layout(), iter.key(), iter.value());
		}
	}

	updateParametersVisibility();
}
Esempio n. 12
0
void PrefsDialog::initCode(QWidget * widget, QList<Platform *> platforms)
{
    QVBoxLayout * vLayout = new QVBoxLayout();
    vLayout->addWidget(createProgrammerForm(platforms));
    vLayout->addSpacerItem(new QSpacerItem(1, 1, QSizePolicy::Preferred, QSizePolicy::Expanding));
    widget->setLayout(vLayout);
}
Esempio n. 13
0
void SettingsDialog::initUI()
{
	setWindowTitle("Choose Bundle Search Paths");

	QVBoxLayout* verticalLayoutOuter = new QVBoxLayout();
	QHBoxLayout* horizontalLayoutTop = new QHBoxLayout();
	QVBoxLayout* verticalLayoutTopRight = new QVBoxLayout();

	QPushButton* pushButtonAdd = new QPushButton( "+" );
	QPushButton* pushButtonRemove = new QPushButton( "-" );
	QDialogButtonBox* buttonBoxBottom = new QDialogButtonBox( QDialogButtonBox::Ok );;

	QSpacerItem* verticalSpacer = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );;

	m_OptionsWidget = new QListWidget();

	verticalLayoutOuter->addLayout( horizontalLayoutTop );
	verticalLayoutOuter->addWidget( buttonBoxBottom, 1, 0 );

	horizontalLayoutTop->addWidget( m_OptionsWidget );
	horizontalLayoutTop->addLayout( verticalLayoutTopRight );

	verticalLayoutTopRight->addWidget( pushButtonAdd, 0, 0 );
	verticalLayoutTopRight->addWidget( pushButtonRemove, 1, 0 );
	verticalLayoutTopRight->addSpacerItem( verticalSpacer );

	this->setLayout( verticalLayoutOuter );
	this->setModal( true );

	connect( buttonBoxBottom, SIGNAL(accepted()), this, SLOT( onAccept()) );
	connect( buttonBoxBottom, SIGNAL(rejected()), this, SLOT( reject()) );
	connect( pushButtonAdd,   SIGNAL(clicked()),  this, SLOT( onAddItemSlot()) );
	connect( pushButtonRemove,SIGNAL(clicked()),  this, SLOT( onRemoveSelectedItems()) );
}
void tst_QBoxLayout::taskQTBUG_7103_minMaxWidthNotRespected()
{
    QLabel *label = new QLabel("Qt uses standard C++, but makes extensive use of the C pre-processor to enrich the language. Qt can also be used in several other programming languages via language bindings. It runs on all major platforms, and has extensive internationalization support. Non-GUI features include SQL database access, XML parsing, thread management, network support and a unified cross-platform API for file handling.");
    label->setWordWrap(true);
    label->setFixedWidth(200);

    QVBoxLayout *layout = new QVBoxLayout;
    layout->addWidget(label);
    layout->addSpacerItem(new QSpacerItem(1, 1, QSizePolicy::Fixed, QSizePolicy::Expanding));

    QWidget widget;
    widget.setLayout(layout);
    widget.show();
    QTest::qWaitForWindowShown(&widget);

    int height = label->height();

    QRect g = widget.geometry();
    g.setWidth(600);
    widget.setGeometry(g);

    QTest::qWait(50);

    QCOMPARE(label->height(), height);
}
Esempio n. 15
0
void VisibilityToolPanel::InitUI()
{
	QVBoxLayout* layout = new QVBoxLayout(this);

	buttonSetVisibilityPoint = new QPushButton(this);
	buttonSetVisibilityArea = new QPushButton(this);
	buttonSaveTexture = new QPushButton(this);
	sliderWidgetAreaSize = new SliderWidget(this);
	QSpacerItem* spacer = new QSpacerItem(10, 10, QSizePolicy::Expanding, QSizePolicy::Expanding);

	QVBoxLayout* layoutBrushSize = new QVBoxLayout();
	QLabel* labelBrushSize = new QLabel();
	labelBrushSize->setText(ResourceEditor::VISIBILITY_TOOL_AREA_SIZE_CAPTION.c_str());
	layoutBrushSize->addWidget(labelBrushSize);
	layoutBrushSize->addWidget(sliderWidgetAreaSize);

	layout->addWidget(buttonSetVisibilityPoint);
	layout->addLayout(layoutBrushSize);
	layout->addWidget(buttonSetVisibilityArea);
	layout->addWidget(buttonSaveTexture);
	layout->addSpacerItem(spacer);

	setLayout(layout);

	SetWidgetsState(false);
	BlockAllSignals(true);

	sliderWidgetAreaSize->Init(false, DEF_AREA_MAX_SIZE, DEF_AREA_MIN_SIZE, DEF_AREA_MIN_SIZE);
	sliderWidgetAreaSize->SetRangeBoundaries(ResourceEditor::BRUSH_MIN_BOUNDARY, ResourceEditor::BRUSH_MAX_BOUNDARY);
	buttonSetVisibilityPoint->setText(ResourceEditor::VISIBILITY_TOOL_SET_POINT_CAPTION.c_str());
	buttonSetVisibilityPoint->setCheckable(true);
	buttonSetVisibilityArea->setText(ResourceEditor::VISIBILITY_TOOL_SET_AREA_CAPTION.c_str());
	buttonSetVisibilityArea->setCheckable(true);
	buttonSaveTexture->setText(ResourceEditor::VISIBILITY_TOOL_SAVE_TEXTURE_CAPTION.c_str());
}
QWidget* createSubproductWidget( const QJsonDocument& json )
{
    QString gamekey     = json.object()["gamekey"].toString();
    QString subproduct  = json.object()["machine_name"].toString();

    QHBoxLayout* hlayout = new QHBoxLayout;
    QVBoxLayout* vlayout = new QVBoxLayout;
    QWidget* widget      = new QWidget;

    SubproductIconLabel_t* icon_label    = new SubproductIconLabel_t(gamekey,subproduct);
    QLabel* title_label   = new QLabel;
    QLabel* payee_label   = new QLabel;

    QHBoxLayout* hbox_services = new QHBoxLayout;
    QJsonObject meta_data_game = json.object()["meta_data"].toObject()["content"].toObject()["game"].toObject();
    for ( auto service : meta_data_game.keys() )
    {
        QStringList platforms;
        QJsonArray json_platforms = meta_data_game[service].toArray();
        
        for ( auto platform : json_platforms ) platforms << platform.toString();

        hbox_services->addWidget( new PlatformIconLabel_t(service,platforms) );
    }
    hbox_services->addSpacerItem( new QSpacerItem( 0,0,QSizePolicy::Expanding,QSizePolicy::Expanding ) );
    hbox_services->setContentsMargins( 0,0,0,0 );


    hlayout->setContentsMargins( 0,0,0,0 );
    hlayout->addWidget( icon_label );
    hlayout->addLayout( vlayout );
    vlayout->addWidget( title_label );
    vlayout->addWidget( payee_label );
    vlayout->addLayout( hbox_services );
    vlayout->addSpacerItem( new QSpacerItem(0,0,QSizePolicy::Expanding,QSizePolicy::Expanding) );

    widget->setLayout( hlayout );

    QString human_name = json.object()["human_name"].toString();
    QString payee_name = json.object()["payee"].toObject()["human_name"].toString();
    //TODO: link human_name with url
    QString payee_url  = json.object()["url"].toString(); //FIXME: use meta-data->developer url

    //TODO: use platformiconlabel

    QFont title_font;
    title_font.setBold( true );
    //title_font.setPointSize( title_font.pointSize()*2 );

    title_label->setText( human_name );
    title_label->setFont( title_font );
    title_label->setAlignment( Qt::AlignLeft | Qt::AlignTop );

    payee_label->setText( QString("<a href=\"%1\">%2</a>").arg(payee_url).arg(payee_name) );
    payee_label->setAlignment( Qt::AlignLeft | Qt::AlignTop );

    widget->setMaximumHeight( icon_label->height() );
    return widget;
}
Esempio n. 17
0
void PrefsDialog::initPCB(QWidget * widget, ViewInfoThing * viewInfoThing)
{
	QVBoxLayout * vLayout = new QVBoxLayout();
    vLayout->addWidget(createCurvyForm(viewInfoThing));
	vLayout->addSpacerItem(new QSpacerItem(1, 1, QSizePolicy::Preferred, QSizePolicy::Expanding));

	widget->setLayout(vLayout);
}
Esempio n. 18
0
PESvgView::PESvgView(QWidget * parent) : QFrame(parent)
{
    this->setObjectName("peSVG");

    m_pegi = NULL;
  
    QVBoxLayout * mainLayout = new QVBoxLayout;

    m_filename = new QLabel();
    mainLayout->addWidget(m_filename);

    QFrame * boundsFrame = new QFrame;
    QHBoxLayout * boundsLayout = new QHBoxLayout;

    QLabel * label = new QLabel("x:");
    boundsLayout->addWidget(label);
    m_x = new QLabel;
    boundsLayout->addWidget(m_x);
    boundsLayout->addSpacing(PEUtils::Spacing);

    label = new QLabel("y:");
    boundsLayout->addWidget(label);
    m_y = new QLabel;
    boundsLayout->addWidget(m_y);
    boundsLayout->addSpacing(PEUtils::Spacing);

    label = new QLabel(tr("width:"));
    boundsLayout->addWidget(label);
    m_width = new QLabel;
    boundsLayout->addWidget(m_width);
    boundsLayout->addSpacing(PEUtils::Spacing);

    label = new QLabel(tr("height:"));
    boundsLayout->addWidget(label);
    m_height = new QLabel;
    boundsLayout->addWidget(m_height);
    boundsLayout->addSpacing(PEUtils::Spacing);

    m_units = new QLabel();
    boundsLayout->addWidget(m_units);

    boundsLayout->addSpacerItem(new QSpacerItem(1, 1, QSizePolicy::Expanding));
    boundsFrame->setLayout(boundsLayout);
    mainLayout->addWidget(boundsFrame);

    m_svgElement = new QLabel;
    m_svgElement->setWordWrap(false);
    m_svgElement->setTextFormat(Qt::PlainText);
    mainLayout->addWidget(m_svgElement);

    mainLayout->addSpacerItem(new QSpacerItem(1, 1, QSizePolicy::Minimum, QSizePolicy::Expanding));

	//this->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);

    this->setLayout(mainLayout);


}
Esempio n. 19
0
void PrefsDialog::initSchematic(QWidget * widget, ViewInfoThing * viewInfoThing)
{
    Q_UNUSED(viewInfoThing);
	QVBoxLayout * vLayout = new QVBoxLayout();

	vLayout->addSpacerItem(new QSpacerItem(1, 1, QSizePolicy::Preferred, QSizePolicy::Expanding));

	widget->setLayout(vLayout);
}
Esempio n. 20
0
QWidget *AppAboutPage::createPage(QWidget *parent)
{
    QWidget *w = new QWidget(parent);
    QVBoxLayout *layout = new QVBoxLayout(w);
    layout->setSpacing(0);
    layout->setMargin(0);

    // Splash label
    QWidget *sw = new QWidget(w);
    QHBoxLayout *swLayout = new QHBoxLayout(sw);
    sw->setLayout(swLayout);
    QLabel *splash = new QLabel(w);
    splash->setPixmap(theme()->splashScreenPixmap(settings()->path(Core::ISettings::SplashScreen)));
    splash->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
    swLayout->addSpacerItem(new QSpacerItem(10, 10, QSizePolicy::Expanding));
    swLayout->addWidget(splash);
    swLayout->addSpacerItem(new QSpacerItem(10, 10, QSizePolicy::Expanding));
    layout->addWidget(sw);
    QFrame *line = new QFrame(w);
    line->setFrameShape(QFrame::HLine);
    line->setFrameShadow(QFrame::Sunken);
    layout->addWidget(line);
    layout->addSpacerItem(new QSpacerItem(20, 20, QSizePolicy::Fixed, QSizePolicy::Fixed));

    // Welcome label
    QLabel *label = new QLabel(w);
    label->setWordWrap(true);
    label->setOpenExternalLinks(true);
    layout->addWidget(label);
    layout->addSpacerItem(new QSpacerItem(20,20, QSizePolicy::Expanding, QSizePolicy::Expanding));
    label->clear();
        Utils::UpdateChecker *up = Core::ICore::instance()->updateChecker();
    QString tmp = tkTr(Trans::Constants::APPLICATION_ABOUT_YEAR_1_WEB_2)
                   .arg(QDate::currentDate().year())
                   .arg(qApp->organizationDomain());
    if (up->hasUpdate()) {
        tmp.append(tkTr(Trans::Constants::UPDATE_AVAILABLE));
    } else {
        tmp.append(tkTr(Trans::Constants::VERSION_UPTODATE));
    }
    label->setText(tmp);
    return w;
}
Esempio n. 21
0
void CameraDlg::layoutWindow()
{
	QSettings *settings = SyntroUtils::getSettings();

	settings->beginGroup(CAMERA_GROUP);

	QVBoxLayout *centralLayout = new QVBoxLayout(this);

	QFormLayout *formLayout = new QFormLayout();

	m_index = new QComboBox;
	m_index->setMaximumWidth(60);

	QList<int> deviceList = getVideoDeviceList(settings);
	int currentIndex = settings->value(CAMERA_CAMERA).toInt();

	for (int i = 0; i < deviceList.count(); i++) {
		m_index->addItem(QString::number(deviceList.at(i)));

		if (i == currentIndex)
			m_index->setCurrentIndex(i);
	}

	formLayout->addRow(tr("Camera"), m_index);

	m_width = new QLineEdit(this);
	m_width->setMaximumWidth(60);
	formLayout->addRow(tr("Frame width"), m_width);
	m_width->setText(settings->value(CAMERA_WIDTH).toString());
	m_width->setValidator(new QIntValidator(120, 1920));

	m_height = new QLineEdit(this);
	m_height->setMaximumWidth(60);
	formLayout->addRow(tr("Frame height"), m_height);
	m_height->setText(settings->value(CAMERA_HEIGHT).toString());
	m_height->setValidator(new QIntValidator(80, 1200));

	m_rate = new QLineEdit(this);
	m_rate->setMaximumWidth(60);
	formLayout->addRow(tr("Frame rate"), m_rate);
	m_rate->setText(settings->value(CAMERA_FRAMERATE).toString());
	m_rate->setValidator(new QIntValidator(1, 100));

	centralLayout->addLayout(formLayout);

	centralLayout->addSpacerItem(new QSpacerItem(20, 20));

	m_buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, this);
	m_buttons->setCenterButtons(true);

	centralLayout->addWidget(m_buttons);

	settings->endGroup();
	delete settings;
}
Esempio n. 22
0
  ui_layout& ui_layout::operator<<(const Literal<vbox_start_>&)
  {
    QBoxLayout* l = stack_.top();
    QVBoxLayout* n = new QVBoxLayout();
    n->addSpacerItem(new QSpacerItem(0,0, QSizePolicy::Expanding,
                                     QSizePolicy::Expanding));

    l->addLayout(n, 1);
    stack_.push(n);
    return *this;
  }
Esempio n. 23
0
PropertiesPanel *RunSettingsPanelFactory::createPanel(Target *target)
{
    PropertiesPanel *panel = new PropertiesPanel;
    QWidget *w = new QWidget();
    QVBoxLayout *l = new QVBoxLayout(w);
    QWidget *b = new RunSettingsWidget(target);
    l->addWidget(b);
    l->addSpacerItem(new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding));
    l->setContentsMargins(QMargins());
    panel->setWidget(w);
    panel->setIcon(QIcon(QLatin1String(":/projectexplorer/images/RunSettings.png")));
    panel->setDisplayName(RunSettingsWidget::tr("Run Settings"));
    return panel;
}
Esempio n. 24
0
TwitterComposerWidget::TwitterComposerWidget(Choqok::Account *account, QWidget *parent)
    : TwitterApiComposerWidget(account, parent), d(new Private)
{
    d->editorLayout = qobject_cast<QGridLayout *>(editorContainer()->layout());
    d->btnAttach = new QPushButton(editorContainer());
    d->btnAttach->setIcon(QIcon::fromTheme(QLatin1String("mail-attachment")));
    d->btnAttach->setToolTip(i18n("Attach a file"));
    d->btnAttach->setMaximumWidth(d->btnAttach->height());
    connect(d->btnAttach, SIGNAL(clicked(bool)), this, SLOT(selectMediumToAttach()));
    QVBoxLayout *vLayout = new QVBoxLayout;
    vLayout->addWidget(d->btnAttach);
    vLayout->addSpacerItem(new QSpacerItem(1, 1, QSizePolicy::Preferred, QSizePolicy::MinimumExpanding));
    d->editorLayout->addItem(vLayout, 0, 1, 1, 1);
}
void ScrollableTextDisplay1::setupUI(){


    ui->allRoutesScrollArea->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding);
    ui->allRoutesscrollAreaWidgetContents->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding);

    QGroupBox *wrapper = new QGroupBox();
    wrapper->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding);
    wrapper->setObjectName("wrapperGroupBox");

    QVBoxLayout *wrapperVerticalLayout = new QVBoxLayout;
    wrapperVerticalLayout->setObjectName("wrapperVerticalLayout");

    QString widgetName = "displayGLText1RouteWidget_";
    QSpacerItem *verticalSpacer = new QSpacerItem(0,50);



    int totalNumberOfRows = 0;

    Route tempRoute;
    SubRoute tempSubRoute;


    //generate as many GL widgets as there are number of routes
    for(int i = 0 ; i < allRoutes->getRoutes().size(); i++){

        totalNumberOfRows = 0;
        //calculate size here
        tempRoute = allRoutes->getRoutes().at(i);
        for(int j = 0 ; j <  tempRoute.getSubRoutes().size(); j++){
            tempSubRoute = tempRoute.getSubRoutes().at(j);
            totalNumberOfRows += tempSubRoute.getLegs().size();
        }

        QSize glWindowSize;
        glWindowSize.setHeight((totalNumberOfRows + 2)*heightPerRow);  // +2 is for the top and bottom margins which will have same height as the rows
        glWindowSize.setWidth(0); // This is dummy, the actual value is set in the widget itself

        DisplayGLText1RouteWidget *displayGLText1RouteWidget = new DisplayGLText1RouteWidget((allRoutes->getRoutes().at(i)),glWindowSize, heightPerRow);
        displayGLText1RouteWidget->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Fixed);
        displayGLText1RouteWidget->setObjectName(widgetName + QString::number(i));
        wrapperVerticalLayout->addWidget(displayGLText1RouteWidget);
        wrapperVerticalLayout->addSpacerItem(verticalSpacer);
    }

    wrapper->setLayout(wrapperVerticalLayout);
    ui->allRoutesScrollArea->setWidget(wrapper);
}
FacebookComposerWidget::FacebookComposerWidget(Choqok::Account* account, QWidget* parent)
    : Choqok::UI::ComposerWidget(account, parent), btnAttach(0), mediumName(0), btnCancel(0)
{
    editorLayout = qobject_cast<QGridLayout*>(editorContainer()->layout());
    btnAttach = new KPushButton(editorContainer());
    btnAttach->setIcon(KIcon("image-x-generic"));
    btnAttach->setToolTip(i18n("Attach a photo/Video"));
    btnAttach->setMaximumWidth(btnAttach->height());

    connect(btnAttach, SIGNAL(clicked(bool)), this, SLOT(selectMediumToAttach()));
    QVBoxLayout *vLayout = new QVBoxLayout;
    vLayout->addWidget(btnAttach);
    vLayout->addSpacerItem(new QSpacerItem(1, 1, QSizePolicy::Preferred, QSizePolicy::MinimumExpanding));
    editorLayout->addItem(vLayout, 0, 1, 1, 1);
}
QVBoxLayout* VirtualKeyboardMouseWidget::setupKeyboardNumPadLayout()
{
    QHBoxLayout *tempHBoxLayout = new QHBoxLayout();
    QVBoxLayout *tempVBoxLayout = new QVBoxLayout();
    QGridLayout *tempGridLayout = new QGridLayout();
    QVBoxLayout *finalVBoxLayout = new QVBoxLayout();

    finalVBoxLayout->addWidget(noneButton);
    finalVBoxLayout->addSpacerItem(new QSpacerItem(20, 20, QSizePolicy::Minimum, QSizePolicy::Fixed));

    tempHBoxLayout->setSpacing(0);
    tempHBoxLayout->addWidget(createNewKey("Num_Lock"));
    tempHBoxLayout->addWidget(createNewKey("KP_Divide"));
    tempHBoxLayout->addWidget(createNewKey("KP_Multiply"));
    tempHBoxLayout->addWidget(createNewKey("KP_Subtract"));
    tempVBoxLayout->addLayout(tempHBoxLayout);

    tempHBoxLayout = new QHBoxLayout();
    tempHBoxLayout->setSpacing(0);
    tempGridLayout->addWidget(createNewKey("KP_7"), 1, 1, 1, 1);
    tempGridLayout->addWidget(createNewKey("KP_8"), 1, 2, 1, 1);
    tempGridLayout->addWidget(createNewKey("KP_9"), 1, 3, 1, 1);
    tempGridLayout->addWidget(createNewKey("KP_4"), 2, 1, 1, 1);
    tempGridLayout->addWidget(createNewKey("KP_5"), 2, 2, 1, 1);
    tempGridLayout->addWidget(createNewKey("KP_6"), 2, 3, 1, 1);
    tempHBoxLayout->addLayout(tempGridLayout);
    tempHBoxLayout->addWidget(createNewKey("KP_Add"));
    tempVBoxLayout->addLayout(tempHBoxLayout);

    tempHBoxLayout = new QHBoxLayout();
    tempHBoxLayout->setSpacing(0);
    tempGridLayout = new QGridLayout();
    tempGridLayout->setSpacing(0);
    tempGridLayout->addWidget(createNewKey("KP_1"), 1, 1, 1, 1);
    tempGridLayout->addWidget(createNewKey("KP_2"), 1, 2, 1, 1);
    tempGridLayout->addWidget(createNewKey("KP_3"), 1, 3, 1, 1);
    tempGridLayout->addWidget(createNewKey("KP_0"), 2, 1, 1, 2);
    tempGridLayout->addWidget(createNewKey("KP_Decimal"), 2, 3, 1, 1);
    tempHBoxLayout->addLayout(tempGridLayout);
    tempHBoxLayout->addWidget(createNewKey("KP_Enter"));

    tempVBoxLayout->addLayout(tempHBoxLayout);
    finalVBoxLayout->addLayout(tempVBoxLayout);

    return finalVBoxLayout;
}
Esempio n. 28
0
void TerrainManager::initTerrainList()
{
	// TODO // I suppose this should be contained in a file

	QSignalMapper *mapper = new QSignalMapper(this);
	QVBoxLayout *layout = new QVBoxLayout;
	layout->setAlignment(Qt::AlignTop);
	for (BTech::Terrain terrain : BTech::terrainTypes) {
		QString terrainName = BTech::terrainStringChange[terrain];
		ClickableLabel *label = new ClickableLabel(terrainName);
		connect(label, &ClickableLabel::clicked, mapper, static_cast<void (QSignalMapper::*)()>(&QSignalMapper::map));
		mapper->setMapping(label, terrainName);
		layout->addSpacerItem(new QSpacerItem(BTech::LITTLE_SPACER_SIZE, BTech::SMALL_SPACER_SIZE));
		layout->addWidget(label);
	}
	setLayout(layout);
	connect(mapper, static_cast<void (QSignalMapper::*)(const QString &)>(&QSignalMapper::mapped), this, &TerrainManager::onTerrainChosen);
}
Esempio n. 29
0
FancyTabBar::FancyTabBar(QWidget *parent)
    : QWidget(parent)
{
    setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
    setStyle(new QWindowsStyle);
    setMinimumWidth(qMax(2 * m_rounding, 40));
    setAttribute(Qt::WA_Hover, true);
    setFocusPolicy(Qt::NoFocus);
    setMouseTracking(true); // Needed for hover events
    m_triggerTimer.setSingleShot(true);

    QVBoxLayout* layout = new QVBoxLayout;
    layout->addSpacerItem(new QSpacerItem(0, 0, QSizePolicy::Fixed, QSizePolicy::Expanding));
    layout->setSpacing(0);
    layout->setContentsMargins(0, 0, 0, 0);
    setLayout(layout);

    // We use a zerotimer to keep the sidebar responsive
    connect(&m_triggerTimer, SIGNAL(timeout()), this, SLOT(emitCurrentIndex()));
}
Esempio n. 30
0
QWidget *CodePasterSettingsPage::createPage(QWidget *parent)
{
    QWidget *outerWidget = new QWidget(parent);
    QVBoxLayout *outerLayout = new QVBoxLayout(outerWidget);

    QFormLayout *formLayout = new QFormLayout;
    formLayout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
    QLineEdit *lineEdit = new QLineEdit(m_host);
    connect(lineEdit, SIGNAL(textChanged(QString)), this, SLOT(serverChanged(QString)));
    formLayout->addRow(tr("Server:"), lineEdit);
    outerLayout->addLayout(formLayout);
    outerLayout->addSpacerItem(new QSpacerItem(0, 30, QSizePolicy::Ignored, QSizePolicy::Fixed));

    QLabel *noteLabel = new QLabel(tr("Note: Specify the host name for the CodePaster service "
                                      "without any protocol prepended (e.g. codepaster.mycompany.com)."));
    noteLabel->setWordWrap(true);
    outerLayout->addWidget(noteLabel);

    outerLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Ignored, QSizePolicy::MinimumExpanding));
    return outerWidget;
}