InfoComplexDescriptionTab::InfoComplexDescriptionTab(QWidget *parent)
{
    descriptionEdit = new QPlainTextEdit;

    QHBoxLayout *descriptionLayout = new QHBoxLayout;
    descriptionLayout->addWidget(descriptionEdit);

    QGroupBox *descriptionBox = new QGroupBox;
    descriptionBox->setTitle(tr("Общая характеристика и состав"));
    descriptionBox->setLayout(descriptionLayout);


    conclusionEdit = new QPlainTextEdit;
    QHBoxLayout *conclusionLayout = new QHBoxLayout;
    conclusionLayout->addWidget(conclusionEdit);

    QGroupBox *conclusionBox = new QGroupBox;
    conclusionBox->setTitle(tr("Основные выводы"));
    conclusionBox->setLayout(conclusionLayout);


    QVBoxLayout *mainLayout = new QVBoxLayout;
    mainLayout->addWidget(descriptionBox);
    mainLayout->addWidget(conclusionBox);

    setLayout(mainLayout);
}
CdbPathsPageWidget::CdbPathsPageWidget(QWidget *parent) :
    QWidget(parent)
{
    QVBoxLayout *layout = new QVBoxLayout(this);

    QString title = tr("Symbol Paths");
    QGroupBox* gbSymbolPath = new QGroupBox(this);
    gbSymbolPath->setTitle(title);
    QVBoxLayout *gbSymbolPathLayout = new QVBoxLayout(gbSymbolPath);
    m_symbolPathListEditor = new CdbSymbolPathListEditor(gbSymbolPath);
    gbSymbolPathLayout->addWidget(m_symbolPathListEditor);

    title = tr("Source Paths");
    QGroupBox* gbSourcePath = new QGroupBox(this);
    gbSourcePath->setTitle(title);
    QVBoxLayout *gbSourcePathLayout = new QVBoxLayout(gbSourcePath);
    m_sourcePathListEditor = new Utils::PathListEditor(gbSourcePath);
    gbSourcePathLayout->addWidget(m_sourcePathListEditor);

    layout->addWidget(gbSymbolPath);
    layout->addWidget(gbSourcePath);

    DebuggerCore *dc = debuggerCore();
    group.insert(dc->action(CdbSymbolPaths), m_symbolPathListEditor);
    group.insert(dc->action(CdbSourcePaths), m_sourcePathListEditor);
}
示例#3
0
XMLEditCodeSelectionDialog::XMLEditCodeSelectionDialog(QWidget *parent) :
    QDialog(parent)
{
    QVBoxLayout *topLayout = new QVBoxLayout(this);
    
    QHBoxLayout *hLayout = new QHBoxLayout();
    hLayout->setSpacing(10);

    //
    // Attributes
    //
    QGroupBox *attGroup = new QGroupBox(this);
    attGroup->setTitle(tr("Attributes"));
    QVBoxLayout *attLayout = new QVBoxLayout(attGroup);
    attLayout->setMargin(10);
    attLayout->setSpacing(5);
    buttons[ID_XML2ATTS] = new QCheckBox(tr("C++"), attGroup);
    attLayout->addWidget(buttons[ID_XML2ATTS]);
    buttons[ID_XML2JAVA] = new QCheckBox(tr("Java"), attGroup);
    attLayout->addWidget(buttons[ID_XML2JAVA]);
    buttons[ID_XML2PYTHON] = new QCheckBox(tr("Python"), attGroup);
    attLayout->addWidget(buttons[ID_XML2PYTHON]);
    hLayout->addWidget(attGroup);

    //
    // Plugin
    //
    QGroupBox *pluginGroup = new QGroupBox(this);
    pluginGroup->setTitle(tr("Plugin"));
    QVBoxLayout *pluginLayout = new QVBoxLayout(pluginGroup);
    pluginLayout->setMargin(10);
    pluginLayout->setSpacing(5);
    buttons[ID_XML2WINDOW] = new QCheckBox(tr("Window"), pluginGroup);
    pluginLayout->addWidget(buttons[ID_XML2WINDOW]);
    buttons[ID_XML2CMAKE] = new QCheckBox(tr("CMake"), pluginGroup);
    pluginLayout->addWidget(buttons[ID_XML2CMAKE]);
    buttons[ID_XML2INFO] = new QCheckBox(tr("Plugin information"), pluginGroup);
    pluginLayout->addWidget(buttons[ID_XML2INFO]);
    buttons[ID_XML2AVT] = new QCheckBox(tr("AVT code skeleton"), pluginGroup);
    pluginLayout->addWidget(buttons[ID_XML2AVT]);
    hLayout->addWidget(pluginGroup);

    topLayout->addLayout(hLayout);
    
    // Add some buttons
    QHBoxLayout *bLayout = new QHBoxLayout();
    bLayout->setSpacing(5);
    bLayout->addStretch(10);
    QPushButton *okay = new QPushButton(tr("Ok"), this);
    QPushButton *cancel = new QPushButton(tr("Cancel"), this);
    bLayout->addWidget(cancel);
    bLayout->addWidget(okay);
// 
    topLayout->addLayout(bLayout);
    
    connect(okay, SIGNAL(clicked()), this, SLOT(accept()));
    connect(cancel, SIGNAL(clicked()), this, SLOT(reject()));
}
KCMKTECollaborative::KCMKTECollaborative(QWidget* parent, const QVariantList& args)
    : KCModule(KteCollaborativePluginFactory::componentData(), parent, args)
{
    kDebug() << "creating kte_collaborative kcmodule";
    // Set up config groups
    KConfig* config = new KConfig("ktecollaborative");
    m_colorsGroup = config->group("colors");
    m_notifyGroup = config->group("notifications");
    m_applicationsGroup = config->group("applications");

    // Create notifications group box
    QGroupBox* notificationsGroupBox = new QGroupBox();
    notificationsGroupBox->setTitle(i18n("Highlights and Notifications"));
    QVBoxLayout* notificationsLayout = new QVBoxLayout();
    notificationsGroupBox->setLayout(notificationsLayout);
    m_highlightBackground = new QCheckBox(i18n("Display popup widgets"));
    m_displayWidgets = new QCheckBox(i18n("Colorize text background"));
    m_displayTextHints = new QCheckBox(i18n("Display text tooltips"));
    notificationsLayout->addWidget(m_displayWidgets);
    notificationsLayout->addWidget(m_highlightBackground);
    notificationsLayout->addWidget(m_displayTextHints);

    // Create colors group box
    QGroupBox* colorsGroupBox = new QGroupBox();
    colorsGroupBox->setTitle(i18n("Colors"));
    QFormLayout* colorsLayout = new QFormLayout();
    colorsGroupBox->setLayout(colorsLayout);
    m_saturationSilder = new QSlider(Qt::Horizontal);
    m_saturationSilder->setRange(30, 255);
    colorsLayout->addRow(i18n("Highlight saturation"), m_saturationSilder);

    // Create default application group box
    QGroupBox* defaultApplicationBox = new QGroupBox();
    defaultApplicationBox->setTitle(i18n("Default application"));
    defaultApplicationBox->setLayout(new QHBoxLayout);
    m_selectEditorWidget = new SelectEditorWidget(m_applicationsGroup.readEntry("editor"));
    defaultApplicationBox->layout()->addWidget(m_selectEditorWidget);

    // Assemble the UI
    setLayout(new QVBoxLayout());
    KMessageWidget* message = new KMessageWidget(i18n("Some changes might only be applied for newly opened documents."));
    message->setMessageType(KMessageWidget::Information);
    message->setCloseButtonVisible(false);
    layout()->addWidget(message);
    layout()->addWidget(notificationsGroupBox);
    layout()->addWidget(colorsGroupBox);
    layout()->addWidget(defaultApplicationBox);
    // Add a spacer to top-align the widgets
    layout()->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Expanding));

    // Set up connections for changed signals
    connect(m_saturationSilder, SIGNAL(sliderMoved(int)), SLOT(changed()));
    connect(m_highlightBackground, SIGNAL(toggled(bool)), SLOT(changed()));
    connect(m_displayWidgets, SIGNAL(toggled(bool)), SLOT(changed()));
    connect(m_displayTextHints, SIGNAL(toggled(bool)), SLOT(changed()));
    connect(m_selectEditorWidget, SIGNAL(selectionChanged()), SLOT(changed()));
}
示例#5
0
SQLiteServerPrefs::SQLiteServerPrefs( QWidget *parent ) : QWidget( parent )
{
	QVBoxLayout * Form1Layout = new QVBoxLayout( this );

	KHBox *hbox = new KHBox( this );
	( void ) new QLabel( i18n( "Database file:" ), hbox );

	Form1Layout->addWidget( hbox );

	QSpacerItem* spacerRow5 = new QSpacerItem( 10, 10, QSizePolicy::Minimum, QSizePolicy::MinimumExpanding );
	Form1Layout->addItem( spacerRow5 );

	QString sqliteBinary = "sqlite3";

	// Backup options
	QGroupBox *backupGBox = new QGroupBox( this );
	backupGBox->setTitle( i18nc( "@title:group Backup options", "Backup" ) );
	
	QFormLayout *backupGBoxLayout = new QFormLayout;
	backupGBox->setLayout( backupGBoxLayout );

	dumpPathRequester = new KUrlRequester;
	dumpPathRequester->fileDialog()->setCaption( i18n( "Select SQLite command" ) );
	backupGBoxLayout->addRow( i18n( "Path to '%1':", sqliteBinary ), dumpPathRequester );
	
	Form1Layout->addWidget( backupGBox );

	// SQLite converter options
	QGroupBox *converterGBox = new QGroupBox( this );
	converterGBox->setTitle( i18n( "SQLite converter" ) );

	QFormLayout *converterGBoxLayout = new QFormLayout;
	converterGBox->setLayout( converterGBoxLayout );

	oldPathRequester = new KUrlRequester;
	oldPathRequester->fileDialog()->setCaption( i18n( "Select old SQLite version command" ) );
	converterGBoxLayout->addRow( i18n( "Path to SQLite old version command:" ), oldPathRequester );
	
	newPathRequester = new KUrlRequester;
	newPathRequester->fileDialog()->setCaption( i18n( "Select new SQLite version command" ) );
	converterGBoxLayout->addRow( i18n( "Path to SQLite new version command:" ), newPathRequester );
	
	Form1Layout->addWidget( converterGBox );


	// Load Current Settings
	KConfigGroup config = KGlobal::config()->group( "Server" );
	fileRequester = new KUrlRequester( config.readEntry( "DBFile", KStandardDirs::locateLocal( "appdata", "krecipes.krecdb" ) ), hbox );
	fileRequester->fileDialog()->setCaption( i18n( "Select SQLite database file" ) );
	hbox->setStretchFactor( fileRequester, 2 );
	dumpPathRequester->setUrl( config.readEntry( "SQLitePath", sqliteBinary ) );
	dumpPathRequester->setFilter( sqliteBinary + "\n*|" + i18n( "All files" ) );
	oldPathRequester->setUrl( config.readEntry( "SQLiteOldVersionPath", "sqlite" ) );
	oldPathRequester->setFilter( "sqlite\n*|" + i18n( "All files" ) );
	newPathRequester->setUrl( config.readEntry( "SQLiteNewVersionPath", "sqlite3" ) );
	newPathRequester->setFilter( "sqlite3\n*|" + i18n( "All files" ) );
}
示例#6
0
void
QvisTubeWindow::CreateWindowContents()
{
    QGridLayout *mainLayout = new QGridLayout(0);
    topLayout->addLayout(mainLayout);

    QGroupBox *radiusGroup = new QGroupBox(central);
    radiusGroup->setTitle(tr("Tube radius"));
    mainLayout->addWidget(radiusGroup);
    QGridLayout *radiusLayout = new QGridLayout(radiusGroup);

    scaleByVarFlag = new QCheckBox(tr("Scale width by variable?  (Nodal variables work best)"), central);
    connect(scaleByVarFlag, SIGNAL(toggled(bool)),
            this, SLOT(scaleByVarFlagChanged(bool)));
    radiusLayout->addWidget(scaleByVarFlag, 0,0, 1, 3);

    scaleVariableLabel = new QLabel(tr("Variable"), central);
    radiusLayout->addWidget(scaleVariableLabel,1,0);
    int scaleVariableMask = QvisVariableButton::Scalars;
    scaleVariable = new QvisVariableButton(true, true, true, scaleVariableMask, central);
    connect(scaleVariable, SIGNAL(activated(const QString&)),
            this, SLOT(scaleVariableChanged(const QString&)));
    radiusLayout->addWidget(scaleVariable, 1,1, 1, 2);

    radiusLabel = new QLabel(tr("Radius"), central);
    radiusLayout->addWidget(radiusLabel,2,0);
    radius = new QLineEdit(central);
    connect(radius, SIGNAL(returnPressed()),
            this, SLOT(radiusProcessText()));
    radiusLayout->addWidget(radius, 2,1);

    radiusType = new QComboBox(radiusGroup);
    radiusType->addItem("Fraction of Bounding Box");
    radiusType->addItem("Absolute");
    connect(radiusType, SIGNAL(activated(int)),
            this, SLOT(radiusTypeChanged(int)));
    radiusLayout->addWidget(radiusType, 2,2);

    QGroupBox *formGroup = new QGroupBox(central);
    formGroup->setTitle(tr("Tube form"));
    mainLayout->addWidget(formGroup);
    QGridLayout *formLayout = new QGridLayout(formGroup);

    finenessLabel = new QLabel(tr("Fineness of tube"), central);
    formLayout->addWidget(finenessLabel,0,0);
    fineness = new QLineEdit(central);
    connect(fineness, SIGNAL(returnPressed()),
            this, SLOT(finenessProcessText()));
    formLayout->addWidget(fineness, 0,1);

    capping = new QCheckBox(tr("Cap ends of the tubes"), central);
    connect(capping, SIGNAL(toggled(bool)),
            this, SLOT(cappingChanged(bool)));
    formLayout->addWidget(capping, 1,0);
}
示例#7
0
GNumericalExpressionSettingsWidget::GNumericalExpressionSettingsWidget( GNumericalExpression* numericalExpression, QObject* parent /*= NULL*/)	
{
	m_NumericalExpression = numericalExpression;

	QGroupBox* pExpressionSettings = new QGroupBox;
	QBoxLayout* pExpressionSettingsLayout = new QVBoxLayout;
	QBoxLayout* pExpressionEditLayout = new QHBoxLayout;
	pExpressionSettings->setFixedWidth(400);
	pExpressionSettings->setTitle("Expression Settings");
	pExpressionSettings->setLayout(pExpressionSettingsLayout);
	pExpressionEditLayout->insertWidget(0, new QLabel("Expression:"), 0);
	pExpressionEditLayout->insertWidget(1, m_NumericalExpression->m_Expression.ProvideNewParamLineEdit(pExpressionSettings), 0);
	pExpressionSettingsLayout->insertLayout(0, pExpressionEditLayout);

	QGroupBox* pVariableSettings = new QGroupBox;
	QGroupBox* pShowVariables = new QGroupBox;
	QBoxLayout* pShowVariablesLayout = new QVBoxLayout;
	QBoxLayout* pVariableSettingsLayout = new QVBoxLayout;
	QRadioButton* pLayoutVariablesVertically = new QRadioButton;
	QRadioButton* pLayoutVariablesHorizontally = new QRadioButton;
	QRadioButton* pLayoutVariablesGrid = new QRadioButton;
	pVariableSettings->setFixedWidth(400);
	pVariableSettings->setTitle("Variable Settings");
	pVariableSettings->setLayout(pVariableSettingsLayout);
	pShowVariables->setTitle("Show Variables");
	pShowVariables->setCheckable(true);
	pShowVariables->setLayout(pShowVariablesLayout);
	pLayoutVariablesHorizontally->setText("Layout: Horizontal");
	pShowVariablesLayout->insertWidget(0, pLayoutVariablesHorizontally);
	pLayoutVariablesVertically->setText("Layout: Vertical");
	pShowVariablesLayout->insertWidget(1, pLayoutVariablesVertically);
	pLayoutVariablesGrid->setText("Layout: Grid");
	pShowVariablesLayout->insertWidget(2, pLayoutVariablesGrid);
	pVariableSettingsLayout->insertWidget(0, pShowVariables);
	
	QPushButton* pAcceptButton = new QPushButton;
	QPushButton* pCloseButton = new QPushButton;
	QBoxLayout* pButtonLayout = new QHBoxLayout;
	pAcceptButton->setText("Accept");
	connect(pAcceptButton, SIGNAL(clicked(bool)), this, SLOT(Accept()));
	pCloseButton->setText("Close");
	connect(pCloseButton, SIGNAL(clicked(bool)), this, SLOT(close()));
	pButtonLayout->insertWidget(0, pAcceptButton, 1);
	pButtonLayout->insertWidget(1, pCloseButton, 1);

	QBoxLayout* pMainLayout = new QVBoxLayout;
	pMainLayout->setSizeConstraint(QLayout::SetFixedSize);
	setLayout(pMainLayout);
	pMainLayout->insertWidget(0, pExpressionSettings, 1);
	pMainLayout->insertWidget(1, pVariableSettings, 1);
	pMainLayout->insertLayout(2, pButtonLayout, 0);
}
BioXASCarbonFilterFarmView::BioXASCarbonFilterFarmView(BioXASCarbonFilterFarm *control, QWidget *parent) :
	QWidget(parent)
{
	// Initialize class variables.

	filterFarm_ = 0;

	// Create UI elements.

	filterEditor_ = new CLSControlEditor(0);
	filterEditor_->setTitle("Effective filter");

	upstreamActuatorView_ = new BioXASCarbonFilterFarmActuatorView(0);

	downstreamActuatorView_ = new BioXASCarbonFilterFarmActuatorView(0);

	// Create and set layouts.

	QVBoxLayout *upstreamLayout = new QVBoxLayout();
	upstreamLayout->setMargin(0);
	upstreamLayout->addWidget(upstreamActuatorView_);

	QGroupBox *upstreamBox = new QGroupBox();
	upstreamBox->setTitle("Upstream Actuator");
	upstreamBox->setFlat(true);
	upstreamBox->setLayout(upstreamLayout);

	QVBoxLayout *downstreamLayout = new QVBoxLayout();
	downstreamLayout->setMargin(0);
	downstreamLayout->addWidget(downstreamActuatorView_);

	QGroupBox *downstreamBox = new QGroupBox();
	downstreamBox->setTitle("Downstream Actuator");
	downstreamBox->setFlat(true);
	downstreamBox->setLayout(downstreamLayout);

	QHBoxLayout *actuatorsLayout = new QHBoxLayout();
	actuatorsLayout->addWidget(upstreamBox);
	actuatorsLayout->addWidget(downstreamBox);

	QVBoxLayout *layout = new QVBoxLayout();
	layout->setMargin(0);
	layout->addWidget(filterEditor_);
	layout->addLayout(actuatorsLayout);

	setLayout(layout);

	// Current settings.

	setControl(control);
	refresh();
}
示例#9
0
void DiffPage::addFormatTab()
{
	QWidget* page   = new QWidget( this );
	QVBoxLayout* layout = new QVBoxLayout( page );
	layout->setSpacing( KDialog::spacingHint() );
	layout->setMargin( KDialog::marginHint() );

	// add diff modes
	m_modeButtonGroup = new QButtonGroup( page );
        QGroupBox *box = new QGroupBox( page );
	box->setWhatsThis( i18n( "Select the format of the output generated by diff. Unified is the one that is used most frequently because it is very readable. The KDE developers like this format the best so use it for sending patches." ) );
	layout->addWidget( box );
	QVBoxLayout* bgLayout = new QVBoxLayout( box );
	box->setTitle( i18n( "Output Format" ) );
	//m_modeButtonGroup->setMargin( KDialog::marginHint() );

        QRadioButton *radioButton = new QRadioButton( i18n( "Context" ), box );
        m_modeButtonGroup->addButton( radioButton, Kompare::Context);
	bgLayout->addWidget( radioButton );
        radioButton = new QRadioButton( i18n( "Normal" ),  box );
        m_modeButtonGroup->addButton( radioButton, Kompare::Normal);
        bgLayout->addWidget( radioButton );
        radioButton =  new QRadioButton( i18n( "Unified" ), box );
        m_modeButtonGroup->addButton( radioButton, Kompare::Unified);
        bgLayout->addWidget( radioButton );

	// #lines of context (loc)
	QGroupBox* groupBox = new QGroupBox( page );
        QHBoxLayout *groupLayout = new QHBoxLayout;
        groupBox->setLayout( groupLayout );
	layout->addWidget( groupBox );
	groupBox->setTitle( i18n( "Lines of Context" ) );
	groupBox->setWhatsThis( i18n( "The number of context lines is normally 2 or 3. This makes the diff readable and applicable in most cases. More than 3 lines will only bloat the diff unnecessarily." ) );
	//groupBox->setMargin( KDialog::marginHint() );

	QLabel* label = new QLabel( i18n( "Number of context lines:" ));
        groupLayout->addWidget( label );
	label->setWhatsThis( i18n( "The number of context lines is normally 2 or 3. This makes the diff readable and applicable in most cases. More than 3 lines will only bloat the diff unnecessarily." ) );
	m_locSpinBox = new QSpinBox( groupBox );
	m_locSpinBox->setRange( 0, 100 );
	groupLayout->addWidget( m_locSpinBox );
	m_locSpinBox->setWhatsThis( i18n( "The number of context lines is normally 2 or 3. This makes the diff readable and applicable in most cases. More than 3 lines will only bloat the diff unnecessarily." ) );
	label->setBuddy( m_locSpinBox );

	layout->addStretch( 1 );
	page->setMinimumSize( sizeHintForWidget( page ) );

	m_tabWidget->addTab( page, i18n( "Format" ) );
}
示例#10
0
LifeFormWidget::LifeFormWidget(QWidget *parent) :
    QWidget(parent)
{
    QVBoxLayout * layout = new QVBoxLayout;
    QGroupBox * groupBox = new QGroupBox;
    mAgeSpinBox = new QSpinBox;
    mNameEdit = new QLineEdit;
    mXSpinBox = new QSpinBox;
    mYSpinBox = new QSpinBox;

    setWindowIcon(QIcon(":rabbit"));
    groupBox->setTitle("Properties");

    mNameEdit->setPlaceholderText("Name");
    mAgeSpinBox->setPrefix("age: ");
    mXSpinBox->setPrefix("x: ");
    mYSpinBox->setPrefix("y: ");

    mGenomView = new GenomView;
    QWidget * coordWidget = new QWidget;
    coordWidget->setLayout(new QHBoxLayout);
    coordWidget->layout()->setMargin(0);
    coordWidget->layout()->addWidget(mXSpinBox);
    coordWidget->layout()->addWidget(mYSpinBox);

    layout->addWidget( mNameEdit);
    layout->addWidget( mAgeSpinBox);
    layout->addWidget( coordWidget);

    groupBox->setLayout(layout);
    groupBox->layout()->setContentsMargins(0,10,0,0);

    QGroupBox * genomGroupBox = new QGroupBox;
    genomGroupBox->setTitle("Genom");
    genomGroupBox->setLayout(new QVBoxLayout);
    genomGroupBox->layout()->addWidget(mGenomView);
    genomGroupBox->layout()->setMargin(0);


    QVBoxLayout * mainLayout = new QVBoxLayout;
    mainLayout->setSpacing(10);
    mainLayout->addWidget(groupBox);
    mainLayout->addWidget(genomGroupBox);
    mainLayout->setContentsMargins(0,0,0,0);

    setLayout(mainLayout);


}
示例#11
0
/*
 * displays the score in the score layout
 */
