本文整理汇总了C++中QDesignerSettingsInterface::endGroup方法的典型用法代码示例。如果您正苦于以下问题:C++ QDesignerSettingsInterface::endGroup方法的具体用法?C++ QDesignerSettingsInterface::endGroup怎么用?C++ QDesignerSettingsInterface::endGroup使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QDesignerSettingsInterface
的用法示例。
在下文中一共展示了QDesignerSettingsInterface::endGroup方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setUiMode
void QDesignerSettings::setUiMode(UIMode mode)
{
QDesignerSettingsInterface *s = settings();
s->beginGroup(QLatin1String("UI"));
s->setValue(QLatin1String("currentMode"), mode);
s->endGroup();
}
示例2: 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();
}
示例3: saveGeometry
StyleSheetEditorDialog::~StyleSheetEditorDialog()
{
QDesignerSettingsInterface *settings = m_core->settingsManager();
settings->beginGroup(QLatin1String(StyleSheetDialogC));
settings->setValue(QLatin1String(Geometry), saveGeometry());
settings->endGroup();
}
示例4: setToolWindowFont
void QDesignerSettings::setToolWindowFont(const ToolWindowFontSettings &fontSettings)
{
QDesignerSettingsInterface *s = settings();
s->beginGroup(QLatin1String("UI"));
s->setValue(QLatin1String("font"), fontSettings.m_font);
s->setValue(QLatin1String("useFont"), fontSettings.m_useFont);
s->setValue(QLatin1String("writingSystem"), fontSettings.m_writingSystem);
s->endGroup();
}
示例5: saveSettings
void QtResourceViewPrivate::saveSettings()
{
if (m_settingsKey.isEmpty())
return;
QDesignerSettingsInterface *settings = m_core->settingsManager();
settings->beginGroup(m_settingsKey);
settings->setValue(QLatin1String(SplitterPosition), m_splitter->saveState());
settings->endGroup();
}
示例6: saveGeometryFor
void QDesignerSettings::saveGeometryFor(const QWidget *w)
{
Q_ASSERT(w && !w->objectName().isEmpty());
QDesignerSettingsInterface *s = settings();
const bool visible = w->isVisible();
if (debugSettings)
qDebug() << Q_FUNC_INFO << w << "visible=" << visible;
s->beginGroup(w->objectName());
s->setValue(QLatin1String("visible"), visible);
s->setValue(QLatin1String("geometry"), w->saveGeometry());
s->endGroup();
}
示例7: saveExpandedState
void WidgetBoxTreeWidget::saveExpandedState() const
{
QStringList closedCategories;
if (const int numCategories = categoryCount()) {
for (int i = 0; i < numCategories; ++i) {
const QTreeWidgetItem *cat_item = topLevelItem(i);
if (!isItemExpanded(cat_item))
closedCategories.append(cat_item->text(0));
}
}
QDesignerSettingsInterface *settings = m_core->settingsManager();
settings->beginGroup(QLatin1String(widgetBoxRootElementC));
settings->setValue(QLatin1String("Closed categories"), closedCategories);
settings->setValue(QLatin1String("View mode"), m_iconMode);
settings->endGroup();
}
示例8: saveSettings
void PropertyEditor::saveSettings() const
{
QDesignerSettingsInterface *settings = m_core->settingsManager();
settings->beginGroup(QLatin1String(SettingsGroupC));
#if QT_VERSION >= 0x040500
settings->setValue(QLatin1String(ViewKeyC), QVariant(m_treeAction->isChecked() ? TreeView : ButtonView));
#endif
settings->setValue(QLatin1String(ColorKeyC), QVariant(m_coloring));
settings->setValue(QLatin1String(SortedKeyC), QVariant(m_sorting));
// Save last expansionState as QVariant map
QVariantMap expansionState;
if (!m_expansionState.empty()) {
const QMap<QString, bool>::const_iterator cend = m_expansionState.constEnd();
for (QMap<QString, bool>::const_iterator it = m_expansionState.constBegin(); it != cend; ++it)
expansionState.insert(it.key(), QVariant(it.value()));
}
settings->setValue(QLatin1String(ExpansionKeyC), expansionState);
settings->endGroup();
}
示例9: dynamicColor
//.........这里部分代码省略.........
connect(m_removeDynamicAction, SIGNAL(triggered()), this, SLOT(slotRemoveDynamicProperty()));
// Configure
QAction *configureAction = new QAction(tr("Configure Property Editor"), this);
configureAction->setIcon(createIconSet(QLatin1String("configure.png")));
QMenu *configureMenu = new QMenu(this);
configureAction->setMenu(configureMenu);
m_sortingAction->setCheckable(true);
connect(m_sortingAction, SIGNAL(toggled(bool)), this, SLOT(slotSorting(bool)));
m_coloringAction->setCheckable(true);
connect(m_coloringAction, SIGNAL(toggled(bool)), this, SLOT(slotColoring(bool)));
configureMenu->addAction(m_sortingAction);
configureMenu->addAction(m_coloringAction);
#if QT_VERSION >= 0x040600
configureMenu->addSeparator();
configureMenu->addAction(m_treeAction);
configureMenu->addAction(m_buttonAction);
#endif
// Assemble toolbar
QToolBar *toolBar = new QToolBar;
toolBar->addWidget(classWidget);
toolBar->addWidget(m_filterWidget);
toolBar->addWidget(createDropDownButton(m_addDynamicAction));
toolBar->addAction(m_removeDynamicAction);
toolBar->addWidget(createDropDownButton(configureAction));
// Views
QScrollArea *buttonScroll = new QScrollArea(m_stackedWidget);
m_buttonBrowser = new QtButtonPropertyBrowser(buttonScroll);
buttonScroll->setWidgetResizable(true);
buttonScroll->setWidget(m_buttonBrowser);
m_buttonIndex = m_stackedWidget->addWidget(buttonScroll);
connect(m_buttonBrowser, SIGNAL(currentItemChanged(QtBrowserItem*)), this, SLOT(slotCurrentItemChanged(QtBrowserItem*)));
m_treeBrowser = new QtTreePropertyBrowser(m_stackedWidget);
m_treeBrowser->setRootIsDecorated(false);
m_treeBrowser->setPropertiesWithoutValueMarked(true);
m_treeBrowser->setResizeMode(QtTreePropertyBrowser::Interactive);
m_treeIndex = m_stackedWidget->addWidget(m_treeBrowser);
connect(m_treeBrowser, SIGNAL(currentItemChanged(QtBrowserItem*)), this, SLOT(slotCurrentItemChanged(QtBrowserItem*)));
connect(m_filterWidget, SIGNAL(filterChanged(QString)), this, SLOT(setFilter(QString)));
QVBoxLayout *layout = new QVBoxLayout(this);
layout->addWidget(toolBar);
layout->addWidget(m_stackedWidget);
layout->setMargin(0);
layout->setSpacing(0);
m_treeFactory = new DesignerEditorFactory(m_core, this);
m_treeFactory->setSpacing(0);
m_groupFactory = new DesignerEditorFactory(m_core, this);
QtVariantPropertyManager *variantManager = m_propertyManager;
m_buttonBrowser->setFactoryForManager(variantManager, m_groupFactory);
m_treeBrowser->setFactoryForManager(variantManager, m_treeFactory);
m_stackedWidget->setCurrentIndex(m_treeIndex);
m_currentBrowser = m_treeBrowser;
m_treeAction->setChecked(true);
connect(m_groupFactory, SIGNAL(resetProperty(QtProperty*)), this, SLOT(slotResetProperty(QtProperty*)));
connect(m_treeFactory, SIGNAL(resetProperty(QtProperty*)), this, SLOT(slotResetProperty(QtProperty*)));
connect(variantManager, SIGNAL(valueChanged(QtProperty*,QVariant,bool)), this, SLOT(slotValueChanged(QtProperty*,QVariant,bool)));
// retrieve initial settings
QDesignerSettingsInterface *settings = m_core->settingsManager();
settings->beginGroup(QLatin1String(SettingsGroupC));
#if QT_VERSION >= 0x040500
const SettingsView view = settings->value(QLatin1String(ViewKeyC), TreeView).toInt() == TreeView ? TreeView : ButtonView;
#endif
// Coloring not available unless treeview and not sorted
m_sorting = settings->value(QLatin1String(SortedKeyC), false).toBool();
m_coloring = settings->value(QLatin1String(ColorKeyC), true).toBool();
const QVariantMap expansionState = settings->value(QLatin1String(ExpansionKeyC), QVariantMap()).toMap();
settings->endGroup();
// Apply settings
m_sortingAction->setChecked(m_sorting);
m_coloringAction->setChecked(m_coloring);
#if QT_VERSION >= 0x040500
switch (view) {
case TreeView:
m_currentBrowser = m_treeBrowser;
m_stackedWidget->setCurrentIndex(m_treeIndex);
m_treeAction->setChecked(true);
break;
case ButtonView:
m_currentBrowser = m_buttonBrowser;
m_stackedWidget->setCurrentIndex(m_buttonIndex);
m_buttonAction->setChecked(true);
break;
}
#endif
// Restore expansionState from QVariant map
if (!expansionState.empty()) {
const QVariantMap::const_iterator cend = expansionState.constEnd();
for (QVariantMap::const_iterator it = expansionState.constBegin(); it != cend; ++it)
m_expansionState.insert(it.key(), it.value().toBool());
}
updateActionsState();
}
示例10: 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();
}