本文整理汇总了C++中QComboBox::setIconSize方法的典型用法代码示例。如果您正苦于以下问题:C++ QComboBox::setIconSize方法的具体用法?C++ QComboBox::setIconSize怎么用?C++ QComboBox::setIconSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QComboBox
的用法示例。
在下文中一共展示了QComboBox::setIconSize方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getEndArrowComboBox
QComboBox* StringHandler::getEndArrowComboBox()
{
QComboBox *pEndArrowComboBox = new QComboBox;
pEndArrowComboBox->setIconSize(QSize(58, 16));
pEndArrowComboBox->addItem(QIcon(":/Resources/icons/line-solid.svg"), getArrowString(ArrowNone));
pEndArrowComboBox->addItem(QIcon(":/Resources/icons/arrow-end-open.svg"), getArrowString(ArrowOpen));
pEndArrowComboBox->addItem(QIcon(":/Resources/icons/arrow-end-fill.svg"), getArrowString(ArrowFilled));
pEndArrowComboBox->addItem(QIcon(":/Resources/icons/arrow-end-open-half.svg"), getArrowString(ArrowHalf));
return pEndArrowComboBox;
}
示例2: getLinePatternComboBox
QComboBox* StringHandler::getLinePatternComboBox()
{
QComboBox *pLinePatternComboBox = new QComboBox;
pLinePatternComboBox->setIconSize(QSize(58, 16));
pLinePatternComboBox->addItem(QIcon(":/Resources/icons/line-none.svg"), getLinePatternString(LineNone));
pLinePatternComboBox->addItem(QIcon(":/Resources/icons/line-solid.svg"), getLinePatternString(LineSolid));
pLinePatternComboBox->addItem(QIcon(":/Resources/icons/line-dash.svg"), getLinePatternString(LineDash));
pLinePatternComboBox->addItem(QIcon(":/Resources/icons/line-dot.svg"), getLinePatternString(LineDot));
pLinePatternComboBox->addItem(QIcon(":/Resources/icons/line-dash-dot.svg"), getLinePatternString(LineDashDot));
pLinePatternComboBox->addItem(QIcon(":/Resources/icons/line-dash-dot-dot.svg"), getLinePatternString(LineDashDotDot));
return pLinePatternComboBox;
}
示例3: connect
//.........这里部分代码省略.........
toolButton = new QPushButton("New Tile");
toolButton->setCheckable(false);
toolLayout->addWidget(toolButton, ++row, 0, 1, ColumnCount);
toolGroup->addButton(toolButton, ODD::TTE_TILE_NEW); // button, id
toolButton = new QPushButton("Delete Tile");
toolButton->setCheckable(false);
toolLayout->addWidget(toolButton, ++row, 0, 1, ColumnCount);
toolGroup->addButton(toolButton, ODD::TTE_TILE_DELETE); // button, id
// Prototypes //
//
//
QGridLayout *groupBoxLayout;
QLabel *label;
QComboBox *comboBox;
// Track Prototypes //
//
//
groupBoxLayout = new QGridLayout;
trackPrototypesGroupBox_ = new QGroupBox(tr("Track Settings"));
trackPrototypesGroupBox_->setLayout(groupBoxLayout);
trackPrototypesGroupBox_->setEnabled(false);
toolLayout->addWidget(trackPrototypesGroupBox_, ++row, 0, 1, ColumnCount);
label = new QLabel(tr("Track Prototype"));
comboBox = new QComboBox;
foreach (const PrototypeContainer<RSystemElementRoad *> *container, prototypeManager_->getRoadPrototypes(PrototypeManager::PTP_TrackPrototype))
{
comboBox->addItem(container->getPrototypeIcon(), container->getPrototypeName());
}
comboBox->setIconSize(QSize(16, 16));
connect(comboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(handleTrackSelection(int)));
comboBox->setCurrentIndex(0); // this doesn't trigger an event...
handleTrackSelection(0); // ... so do it yourself
groupBoxLayout->addWidget(label, 0, 0);
groupBoxLayout->addWidget(comboBox, 1, 0);
// Section Prototypes //
//
//
groupBoxLayout = new QGridLayout;
sectionPrototypesGroupBox_ = new QGroupBox(tr("Section Settings"));
sectionPrototypesGroupBox_->setLayout(groupBoxLayout);
sectionPrototypesGroupBox_->setEnabled(false);
toolLayout->addWidget(sectionPrototypesGroupBox_, ++row, 0, 1, ColumnCount);
int groupBoxLayoutRow = 0;
// LaneSection Prototype //
//
label = new QLabel(tr("LaneSection Prototype"));
comboBox = new QComboBox;
foreach (const PrototypeContainer<RSystemElementRoad *> *container, prototypeManager_->getRoadPrototypes(PrototypeManager::PTP_LaneSectionPrototype))
{
comboBox->addItem(container->getPrototypeIcon(), container->getPrototypeName());
}
comboBox->setIconSize(QSize(16, 16));
connect(comboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(handleLaneSectionSelection(int)));
comboBox->setCurrentIndex(0);
handleLaneSectionSelection(0);
groupBoxLayout->addWidget(label, groupBoxLayoutRow++, 0);
groupBoxLayout->addWidget(comboBox, groupBoxLayoutRow++, 0);