void InterfaceHandler::setScore(int terrB, int capB, int terrW, int capW, float komi)
{
	GameData * gd = boardwindow->getGameData();
	bool simple = gd->white_rank.length() == 0 && gd->black_rank.length() == 0;
	QGroupBox *gb = boardwindow->getUi()->whiteFrame_score;

	QString player = gd->white_name;
	if (simple && player == QObject::tr("White"))
		gb->setTitle(QObject::tr("White"));	
	else
	{
		// truncate to 13 characters max
		player.truncate(13);

		if (gd->white_rank.length() != 0)
			player = QObject::tr("W") + ": " + player + " " + gd->white_rank;
		else
			player = QObject::tr("W") + ": " + player;
		
		gb->setTitle(player);
	}

	gb = boardwindow->getUi()->blackFrame_score;

	player = gd->black_name;
	if (simple && player == QObject::tr("Black"))
		gb->setTitle(QObject::tr("Black"));	
	else
	{
		// truncate to 13 characters max
		player.truncate(13);

		if (gd->black_rank.length() != 0)
			player = QObject::tr("B") + ": " + player + " " + gd->black_rank;
		else
			player = QObject::tr("B") + ": " + player;
		
		gb->setTitle(player);
	}

	boardwindow->getUi()->komiScore->setText(QString::number(komi));
	boardwindow->getUi()->terrWhite->setText(QString::number(terrW));
	boardwindow->getUi()->capturesWhiteScore->setText(QString::number(capW));
	boardwindow->getUi()->totalWhite->setText(QString::number((float)terrW + (float)capW + komi));
	boardwindow->getUi()->terrBlack->setText(QString::number(terrB));
	boardwindow->getUi()->capturesBlackScore->setText(QString::number(capB));
	boardwindow->getUi()->totalBlack->setText(QString::number(terrB + capB));
}
示例#12
0
void MultiLocalPathWidget::createMultiLocalPathList_obj() 
{
	QGroupBox* groupBox = new QGroupBox();
	groupBox->setTitle("Groups");
	
	QVBoxLayout* groupLayout = new QVBoxLayout(groupBox);
	groupLayout->setSpacing(6);
	groupLayout->setContentsMargins(11, 11, 11, 11);
	
	for(int i=0; i<m_currentRobot->mlp->nblpGp; i++) 
	{
		m_MLP_CheckBoxes.push_back( new QCheckBox(groupBox) );
		m_MLP_CheckBoxes.back()->setText( m_currentRobot->mlp->mlpJoints[i]->gpName );
		groupLayout->addWidget( m_MLP_CheckBoxes.back() );
    
		m_MLP_Validator.push_back( new GroupValidator( 0, m_currentRobot, i ) );
		
		if( p3d_multiLocalPath_get_value_groupToPlan( m_currentRobot, i) == 1) 
			m_MLP_CheckBoxes.back()->setChecked(true);
		else 
			m_MLP_CheckBoxes.back()->setChecked(false);

		connect(	m_MLP_CheckBoxes.back() , SIGNAL(toggled(bool)), 
							m_MLP_Validator.back() ,	SLOT(multiLocalPathList_obj(bool)) );
	}
	
	m_verticalLayout->addWidget( groupBox );
}
示例#13
0
CreatePropertyDialog::CreatePropertyDialog( QWidget *parent, UnitList* list )
		: KDialog( parent )
{
	setCaption( i18nc( "@title:window", "New Property" ) );
	setButtons(KDialog::Ok | KDialog::Cancel);
	setDefaultButton( KDialog::Ok);
	setModal( true );
	// Initialize Internal Variables
	unitList = list; // Store the pointer to the unitList;

	// Initialize widgets
	QGroupBox * box = new QGroupBox;
	setMainWidget( box );
	QFormLayout * layout = new QFormLayout;
	box->setLayout( layout );
	box->setTitle( i18nc( "@title:group", "New Property" ) );

	propertyNameEdit = new KLineEdit( box );
	propertyNameEdit->setMinimumWidth( 150 );
	layout->addRow( i18nc( "@label:textbox", "Property name:" ), propertyNameEdit );

	propertyUnits = new KLineEdit( box );
	propertyUnits->setMinimumWidth( 150 );
	layout->addRow( i18nc( "@label:textbox", "Units:" ), propertyUnits );

	adjustSize();
	resize( 400, size().height() );
	setFixedHeight( size().height() );

	propertyNameEdit->setFocus();
}
示例#14
0
void MeshLayerEditDialog::createMeshToolSelection()
{
	QGroupBox* meshToolSelectionBox (new QGroupBox(this));
	meshToolSelectionBox->setTitle("Output element type");
	QGridLayout* meshToolSelectionLayout (new QGridLayout(meshToolSelectionBox));
	_ogsMeshButton = new QRadioButton("Prisms", meshToolSelectionBox);
	QRadioButton* tetgenMeshButton = new QRadioButton("Tetrahedra", meshToolSelectionBox);
	tetgenMeshButton->setFixedWidth(150);
	QLabel* minThicknessLabel = new QLabel(meshToolSelectionBox);
	minThicknessLabel->setText("Minimum thickness of layers:");
	_minThicknessEdit = new QLineEdit(meshToolSelectionBox);
	_minThicknessEdit->setText("1.0");
	QDoubleValidator* min_thickness_validator = new QDoubleValidator(0, 1000000, 15, _minThicknessEdit);
	_minThicknessEdit->setValidator(min_thickness_validator);
	_minThicknessEdit->setMaximumWidth(100);
	_minThicknessEdit->setFixedWidth(100);
	meshToolSelectionLayout->addWidget(_ogsMeshButton, 0, 0);
	meshToolSelectionLayout->addWidget(tetgenMeshButton, 0, 1);
	meshToolSelectionLayout->addWidget(minThicknessLabel, 1, 0);
	meshToolSelectionLayout->addWidget(_minThicknessEdit, 1, 1);
	meshToolSelectionBox->setLayout(meshToolSelectionLayout);
	_ogsMeshButton->setChecked(true);

	gridLayoutLayerMapping->addWidget(meshToolSelectionBox, 5, 0, 1, 3);
}
示例#15
0
void TilesetGroupEditor::redrawAll()
{
    util::memclear(ui->tilesetList);
    //QGroupBox* preview = ui->PreviewBox;
    util::clearLayoutItems(layout);
    for(int i = 0; i < tilesets.size(); ++i)
    {
        QListWidgetItem *xxx = new QListWidgetItem;
        xxx->setText(tilesets[i].first);
        xxx->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable);
        ui->tilesetList->addItem(xxx);

        QGroupBox *f = new QGroupBox;
        QGridLayout *l = new QGridLayout();
        l->setContentsMargins(4, 4, 4, 4);
        l->setSpacing(2);
        f->setLayout(l);
        f->setTitle(tilesets[i].second.tileSetName);
        SimpleTileset *items = &tilesets[i].second;
        for(int j = 0; j < items->items.size(); ++j)
        {
            SimpleTilesetItem *item = &items->items[j];
            TilesetItemButton *ib = new TilesetItemButton(m_configs, scn);
            ib->applySize(32, 32);
            ib->applyItem(items->type, item->id);
            l->addWidget(ib, item->row, item->col);
        }
        DevConsole::log(QString("Current GridLayout Items: %1").arg(l->count()), QString("Tileset"));
        layout->addWidget(f);
        DevConsole::log(QString("Current FlowLayout Items: %1").arg(layout->count()), QString("Tileset"));
    }
}
示例#16
0
void AboutDialog::addContact(const QString &contact, const QString &email, const QString &web)
{
  QGroupBox *gb = new QGroupBox;
  QGridLayout *grid = new QGridLayout;
  int y = 0;
  QLabel *lab;

  grid->setColumnStretch(1, 1);

  if (!contact.isEmpty()) {
    grid->addWidget(new QLabel("Contact:"), y, 0, Qt::AlignLeft|Qt::AlignTop);
    grid->addWidget(new QLabel(contact), y, 1, Qt::AlignLeft|Qt::AlignTop);
    ++y;
  }
  if (!email.isEmpty()) {
    grid->addWidget(new QLabel("E-Mail:"), y, 0, Qt::AlignLeft|Qt::AlignTop);
    grid->addWidget(new QLabel("<a href=\"" + email + "\">" + email + "</a>"), y, 1, Qt::AlignLeft|Qt::AlignTop);
    ++y;
  }
  if (!web.isEmpty()) {
    grid->addWidget(new QLabel("Web site:"), y, 0, Qt::AlignLeft|Qt::AlignTop);
    grid->addWidget(lab = new QLabel("<a href=\"" + web
          + "\">" + web + "</a>"), y, 1, Qt::AlignLeft|Qt::AlignTop);
    lab->setOpenExternalLinks(true);
    ++y;
  }

  gb->setTitle("Contact Information");
  gb->setLayout(grid);

  appendWidget(gb);
}
示例#17
0
文件: sis3350ui.cpp 项目: mojca/gecko
void Sis3350UI::createUI()
{
    QGridLayout* l = new QGridLayout;
    QGridLayout* boxL = new QGridLayout;

    QGroupBox* box = new QGroupBox;
    box->setTitle(name + " Settings");

    // Module specific code here

    QWidget* buttons = createButtons();
    QWidget* tabs = createTabs();

    boxL->addWidget(buttons,0,0,1,1);
    boxL->addWidget(tabs,1,0,1,1);

    viewport = new Viewport(0,module->rblt_data,4,module->conf.sample_length);
    viewport->setWindowTitle(tr("sis3350 Preview"));

    // End

    l->addWidget(box,0,0,1,1);
    box->setLayout(boxL);
    this->setLayout(l);
}
示例#18
0
QWidget*
GUIBuilder::addElementGroup(model::gui::ElementGroup *root, QWidget *parent)
{
    QGroupBox* widget = new QGroupBox( parent );
    //widget->setFlat( true );

    const std::string key = root->key();
    if( root->showLabel() && !root->key().empty() ) {
        widget->setTitle( (prettyName( root->key(), m_model ) ).c_str() );
    }

    model::gui::Element* child = root->child();
    if( child != NULL ) {
        if( child->type() == model::gui::GRID ) {
            doGridLayout( static_cast<model::gui::Grid*>( child ), widget );
        }
        else if( child->type() == model::gui::HORIZONTAL_LAYOUT ) {
            doHorizontalLayout( static_cast<model::gui::HorizontalLayout*>( child ), widget );
        }
        else if( child->type() == model::gui::VERTICAL_LAYOUT ) {
            doVerticalLayout( static_cast<model::gui::VerticalLayout*>( child ), widget );
        }
        else {
            QHBoxLayout* layout = new QHBoxLayout( widget );
            widget->setLayout( layout );
            addChildren( static_cast<model::gui::Container0D<model::gui::Element>*>( root ),
                         widget,
                         layout );
        }
    }
    return widget;
}
void TemplateOptionsPage::load(const SourceFileTemplate& fileTemplate, TemplateRenderer* renderer)
{
    d->entries.clear();

    QLayout* layout = new QVBoxLayout();
    QHash<QString, QList<SourceFileTemplate::ConfigOption> > options = fileTemplate.customOptions(renderer);
    QHash<QString, QList<SourceFileTemplate::ConfigOption> >::const_iterator it;

    for (it = options.constBegin(); it != options.constEnd(); ++it)
    {
        QGroupBox* box = new QGroupBox(this);
        box->setTitle(it.key());

        QFormLayout* formLayout = new QFormLayout;

        d->entries << it.value();
        foreach (const SourceFileTemplate::ConfigOption& entry, it.value())
        {
            QLabel* label = new QLabel(entry.label, box);
            QWidget* control = 0;
            const QString type = entry.type;
            if (type == "String")
            {
                control = new KLineEdit(entry.value.toString(), box);
            }
            else if (type == "Int")
            {
                KIntNumInput* input = new KIntNumInput(entry.value.toInt(), box);
                if (!entry.minValue.isEmpty())
                {
                    input->setMinimum(entry.minValue.toInt());
                }
                if (!entry.maxValue.isEmpty())
                {
                    input->setMaximum(entry.maxValue.toInt());
                }
                control = input;
            }
            else if (type == "Bool")
            {
                bool checked = (QString::compare(entry.value.toString(), "true", Qt::CaseInsensitive) == 0);
                QCheckBox* checkBox = new QCheckBox(entry.label, box);
                checkBox->setCheckState(checked ? Qt::Checked : Qt::Unchecked);
            }
            else
            {
                kDebug() << "Unrecognized option type" << entry.type;
            }
            if (control)
            {
                formLayout->addRow(label, control);
                d->controls.insert(entry.name, control);
            }
        }

        box->setLayout(formLayout);
        layout->addWidget(box);
    }
    setLayout(layout);
}
/*protected*/ void ReporterItemPanel::makeDndIconPanel(QHash<QString, NamedIcon*>* /*iconMap*/, QString /*displayKey*/)
{
 if (_update)
 {
  return;
 }
 _reporter = new ReporterIcon(_editor);
 QGroupBox*  panel = new QGroupBox();
 QString borderName = tr("Drag to Panel");
 QString     gbStyleSheet = "QGroupBox { border: 2px solid gray; border-radius: 3px;} QGroupBox::title { /*background-color: transparent;*/  subcontrol-position: top left; /* position at the top left*/  padding:0 0px;} ";
 panel->setLayout(new QHBoxLayout);
 panel->setTitle(borderName);
 panel->setStyleSheet(gbStyleSheet);
 QWidget*  comp;
 DataFlavor* flavor;
 try {
     //comp = getDragger(flavor = new DataFlavor(Editor::POSITIONABLE_FLAVOR));
     comp = getDragger(flavor = new DataFlavor(_reporter,"ReporterIcon"));
     flavor->setMimeTypeParameter("reporter", _reporter->getName());
     comp->setToolTip(tr("Drag an icon from this panel to add it to the control panel"));
 } catch (ClassNotFoundException cnfe) {
     //cnfe.printStackTrace();
     comp = new QWidget();
 }
 comp->setLayout(new FlowLayout);
 comp->layout()->addWidget(_reporter);
 panel->layout()->addWidget(comp);
 //panel.validate();
 int width = qMax(100, panel->sizeHint().width());
 panel->setMinimumSize( QSize(width, panel->minimumSize().height()));
 panel->setToolTip(tr("Drag an icon from this panel to add it to the control panel"));
 _dragIconPanel->layout()->addWidget( panel);
 _dragIconPanel->setToolTip(tr("Drag an icon from this panel to add it to the control panel"));
}
ParameterSphere::ParameterSphere(std::tr1::shared_ptr<Object> object) : ParameterObject(object)
{
	QGroupBox * b = new QGroupBox(this);
	QGridLayout * g = new QGridLayout(b);
	b->setTitle(tr("Sphere"));
	b->setLayout(g);
	g->addWidget(new QLabel(tr("Radius:")), 0, 0);
	g->addWidget(new QLabel(tr("Slices:")), 1, 0);
	g->addWidget(new QLabel(tr("Stacks:")), 2, 0);
	lineRadius_ = new QLineEdit();
	lineSlices_ = new QLineEdit();
	lineStacks_ = new QLineEdit();
	lineRadius_->setAlignment(Qt::AlignRight);
	lineSlices_->setAlignment(Qt::AlignRight);
	lineStacks_->setAlignment(Qt::AlignRight);
	g->addWidget(lineRadius_, 0, 2, 1, 3);
	g->addWidget(lineSlices_, 1, 2, 1, 3);
	g->addWidget(lineStacks_, 2, 2, 1, 3);
	g->setRowStretch(3, 1);
	addWidget(b);

	connect(lineRadius_, SIGNAL(editingFinished()),
			this, SLOT(radiusEdited()));
	connect(lineSlices_, SIGNAL(editingFinished()),
			this, SLOT(slicesEdited()));
	connect(lineStacks_, SIGNAL(editingFinished()),
			this, SLOT(stacksEdited()));

	if (object)
	{
		reloadData();
	}
}
ParameterPatternStereogram::ParameterPatternStereogram(std::tr1::shared_ptr<AbstractTexture> texture)
	: ParameterStereogram(texture)
{
	QGroupBox * b = new QGroupBox(this);
	QGridLayout * g = new QGridLayout(b);
	b->setTitle(tr("Pattern"));
	b->setLayout(g);
	g->addWidget(new QLabel(tr("Background:")), 0, 0);
	g->addWidget(new QLabel(tr("Foreground:")), 1, 0);
	linePathBG_ = new QLineEdit();
	linePathFG_ = new QLineEdit();
	pbBG_ = new QPushButton("...");
	pbFG_ = new QPushButton("...");
	g->addWidget(linePathBG_, 0, 2, 1, 2);
	g->addWidget(linePathFG_, 1, 2, 1, 2);
	g->addWidget(pbBG_, 0, 4);
	g->addWidget(pbFG_, 1, 4);
	g->setRowStretch(2, 1);

	addWidget(b);

	connect(linePathBG_, SIGNAL(editingFinished()),
			this, SLOT(pathBGEdited()));
	connect(linePathFG_, SIGNAL(editingFinished()),
			this, SLOT(pathFGEdited()));
	connect(pbBG_, SIGNAL(clicked()),
			this, SLOT(openBG()));
	connect(pbFG_, SIGNAL(clicked()),
			this, SLOT(openFG()));

	reloadData();
}
示例#23
0
QWidget* GridConfigurationGroup::configWidget(ConfigurationGroup *cg, 
                                              QWidget* parent, 
                                              const char* widgetName)
{
    QGroupBox* widget = new QGroupBox(parent, widgetName);
    widget->setBackgroundOrigin(QWidget::WindowOrigin);

    if (!useframe)
        widget->setFrameShape(QFrame::NoFrame);

    QGridLayout *layout = NULL;

    float wmult = 0, hmult = 0;

    gContext->GetScreenSettings(wmult, hmult);

    int rows = (children.size()+columns-1) / columns;
    if (uselabel)
    {
        int space = -1;
        int margin = (int)(28 * hmult);
        if (zeroSpace)
            space = 4;
        if (zeroMargin)
            margin = 4;

        layout = new QGridLayout(widget, rows, columns, margin, space);
        // This makes weird and bad things happen in qt -mdz 2002/12/28
        //widget->setInsideMargin(20);
        widget->setTitle(getLabel());
    }
    else
    {
        int space = -1;
        int margin = (int)(10 * hmult);
        if (zeroSpace)
            space = 4;
        if (zeroMargin)
            margin = 4;

        layout = new QGridLayout(widget, rows, columns, margin, space);
    }

    for (unsigned i = 0 ; i < children.size() ; ++i)
        if (children[i]->isVisible())
        {
            QWidget *child = children[i]->configWidget(cg, widget, NULL);
            layout->addWidget(child, i / columns, i % columns);
            children[i]->setEnabled(children[i]->isEnabled());
        }

    if (cg)
    {
        connect(this, SIGNAL(changeHelpText(QString)), cg,
                SIGNAL(changeHelpText(QString)));
    }

    return widget;
}
ParameterStereogram::ParameterStereogram(std::tr1::shared_ptr<AbstractTexture> texture)
	: ParameterAbstractTexture(texture)
{
	QGroupBox * b = new QGroupBox(this);
	QGridLayout * g = new QGridLayout(b);
	b->setTitle(tr("Stereogram"));
	b->setLayout(g);
	g->addWidget(new QLabel(tr("Depth:")), 0, 0);
	g->addWidget(new QLabel(tr("Left:")), 1, 0);
	g->addWidget(new QLabel(tr("Right:")), 2, 0);
	g->addWidget(new QLabel(tr("Offset:")), 3, 0);
	linePathDepth_ = new QLineEdit();
	linePathLeft_ = new QLineEdit();
	linePathRight_ = new QLineEdit();
	pbDepth_ = new QPushButton("...");
	pbLeft_ = new QPushButton("...");
	pbRight_ = new QPushButton("...");
	pbDepth_->resize(26, 26);
	pbLeft_->resize(26, 26);
	pbRight_->resize(26, 26);
	lineOffset_ = new QLineEdit();
	lineOffset_->setAlignment(Qt::AlignRight);
	comboStyle_ = new QComboBox(this);
	comboStyle_->addItem("Convex");
	comboStyle_->addItem("Concave");
	g->addWidget(linePathDepth_, 0, 2, 1, 2);
	g->addWidget(linePathLeft_, 1, 2, 1, 2);
	g->addWidget(linePathRight_, 2, 2, 1, 2);
	g->addWidget(pbDepth_, 0, 4);
	g->addWidget(pbLeft_, 1, 4);
	g->addWidget(pbRight_, 2, 4);
	g->addWidget(lineOffset_, 3, 2, 1, 3);
	g->addWidget(comboStyle_, 4, 2, 1, 3);
	g->setRowStretch(5, 1);

	addWidget(b);

	connect(linePathDepth_, SIGNAL(editingFinished()),
			this, SLOT(pathDepthEdited()));
	connect(linePathLeft_, SIGNAL(editingFinished()),
			this, SLOT(pathLeftEdited()));
	connect(linePathRight_, SIGNAL(editingFinished()),
			this, SLOT(pathRightEdited()));
	connect(lineOffset_, SIGNAL(editingFinished()),
			this, SLOT(offsetEdited()));
	connect(comboStyle_, SIGNAL(activated(int)),
			this, SLOT(styleActivated(int)));
	connect(pbDepth_, SIGNAL(clicked()),
			this, SLOT(openDepth()));
	connect(pbLeft_, SIGNAL(clicked()),
			this, SLOT(openLeft()));
	connect(pbRight_, SIGNAL(clicked()),
			this, SLOT(openRight()));

	reloadData();
}
示例#25
0
MainWindow::MainWindow()
{
    GLWidget *glwidget = new GLWidget();
    QLabel *label = new QLabel(this);
    QTimer *timer = new QTimer(this);
    QSlider *slider = new QSlider(this);
    slider->setOrientation(Qt::Horizontal);
    
    slider->setRange(0, 100);
    slider->setSliderPosition(50);
    timer->setInterval(10);
    label->setText("A QGlWidget with OpenGl ES");
    label->setAlignment(Qt::AlignHCenter);

    QGroupBox * groupBox = new QGroupBox(this);
    setCentralWidget(groupBox);
    groupBox->setTitle("OpenGL ES Example");

    QGridLayout *layout = new QGridLayout(groupBox);

    layout->addWidget(glwidget,1,0,8,1);
    layout->addWidget(label,9,0,1,1);
    layout->addWidget(slider, 11,0,1,1);

    groupBox->setLayout(layout);

    QMenu *fileMenu = new QMenu("File");
    QMenu *helpMenu = new QMenu("Help");
    QMenu *showMenu = new QMenu("Show");
    menuBar()->addMenu(fileMenu);
    menuBar()->addMenu(showMenu);
    menuBar()->addMenu(helpMenu);
    QAction *exit = new QAction("Exit", fileMenu);
    QAction *aboutQt = new QAction("AboutQt", helpMenu);
    QAction *showLogo = new QAction("Show 3D Logo", showMenu);
    QAction *showTexture = new QAction("Show 2D Texture", showMenu);
    QAction *showBubbles = new QAction("Show bubbles", showMenu);
    showBubbles->setCheckable(true);
    showBubbles->setChecked(true);
    fileMenu->addAction(exit);
    helpMenu->addAction(aboutQt);
    showMenu->addAction(showLogo);
    showMenu->addAction(showTexture);
    showMenu->addAction(showBubbles);

    QObject::connect(timer, SIGNAL(timeout()), glwidget, SLOT(updateGL()));
    QObject::connect(exit, SIGNAL(triggered(bool)), this, SLOT(close()));
    QObject::connect(aboutQt, SIGNAL(triggered(bool)), qApp, SLOT(aboutQt()));

    QObject::connect(showLogo, SIGNAL(triggered(bool)), glwidget, SLOT(setLogo()));
    QObject::connect(showTexture, SIGNAL(triggered(bool)), glwidget, SLOT(setTexture()));
    QObject::connect(showBubbles, SIGNAL(triggered(bool)), glwidget, SLOT(showBubbles(bool)));
    QObject::connect(slider, SIGNAL(valueChanged(int)), glwidget, SLOT(setScaling(int)));
    timer->start();
}
示例#26
0
void QgsDualView::modifySort()
{
  if ( !mLayer )
    return;

  QgsAttributeTableConfig config = mConfig;

  QDialog orderByDlg;
  orderByDlg.setWindowTitle( tr( "Configure Attribute Table Sort Order" ) );
  QDialogButtonBox *dialogButtonBox = new QDialogButtonBox( QDialogButtonBox::Ok | QDialogButtonBox::Cancel );
  QGridLayout *layout = new QGridLayout();
  connect( dialogButtonBox, &QDialogButtonBox::accepted, &orderByDlg, &QDialog::accept );
  connect( dialogButtonBox, &QDialogButtonBox::rejected, &orderByDlg, &QDialog::reject );
  orderByDlg.setLayout( layout );

  QGroupBox *sortingGroupBox = new QGroupBox();
  sortingGroupBox->setTitle( tr( "Defined sort order in attribute table" ) );
  sortingGroupBox->setCheckable( true );
  sortingGroupBox->setChecked( !sortExpression().isEmpty() );
  layout->addWidget( sortingGroupBox );
  sortingGroupBox->setLayout( new QGridLayout() );

  QgsExpressionBuilderWidget *expressionBuilder = new QgsExpressionBuilderWidget();
  QgsExpressionContext context( QgsExpressionContextUtils::globalProjectLayerScopes( mLayer ) );
  expressionBuilder->setExpressionContext( context );
  expressionBuilder->setLayer( mLayer );
  expressionBuilder->loadFieldNames();
  expressionBuilder->loadRecent( QStringLiteral( "generic" ) );
  expressionBuilder->setExpressionText( sortExpression().isEmpty() ? mLayer->displayExpression() : sortExpression() );

  sortingGroupBox->layout()->addWidget( expressionBuilder );

  QCheckBox *cbxSortAscending = new QCheckBox( tr( "Sort ascending" ) );
  cbxSortAscending->setChecked( config.sortOrder() == Qt::AscendingOrder );
  sortingGroupBox->layout()->addWidget( cbxSortAscending );

  layout->addWidget( dialogButtonBox );
  if ( orderByDlg.exec() )
  {
    Qt::SortOrder sortOrder = cbxSortAscending->isChecked() ? Qt::AscendingOrder : Qt::DescendingOrder;
    if ( sortingGroupBox->isChecked() )
    {
      setSortExpression( expressionBuilder->expressionText(), sortOrder );
      config.setSortExpression( expressionBuilder->expressionText() );
      config.setSortOrder( sortOrder );
    }
    else
    {
      setSortExpression( QString(), sortOrder );
      config.setSortExpression( QString() );
    }

    setAttributeTableConfig( config );
  }
}
示例#27
0
void ConfigObjectDialog::addGroup(QLayout* parentLayout, string title, string toolTip, QLayout *groupLayout) {
    QGroupBox* group = new QGroupBox();
    group->setLayout(groupLayout);
    group->setTitle(QString().fromUtf8(title.c_str()));
    group->setToolTip(toolTip.c_str());
    if (!groupLayout->isEmpty()) {
        parentLayout->addWidget(group);
    } else {
        group->deleteLater();
    }
}
示例#28
0
QGroupBox *
ActionDialog::createGroupBox(const QString &title, bool addToLayout)
{
	QGroupBox *groupBox = new QGroupBox(m_mainWidget);
	groupBox->setTitle(title);

	if(addToLayout)
		m_mainLayout->addWidget(groupBox);

	return groupBox;
}
示例#29
0
文件: DlgLogin.cpp 项目: jamecc/Notee
void CDlgLogin::createLayout()
{
    QHBoxLayout* pMainLayout = new QHBoxLayout;
    setLayout(pMainLayout);
    QGroupBox* pGroupBox = new QGroupBox(this);
    pMainLayout->addWidget(pGroupBox);
    pGroupBox->setTitle(tr("Login"));

    // label edit
    QLabel* pLabelUserName = new QLabel(tr("User Name:"), this);
    QLabel* pLabelPassword = new QLabel(tr("Password:"******"Always login by the name"));

    // ok cancel
    m_pBtnOk = new QPushButton(this);
    m_pBtnOk->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
    QIcon icon1;
    icon1.addFile(QString::fromUtf8(":/res/login.png"));
    m_pBtnOk->setIcon(icon1);
    m_pBtnOk->setIconSize(QSize(48,48));
    m_pBtnOk->setToolTip(tr("Login"));
    m_pBtnCancel = new QPushButton(this);
    QIcon icon2;
    icon2.addFile(QString::fromUtf8(":/res/cancel.png"));
    m_pBtnCancel->setIcon(icon2);
    m_pBtnCancel->setText(tr("Cancel"));
    m_pBtnCancel->setIconSize(QSize(16,16));
    m_pBtnCancel->setToolTip(tr("Cancel"));

    // connect
    connect(m_pBtnOk, SIGNAL(clicked()), this, SLOT(onOk()));
    connect(m_pBtnCancel, SIGNAL(clicked()), this, SLOT(onCancel()));

    // layout
    QGridLayout* pGridLayout = new QGridLayout(this);
    pGridLayout->addWidget(pLabelUserName, 0, 0);
    pGridLayout->addWidget(pLabelPassword, 1, 0);
    pGridLayout->addWidget(m_pEditUserName, 0, 1);
    pGridLayout->addWidget(m_pEditPassword, 1, 1);
    pGridLayout->addWidget(m_pBtnOk, 0, 2, 2, 1);
    pGridLayout->addWidget(m_pCheckBoxAlwaysLogin, 2, 0, 1, 2);
    pGridLayout->addWidget(m_pBtnCancel, 2, 2);
    pGroupBox->setLayout(pGridLayout);
    pGridLayout->setContentsMargins(20, 0, 20, 0);
}
示例#30
0
CommitDialog::CommitDialog (QWidget* parent ):
    KDialog (parent, Qt::Dialog),
    m_localCodec(QTextCodec::codecForLocale())
{
    this->setCaption(i18nc("@title:window", "<application>Git</application> Commit"));
    this->setButtons(KDialog::Ok | KDialog::Cancel);
    this->setDefaultButton(KDialog::Ok);
    this->setButtonText(KDialog::Ok, i18nc("@action:button", "Commit"));

    KVBox* vbox = new KVBox(this);
    this->setMainWidget(vbox);

    QGroupBox* messageGroupBox = new QGroupBox(vbox);
    messageGroupBox->setTitle(i18nc("@title:group", "Commit message"));

    QVBoxLayout * messageVBox = new QVBoxLayout(messageGroupBox);
    messageGroupBox->setLayout(messageVBox);

    m_commitMessageTextEdit = new KTextEdit(messageGroupBox);
    m_commitMessageTextEdit->setLineWrapMode(QTextEdit::FixedColumnWidth);
    m_commitMessageTextEdit->setLineWrapColumnOrWidth(72);
    messageVBox->addWidget(m_commitMessageTextEdit);
    setOkButtonState();
    connect(m_commitMessageTextEdit, SIGNAL(textChanged()), this, SLOT(setOkButtonState()));

    QHBoxLayout* messageHBox = new QHBoxLayout();
    messageVBox->addLayout(messageHBox);

    m_amendCheckBox = new QCheckBox(i18nc("@option:check", "Amend last commit"), messageGroupBox);
    messageHBox->addWidget(m_amendCheckBox);
    //read last commit message
    m_alternativeMessage = GitWrapper::instance()->lastCommitMessage();
    if (m_alternativeMessage.isNull()) {
        m_amendCheckBox->setEnabled(false);
        m_amendCheckBox->setToolTip(i18nc("@info:tooltip", "There is nothing to amend."));
    } else {
        connect(m_amendCheckBox, SIGNAL(stateChanged(int)),
                this, SLOT(amendCheckBoxStateChanged()));
    }

    QPushButton * signOffButton = new QPushButton(
        i18nc("@action:button Add Signed-Off line to the message widget", "Sign off"),messageGroupBox);
    signOffButton->setToolTip(i18nc("@info:tooltip", "Add Signed-off-by line at the end of the commit message."));
    messageHBox->addStretch();
    messageHBox->addWidget(signOffButton);

    //restore dialog size
    FileViewGitPluginSettings* settings = FileViewGitPluginSettings::self();
    this->setInitialSize(QSize(settings->commitDialogWidth(), settings->commitDialogHeight()));

    connect(this, SIGNAL(finished()), this, SLOT(saveDialogSize()));
    connect(signOffButton, SIGNAL(clicked(bool)), this, SLOT(signOffButtonClicked()));
}