本文整理汇总了C++中QComboBox::insertStringList方法的典型用法代码示例。如果您正苦于以下问题:C++ QComboBox::insertStringList方法的具体用法?C++ QComboBox::insertStringList怎么用?C++ QComboBox::insertStringList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QComboBox
的用法示例。
在下文中一共展示了QComboBox::insertStringList方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setPredefinedColorListEditor
void propertySetter::setPredefinedColorListEditor()
{
QComboBox *editor = new QComboBox(this);
editor->insertStringList(CSSEditorGlobals::HTMLColors);
connect(editor, SIGNAL(activated(const QString&)), this, SIGNAL(valueChanged(const QString&)));
m_list.append(editor);
}
示例2: QLabel
//.........这里部分代码省略.........
label->setAlignment(AlignCenter);
QWhatsThis::add(label, i18n("In this column you can customize mouse clicks into the titlebar"
" or the frame of an active window."));
// Titlebar and frame, active, mouse button 1
combo = new QComboBox(grid);
combo->insertItem(i18n("Raise"));
combo->insertItem(i18n("Lower"));
combo->insertItem(i18n("Operations Menu"));
combo->insertItem(i18n("Toggle Raise & Lower"));
combo->insertItem(i18n("Nothing"));
connect(combo, SIGNAL(activated(int)), SLOT(changed()));
coTiAct1 = combo;
txtButton1 = i18n(
"Behavior on <em>left</em> click into the titlebar or frame of an "
"<em>active</em> window.");
txtButton3 = i18n(
"Behavior on <em>right</em> click into the titlebar or frame of an "
"<em>active</em> window.");
// Be nice to left handed users
if(leftHandedMouse)
qSwap(txtButton1, txtButton3);
QWhatsThis::add(combo, txtButton1);
// Titlebar and frame, active, mouse button 2
items << i18n("Raise") << i18n("Lower") << i18n("Operations Menu") << i18n("Toggle Raise & Lower") << i18n("Nothing") << i18n("Shade");
combo = new QComboBox(grid);
combo->insertStringList(items);
connect(combo, SIGNAL(activated(int)), SLOT(changed()));
coTiAct2 = combo;
QWhatsThis::add(combo, i18n("Behavior on <em>middle</em> click into the titlebar or frame of an <em>active</em> window."));
// Titlebar and frame, active, mouse button 3
combo = new QComboBox(grid);
combo->insertStringList(items);
connect(combo, SIGNAL(activated(int)), SLOT(changed()));
coTiAct3 = combo;
QWhatsThis::add(combo, txtButton3);
txtButton1 = i18n(
"Behavior on <em>left</em> click into the titlebar or frame of an "
"<em>inactive</em> window.");
txtButton3 = i18n(
"Behavior on <em>right</em> click into the titlebar or frame of an "
"<em>inactive</em> window.");
// Be nice to left handed users
if(leftHandedMouse)
qSwap(txtButton1, txtButton3);
label = new QLabel(i18n("Inactive"), grid);
label->setAlignment(AlignCenter);
QWhatsThis::add(label, i18n("In this column you can customize mouse clicks into the titlebar"
" or the frame of an inactive window."));
items.clear();
items << i18n("Activate & Raise") << i18n("Activate & Lower") << i18n("Activate") << i18n("Shade") << i18n("Operations Menu") << i18n("Raise")
<< i18n("Lower") << i18n("Nothing");
示例3: KCModule
KWindowActionsConfig::KWindowActionsConfig(bool _standAlone, KConfig *_config, QWidget *parent, const char *)
: KCModule(parent, "kcmkwm"), config(_config), standAlone(_standAlone)
{
QString strWin1, strWin2, strWin3, strAllKey, strAll1, strAll2, strAll3, strAllW;
QVBoxLayout *layout = new QVBoxLayout(this, 0, KDialog::spacingHint());
QGrid *grid;
QGroupBox *box;
QLabel *label;
QString strMouseButton1, strMouseButton3;
QString txtButton1, txtButton3;
QStringList items;
bool leftHandedMouse = (KGlobalSettings::mouseSettings().handed == KGlobalSettings::KMouseSettings::LeftHanded);
/** Inactive inner window ******************/
box = new QVGroupBox(i18n("Inactive Inner Window"), this, "Inactive Inner Window");
box->layout()->setMargin(KDialog::marginHint());
box->layout()->setSpacing(KDialog::spacingHint());
layout->addWidget(box);
QWhatsThis::add(box, i18n("Here you can customize mouse click behavior when clicking on an inactive"
" inner window ('inner' means: not titlebar, not frame)."));
grid = new QGrid(3, Qt::Vertical, box);
strMouseButton1 = i18n("Left button:");
txtButton1 = i18n(
"In this row you can customize left click behavior when clicking into"
" the titlebar or the frame.");
strMouseButton3 = i18n("Right button:");
txtButton3 = i18n(
"In this row you can customize right click behavior when clicking into"
" the titlebar or the frame.");
if(leftHandedMouse)
{
qSwap(strMouseButton1, strMouseButton3);
qSwap(txtButton1, txtButton3);
}
strWin1 = i18n(
"In this row you can customize left click behavior when clicking into"
" an inactive inner window ('inner' means: not titlebar, not frame).");
strWin3 = i18n(
"In this row you can customize right click behavior when clicking into"
" an inactive inner window ('inner' means: not titlebar, not frame).");
// Be nice to lefties
if(leftHandedMouse)
qSwap(strWin1, strWin3);
label = new QLabel(strMouseButton1, grid);
QWhatsThis::add(label, strWin1);
label = new QLabel(i18n("Middle button:"), grid);
strWin2 = i18n(
"In this row you can customize middle click behavior when clicking into"
" an inactive inner window ('inner' means: not titlebar, not frame).");
QWhatsThis::add(label, strWin2);
label = new QLabel(strMouseButton3, grid);
QWhatsThis::add(label, strWin3);
items.clear();
items << i18n("Activate, Raise & Pass Click") << i18n("Activate & Pass Click") << i18n("Activate") << i18n("Activate & Raise");
QComboBox *combo = new QComboBox(grid);
combo->insertStringList(items);
connect(combo, SIGNAL(activated(int)), SLOT(changed()));
coWin1 = combo;
QWhatsThis::add(combo, strWin1);
combo = new QComboBox(grid);
combo->insertStringList(items);
connect(combo, SIGNAL(activated(int)), SLOT(changed()));
coWin2 = combo;
QWhatsThis::add(combo, strWin2);
combo = new QComboBox(grid);
combo->insertStringList(items);
connect(combo, SIGNAL(activated(int)), SLOT(changed()));
coWin3 = combo;
QWhatsThis::add(combo, strWin3);
/** Inner window, titlebar and frame **************/
box = new QVGroupBox(i18n("Inner Window, Titlebar && Frame"), this, "Inner Window, Titlebar and Frame");
box->layout()->setMargin(KDialog::marginHint());
box->layout()->setSpacing(KDialog::spacingHint());
layout->addWidget(box);
QWhatsThis::add(box, i18n("Here you can customize KDE's behavior when clicking somewhere into"
" a window while pressing a modifier key."));
grid = new QGrid(5, Qt::Vertical, box);
// Labels
label = new QLabel(i18n("Modifier key:"), grid);
//.........这里部分代码省略.........
示例4: KDialogBase
GroupEditor::GroupEditor(ConfigEstateGroupList *newList, QWidget *parent)
: KDialogBase(KDialogBase::Plain, i18n("Group Editor"), Ok|Apply|Cancel, Ok, parent, "Group Editor", false, true), mylist(*newList)
{
setWFlags(WDestructiveClose);
list = newList;
QFrame *page = plainPage();
QHBoxLayout *hlayout = new QHBoxLayout(page, marginHint(), spacingHint());
groups = new KListBox(page);
hlayout->addWidget(groups);
connect(groups, SIGNAL(highlighted(QListBoxItem *)), this, SLOT(updateSettings(QListBoxItem *)));
QStringList newgroups;
for (ConfigEstateGroupList::Iterator it = list->begin(); it != list->end(); ++it)
newgroups.append((*it).name());
groups->insertStringList(newgroups);
connect(groups, SIGNAL(selectionChanged()), this, SLOT(selectionChanged()));
QVBoxLayout *vlayout = new QVBoxLayout(hlayout, spacingHint());
colorGroupBox = new QVGroupBox(i18n("&Colors"), page);
vlayout->addWidget(colorGroupBox);
(void) new QLabel(i18n("Foreground:"), colorGroupBox);
fgButton = new KColorButton(colorGroupBox, "Foreground Button");
connect(fgButton, SIGNAL(changed(const QColor &)), this, SLOT(fgChanged(const QColor &)));
connect(fgButton, SIGNAL(changed(const QColor &)), this, SIGNAL(changed()));
(void) new QLabel(i18n("Background:"), colorGroupBox);
bgButton = new KColorButton(colorGroupBox, "Background Button");
connect(bgButton, SIGNAL(changed(const QColor &)), this, SLOT(bgChanged(const QColor &)));
connect(bgButton, SIGNAL(changed(const QColor &)), this, SIGNAL(changed()));
pricesGroupBox = new QVGroupBox(i18n("&Prices"), page);
vlayout->addWidget(pricesGroupBox);
pricesWidget = new QWidget(pricesGroupBox);
QGridLayout *pricesLayout = new QGridLayout(pricesWidget, 2, 2, 0, spacingHint());
pricesLayout->addWidget(new QLabel(i18n("House price:"), pricesWidget), 0, 0);
pricesLayout->addWidget(housePrice = new QSpinBox(0, 3000, 25, pricesWidget), 0, 1);
housePrice->setSpecialValueText(i18n("None"));
housePrice->setSuffix(i18n("$"));
connect(housePrice, SIGNAL(valueChanged(int)), this, SLOT(housePriceChanged(int)));
pricesLayout->addWidget(new QLabel(i18n("Global price:"), pricesWidget), 1, 0);
pricesLayout->addWidget(globalPrice = new QSpinBox(0, 3000, 25, pricesWidget), 1, 1);
globalPrice->setSpecialValueText(i18n("None"));
globalPrice->setSuffix(i18n("$"));
connect(globalPrice, SIGNAL(valueChanged(int)), this, SLOT(globalPriceChanged(int)));
dynamicGroupBox = new QVGroupBox(i18n("&Dynamic Rent"), page);
vlayout->addWidget(dynamicGroupBox);
mathWidget = new QWidget(dynamicGroupBox);
QGridLayout *mathLayout = new QGridLayout(mathWidget, 2, 2, 0, spacingHint());
mathLayout->addWidget(new QLabel(i18n("Add rent variable:"), mathWidget), 0, 0);
mathLayout->addWidget(new QLabel(i18n("Expression:"), mathWidget), 1, 0);
QComboBox *rentVarCombo = new QComboBox(mathWidget);
QStringList vars;
vars << "DICE";
vars << "HOUSES";
vars << "GROUPOWNED";
rentVarCombo->insertStringList(vars);
mathLayout->addWidget(rentVarCombo, 0, 1);
rentMathEdit = new KLineEdit(mathWidget);
connect(rentMathEdit, SIGNAL(textChanged(const QString &)), this, SLOT(rentMathChanged(const QString &)));
connect(rentVarCombo, SIGNAL(activated(const QString &)), rentMathEdit, SLOT(insert(const QString &)));
mathLayout->addWidget(rentMathEdit, 1, 1);
QHBoxLayout *buttonlayout = new QHBoxLayout(vlayout, spacingHint());
KPushButton *addB = new KPushButton(i18n("&Add..."), page);
buttonlayout->addWidget(addB);
connect(addB, SIGNAL(clicked()), this, SLOT(add()));
removeB = new KPushButton(i18n("&Remove"), page);
buttonlayout->addWidget(removeB);
connect(removeB, SIGNAL(clicked()), this, SLOT(remove()));
selectionChanged();
}