本文整理汇总了C++中QComboBox::setMinimumSize方法的典型用法代码示例。如果您正苦于以下问题:C++ QComboBox::setMinimumSize方法的具体用法?C++ QComboBox::setMinimumSize怎么用?C++ QComboBox::setMinimumSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QComboBox
的用法示例。
在下文中一共展示了QComboBox::setMinimumSize方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateParameterTable
void AtenPrefs::updateParameterTable()
{
if (!isVisible()) return;
Messenger::enter("AtenPrefs::updateParameterTable");
int row = ui.FunctionalFormList->currentRow();
if (row == -1)
{
ui.ParameterTable->setRowCount(0);
Messenger::exit("AtenPrefs::updateParameterTable");
return;
}
int n;
QStringList combrules;
QComboBox* combo;
QTableWidgetItem *item;
for (n=0; n<CombinationRules::nCombinationRules; ++n) combrules << CombinationRules::combinationRuleName( (CombinationRules::CombinationRule) n);
ui.ParameterTable->setColumnCount(2);
ui.ParameterTable->setRowCount(VdwFunctions::functionData[row].nParameters);
for (n=0; n<VdwFunctions::functionData[row].nParameters; ++n)
{
item = new QTableWidgetItem(VdwFunctions::functionData[row].parameters[n]);
ui.ParameterTable->setItem(n, 0, item);
combo = new QComboBox(this);
combo->setMinimumSize(78,24);
combo->addItems(combrules);
combo->setItemData(0, n);
combo->setCurrentIndex(VdwFunctions::functionData[row].combinationRules[n]);
ui.ParameterTable->setCellWidget(n, 1, combo);
QObject::connect(combo, SIGNAL(activated(int)), this, SLOT(ParameterRuleChanged(int)));
}
Messenger::exit("AtenPrefs::updateParameterTable");
}
示例2: QToolButton
CProperties::CProperties( QWidget* parent, const char* name, HODBCINSTPROPERTY hTheFirstProperty )
: QMainWindow( parent, name, 0 )
{
HODBCINSTPROPERTY hProperty;
int nProperty;
pMainWidget = new QWidget( this );
setCentralWidget( pMainWidget );
pTopLayout = new QVBoxLayout( pMainWidget );
// SETUP TOOLBAR
toolbarMain = new QToolBar( this );
addToolBar( toolbarMain, tr( "ToolBar" ), Top, FALSE );
new QToolButton( QPixmap( checkOk_xpm ), QString(tr("Save and Exit")), QString(""), this, SLOT(pbOk_Clicked()), toolbarMain );
new QToolButton( QPixmap( checkCancel_xpm ), QString(tr("Cancel any changes and Exit")), QString(""), this, SLOT(pbCancel_Clicked()), toolbarMain );
QWhatsThis::whatsThisButton ( toolbarMain );
/* PROPERTIES */
hFirstProperty = hTheFirstProperty;
for ( nProperties = 0, hProperty = hFirstProperty; hProperty != NULL; hProperty = hProperty->pNext )
{
nProperties++;
}
pGridLayout = new QGridLayout( nProperties, 2, 2 );
pTopLayout->addLayout( pGridLayout );
pGridLayout->setColStretch ( 0, 0 );
pGridLayout->setColStretch ( 1, 1 );
for ( nProperty = 0, hProperty = hFirstProperty; hProperty != NULL; nProperty++, hProperty = hProperty->pNext )
{
QLabel *pLabel = new QLabel( pMainWidget );
// 1ST COLUMN IS ALWAYS A LABEL CONTAINING THE PROPERTY NAME
if ( hProperty->nPromptType != ODBCINST_PROMPTTYPE_HIDDEN )
{
if ( hProperty->pszHelp )
QWhatsThis::add( pLabel, hProperty->pszHelp );
pLabel->setLineWidth( 1 );
pLabel->setText( hProperty->szName );
pLabel->setMinimumSize( pLabel->sizeHint() );
pLabel->setFixedHeight( pLabel->sizeHint().height() );
pGridLayout->addWidget( pLabel, nProperty, 0 );
}
// 2ND COLUMN IS WHERE THE USER ENTERS DATA SO CREATE A WIDGET THAT IS MEANINGFULL
switch ( hProperty->nPromptType )
{
case ODBCINST_PROMPTTYPE_LABEL:
{
QLabel *pLabel2 = new QLabel( pMainWidget );
if ( hProperty->pszHelp )
QWhatsThis::add( pLabel2, hProperty->pszHelp );
pLabel2->setFrameStyle( QFrame::Box | QFrame::Sunken );
pLabel2->setLineWidth( 1 );
pLabel2->setText( hProperty->szValue );
pLabel2->setMinimumSize( pLabel2->sizeHint() );
pLabel2->setFixedHeight( pLabel2->sizeHint().height() );
pGridLayout->addWidget( pLabel2, nProperty, 1 );
hProperty->pWidget = pLabel2;
if ( hProperty->pszHelp ) QToolTip::add( pLabel2, hProperty->pszHelp );
}
break;
case ODBCINST_PROMPTTYPE_LISTBOX:
{
QComboBox *pComboBox = new QComboBox( pMainWidget );
if ( hProperty->pszHelp )
QWhatsThis::add( pComboBox, hProperty->pszHelp );
pComboBox->insertStrList( (const char **)hProperty->aPromptData );
pComboBox->setMinimumSize( pComboBox->sizeHint() );
pComboBox->setFixedHeight( pComboBox->sizeHint().height() );
pGridLayout->addWidget( pComboBox, nProperty, 1 );
hProperty->pWidget = pComboBox;
if ( hProperty->pszHelp ) QToolTip::add( pComboBox, hProperty->pszHelp );
setCurrentItem( pComboBox, hProperty->szValue );
}
break;
case ODBCINST_PROMPTTYPE_COMBOBOX:
{
QComboBox *pComboBox = new QComboBox( true, pMainWidget );
if ( hProperty->pszHelp )
QWhatsThis::add( pComboBox, hProperty->pszHelp );
pComboBox->insertStrList( (const char **)hProperty->aPromptData );
pComboBox->setEditText( hProperty->szValue );
pComboBox->setMinimumSize( pComboBox->sizeHint() );
pComboBox->setFixedHeight( pComboBox->sizeHint().height() );
pGridLayout->addWidget( pComboBox, nProperty, 1 );
hProperty->pWidget = pComboBox;
if ( hProperty->pszHelp ) QToolTip::add( pComboBox, hProperty->pszHelp );
}
break;
case ODBCINST_PROMPTTYPE_FILENAME:
{
CFileSelector *pFileSelector = new CFileSelector( pMainWidget );
if ( hProperty->pszHelp )
QWhatsThis::add( pFileSelector, hProperty->pszHelp );
pFileSelector->pLineEdit->setText( hProperty->szValue );
pGridLayout->addWidget( pFileSelector, nProperty, 1 );
hProperty->pWidget = pFileSelector;
if ( hProperty->pszHelp ) QToolTip::add( pFileSelector, hProperty->pszHelp );
//.........这里部分代码省略.........
示例3: QWidget
NoteInfo::NoteInfo(QWidget* parent)
: QWidget(parent)
{
deltaMode = false;
m_layout = new QVBoxLayout(this);
selTime = new PosEdit;
selTime->setObjectName("Start");
addTool(tr("Start"), selTime);
selLen = new QSpinBox();
selLen->setRange(0, 100000);
selLen->setSingleStep(1);
addTool(tr("Len"), selLen);
selPitch = new PitchEdit;
addTool(tr("Pitch"), selPitch);
selVelOn = new QSpinBox();
selVelOn->setRange(0, 127);
selVelOn->setSingleStep(1);
addTool(tr("Velo On"), selVelOn);
selVelOff = new QSpinBox();
selVelOff->setRange(0, 127);
selVelOff->setSingleStep(1);
addTool(tr("Velo Off"), selVelOff);
m_renderAlpha = new QSpinBox();
m_renderAlpha->setRange(0, 255);
m_renderAlpha->setSingleStep(1);
int alpha = tconfig().get_property("PianorollEdit", "renderalpha", 50).toInt();
m_renderAlpha->setValue(alpha);
addTool(tr("BG Brightness"), m_renderAlpha);
m_partLines = new QCheckBox(this);
bool pl = tconfig().get_property("PianorollEdit", "partLines", true).toBool();
m_partLines->setChecked(pl);
addTool(tr("Part End Marker"), m_partLines);
//start tb1 merge/*{{{*/
//---------------------------------------------------
// Raster, Quant.
//---------------------------------------------------
rasterLabel = new GridCombo(this);
quantLabel = new GridCombo(this);
rlist = new QTableWidget(10, 3);
rlist->setObjectName("listSnap");
qlist = new QTableWidget(8, 3);
qlist->setObjectName("listQuant");
rlist->verticalHeader()->setDefaultSectionSize(22);
rlist->horizontalHeader()->setDefaultSectionSize(32);
rlist->setSelectionMode(QAbstractItemView::SingleSelection);
rlist->verticalHeader()->hide();
rlist->horizontalHeader()->hide();
qlist->verticalHeader()->setDefaultSectionSize(22);
qlist->horizontalHeader()->setDefaultSectionSize(32);
qlist->setSelectionMode(QAbstractItemView::SingleSelection);
qlist->verticalHeader()->hide();
qlist->horizontalHeader()->hide();
rlist->setMinimumWidth(96);
qlist->setMinimumWidth(96);
rasterLabel->setView(rlist);
quantLabel->setView(qlist);
for (int j = 0; j < 3; j++)
for (int i = 0; i < 10; i++)
rlist->setItem(i, j, new QTableWidgetItem(tr(rasterStrings[i + j * 10])));
for (int j = 0; j < 3; j++)
for (int i = 0; i < 8; i++)
qlist->setItem(i, j, new QTableWidgetItem(tr(quantStrings[i + j * 8])));
setRaster(96);
setQuant(96);
rasterLabel->setMinimumSize(QSize(80, 22));
quantLabel->setMinimumSize(QSize(80, 22));
QHBoxLayout *hbox1 = new QHBoxLayout();
hbox1->addWidget(new QLabel(tr("Snap")));
hbox1->addWidget(rasterLabel);
QHBoxLayout *hbox2 = new QHBoxLayout();
hbox2->addWidget(new QLabel(tr("Quant.")));
hbox2->addWidget(quantLabel);
m_layout->addLayout(hbox1);
m_layout->addLayout(hbox2);
//---------------------------------------------------
// To Menu
//---------------------------------------------------
QComboBox* toList = new QComboBox;
toList->insertItem(0, tr("All Events"));
toList->insertItem(CMD_RANGE_LOOP, tr("Looped Ev."));
toList->insertItem(CMD_RANGE_SELECTED, tr("Selected Ev."));
//.........这里部分代码省略.........
示例4: QWidget
VW::VW( QWidget * parent, const char * name )
: QWidget( parent, name )
{
QHBoxLayout * hb;
hb = new QHBoxLayout( this, 10 );
QGroupBox * box;
box = new QGroupBox( this, "input box" );
hb->addWidget( box, 0, AlignTop );
QVBoxLayout * b;
// set up the input box
b = new QVBoxLayout( box, 12 );
QLabel * l = new QLabel( "Enter Vehicle Details", box, "header" );
l->setMinimumSize( l->sizeHint() );
b->addWidget( l );
QFrame * f = new QFrame( box, "horizontal divider" );
f->setFrameStyle( QFrame::HLine | QFrame::Sunken );
f->setMinimumHeight( 12 );
b->addWidget( f );
QGridLayout *grid = new QGridLayout( 3, 2 );
b->addLayout( grid );
// here we start on the input grid, with labels and other widget
// neatly arranged. the variable names are reused all over the
// place.
QComboBox * model = new QComboBox( FALSE, box, "model selection" );
model->insertItem( "Type 1 Beetle" );
model->insertItem( "Camper" );
model->insertItem( "Van" );
model->insertItem( "Fastback" );
model->insertItem( "Squareback" );
model->insertItem( "Notchback" );
model->insertItem( "411" );
model->setCurrentItem( model->count() - 1 ); // I like the 411
currentModel = "411";
model->insertItem( "412" );
model->insertItem( "Karmann Ghia" );
model->insertItem( "Thing" );
model->insertItem( "Safari" );
model->insertItem( "Kubelwagen" );
model->insertItem( "Trekker" );
model->insertItem( "Baja" );
model->setMinimumSize( model->sizeHint() );
model->setMaximumHeight( model->minimumSize().height() );
grid->addWidget( model, 0, 1 );
l = new QLabel( model, "Model:", box, "model label" );
l->setMinimumSize( l->sizeHint() );
grid->addWidget( l, 0, 0 );
QSpinBox * motor = new QSpinBox( 1000, 1600, 100,
box, "motor size selection" );
motor->setValue( 1000 );
currentMotorSize = 1000;
motor->setMinimumSize( motor->sizeHint() );
motor->setMaximumHeight( motor->minimumSize().height() );
grid->addWidget( motor, 1, 1 );
l = new QLabel( motor, "Motor size (cc):", box, "motor size label" );
l->setMinimumSize( l->sizeHint() );
grid->addWidget( l, 1, 0 );
QSpinBox * year = new QSpinBox( box, "model year" );
year->setRange( 1949, 1981 );
year->setValue( 1949 );
currentYear = 1949;
year->setMinimumSize( year->sizeHint() );
year->setMaximumHeight( year->minimumSize().height() );
grid->addWidget( year, 2, 1 );
l = new QLabel( year, "Model:", box, "model year label" );
l->setMinimumSize( l->sizeHint() );
grid->addWidget( l, 2, 0 );
b->addStretch( 1 );
b->activate();
// output box
box = new QGroupBox( this, "output box" );
hb->addWidget( box, 0, AlignTop );
b = new QVBoxLayout( box, 12 );
l = new QLabel( "Resulting Limousine:", box, "header" );
l->setMinimumSize( l->sizeHint() );
b->addWidget( l );
f = new QFrame( box, "horizontal divider" );
f->setFrameStyle( QFrame::HLine | QFrame::Sunken );
f->setMinimumHeight( 12 );
b->addWidget( f );
//.........这里部分代码省略.........