本文整理汇总了C++中QDesignerSettingsInterface::contains方法的典型用法代码示例。如果您正苦于以下问题:C++ QDesignerSettingsInterface::contains方法的具体用法?C++ QDesignerSettingsInterface::contains怎么用?C++ QDesignerSettingsInterface::contains使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QDesignerSettingsInterface
的用法示例。
在下文中一共展示了QDesignerSettingsInterface::contains方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QDialog
PlainTextEditorDialog::PlainTextEditorDialog(QDesignerFormEditorInterface *core, QWidget *parent) :
QDialog(parent),
m_editor(new QPlainTextEdit),
m_core(core)
{
setWindowTitle(tr("Edit text"));
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
QVBoxLayout *vlayout = new QVBoxLayout(this);
vlayout->addWidget(m_editor);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal);
QPushButton *ok_button = buttonBox->button(QDialogButtonBox::Ok);
ok_button->setDefault(true);
connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
vlayout->addWidget(buttonBox);
QDesignerSettingsInterface *settings = core->settingsManager();
settings->beginGroup(QLatin1String(PlainTextDialogC));
if (settings->contains(QLatin1String(Geometry)))
restoreGeometry(settings->value(QLatin1String(Geometry)).toByteArray());
settings->endGroup();
}
示例2: QDialog
//.........这里部分代码省略.........
connect(m_buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
connect(m_buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
connect(m_buttonBox, SIGNAL(helpRequested()), this, SLOT(slotRequestHelp()));
m_buttonBox->button(QDialogButtonBox::Help)->setShortcut(QKeySequence::HelpContents);
connect(m_editor, SIGNAL(textChanged()), this, SLOT(validateStyleSheet()));
QToolBar *toolBar = new QToolBar;
QGridLayout *layout = new QGridLayout;
layout->addWidget(toolBar, 0, 0, 1, 2);
layout->addWidget(m_editor, 1, 0, 1, 2);
layout->addWidget(m_validityLabel, 2, 0, 1, 1);
layout->addWidget(m_buttonBox, 2, 1, 1, 1);
setLayout(layout);
m_editor->setContextMenuPolicy(Qt::CustomContextMenu);
connect(m_editor, SIGNAL(customContextMenuRequested(QPoint)),
this, SLOT(slotContextMenuRequested(QPoint)));
QSignalMapper *resourceActionMapper = new QSignalMapper(this);
QSignalMapper *gradientActionMapper = new QSignalMapper(this);
QSignalMapper *colorActionMapper = new QSignalMapper(this);
resourceActionMapper->setMapping(m_addResourceAction, QString());
gradientActionMapper->setMapping(m_addGradientAction, QString());
colorActionMapper->setMapping(m_addColorAction, QString());
connect(m_addResourceAction, SIGNAL(triggered()), resourceActionMapper, SLOT(map()));
connect(m_addGradientAction, SIGNAL(triggered()), gradientActionMapper, SLOT(map()));
connect(m_addColorAction, SIGNAL(triggered()), colorActionMapper, SLOT(map()));
connect(m_addFontAction, SIGNAL(triggered()), this, SLOT(slotAddFont()));
m_addResourceAction->setEnabled(mode == ModePerForm);
const char * const resourceProperties[] = {
"background-image",
"border-image",
"image",
0
};
const char * const colorProperties[] = {
"color",
"background-color",
"alternate-background-color",
"border-color",
"border-top-color",
"border-right-color",
"border-bottom-color",
"border-left-color",
"gridline-color",
"selection-color",
"selection-background-color",
0
};
QMenu *resourceActionMenu = new QMenu(this);
QMenu *gradientActionMenu = new QMenu(this);
QMenu *colorActionMenu = new QMenu(this);
for (int resourceProperty = 0; resourceProperties[resourceProperty]; ++resourceProperty) {
QAction *action = resourceActionMenu->addAction(QLatin1String(resourceProperties[resourceProperty]));
connect(action, SIGNAL(triggered()), resourceActionMapper, SLOT(map()));
resourceActionMapper->setMapping(action, QLatin1String(resourceProperties[resourceProperty]));
}
for (int colorProperty = 0; colorProperties[colorProperty]; ++colorProperty) {
QAction *gradientAction = gradientActionMenu->addAction(QLatin1String(colorProperties[colorProperty]));
QAction *colorAction = colorActionMenu->addAction(QLatin1String(colorProperties[colorProperty]));
connect(gradientAction, SIGNAL(triggered()), gradientActionMapper, SLOT(map()));
connect(colorAction, SIGNAL(triggered()), colorActionMapper, SLOT(map()));
gradientActionMapper->setMapping(gradientAction, QLatin1String(colorProperties[colorProperty]));
colorActionMapper->setMapping(colorAction, QLatin1String(colorProperties[colorProperty]));
}
connect(resourceActionMapper, SIGNAL(mapped(QString)), this, SLOT(slotAddResource(QString)));
connect(gradientActionMapper, SIGNAL(mapped(QString)), this, SLOT(slotAddGradient(QString)));
connect(colorActionMapper, SIGNAL(mapped(QString)), this, SLOT(slotAddColor(QString)));
m_addResourceAction->setMenu(resourceActionMenu);
m_addGradientAction->setMenu(gradientActionMenu);
m_addColorAction->setMenu(colorActionMenu);
toolBar->addAction(m_addResourceAction);
toolBar->addAction(m_addGradientAction);
toolBar->addAction(m_addColorAction);
toolBar->addAction(m_addFontAction);
m_editor->setFocus();
QDesignerSettingsInterface *settings = core->settingsManager();
settings->beginGroup(QLatin1String(StyleSheetDialogC));
if (settings->contains(QLatin1String(Geometry)))
restoreGeometry(settings->value(QLatin1String(Geometry)).toByteArray());
settings->endGroup();
}