Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tobias Hunger
qt-creator
Commits
f20841ca
Commit
f20841ca
authored
Feb 09, 2010
by
Erik Verbruggen
Browse files
Fixes for the QML designer settings page.
parent
5d95c35e
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/plugins/qmldesigner/designersettings.cpp
View file @
f20841ca
...
...
@@ -37,7 +37,13 @@ static const char *qmlGroup = "Qml";
static
const
char
*
qmlDesignerGroup
=
"Designer"
;
static
const
char
*
snapToGridKey
=
"SnapToGrid"
;
static
const
char
*
showBoundingRectanglesKey
=
"ShowBoundingRectangles"
;
static
const
char
*
onlyShowItemsWithContentsKey
=
"OnlyShowItemsWithContents"
;
DesignerSettings
::
DesignerSettings
()
:
snapToGrid
(
false
)
,
showBoundingRectangles
(
false
)
,
onlyShowItemsWithContents
(
false
)
{}
void
DesignerSettings
::
fromSettings
(
QSettings
*
settings
)
{
settings
->
beginGroup
(
QLatin1String
(
qmlGroup
));
...
...
@@ -45,6 +51,8 @@ void DesignerSettings::fromSettings(QSettings *settings)
snapToGrid
=
settings
->
value
(
QLatin1String
(
snapToGridKey
),
false
).
toBool
();
showBoundingRectangles
=
settings
->
value
(
QLatin1String
(
showBoundingRectanglesKey
),
false
).
toBool
();
onlyShowItemsWithContents
=
settings
->
value
(
QLatin1String
(
onlyShowItemsWithContentsKey
),
false
).
toBool
();
settings
->
endGroup
();
settings
->
endGroup
();
}
...
...
@@ -56,6 +64,8 @@ void DesignerSettings::toSettings(QSettings *settings) const
settings
->
setValue
(
QLatin1String
(
snapToGridKey
),
snapToGrid
);
settings
->
setValue
(
QLatin1String
(
showBoundingRectanglesKey
),
showBoundingRectangles
);
settings
->
setValue
(
QLatin1String
(
onlyShowItemsWithContentsKey
),
onlyShowItemsWithContents
);
settings
->
endGroup
();
settings
->
endGroup
();
}
...
...
src/plugins/qmldesigner/designersettings.h
View file @
f20841ca
...
...
@@ -40,6 +40,8 @@ QT_END_NAMESPACE
namespace
QmlDesigner
{
struct
DesignerSettings
{
DesignerSettings
();
void
fromSettings
(
QSettings
*
);
void
toSettings
(
QSettings
*
)
const
;
...
...
@@ -47,6 +49,7 @@ struct DesignerSettings {
bool
snapToGrid
;
bool
showBoundingRectangles
;
bool
onlyShowItemsWithContents
;
};
inline
bool
operator
==
(
const
DesignerSettings
&
s1
,
const
DesignerSettings
&
s2
)
...
...
src/plugins/qmldesigner/qmldesignerplugin.cpp
View file @
f20841ca
...
...
@@ -32,6 +32,7 @@
#include "designmode.h"
#include "qmldesignerconstants.h"
#include "pluginmanager.h"
#include "settingspage.h"
#include <coreplugin/icore.h>
#include <coreplugin/dialogs/iwizard.h>
...
...
@@ -99,6 +100,7 @@ bool BauhausPlugin::initialize(const QStringList & /*arguments*/, QString *error
m_designerCore
->
pluginManager
()
->
setPluginPaths
(
QStringList
()
<<
pluginPath
);
addAutoReleasedObject
(
new
DesignMode
);
addAutoReleasedObject
(
new
SettingsPage
);
error_message
->
clear
();
...
...
src/plugins/qmldesigner/settingspage.cpp
View file @
f20841ca
...
...
@@ -49,6 +49,8 @@ DesignerSettings SettingsPageWidget::settings() const
DesignerSettings
ds
;
ds
.
snapToGrid
=
m_ui
.
snapToGridCheckbox
->
isChecked
();
ds
.
showBoundingRectangles
=
m_ui
.
showBoundingRectanglesCheckbox
->
isChecked
();
ds
.
onlyShowItemsWithContents
=
m_ui
.
onlyShowItemsWithContentsCheckBox
->
isChecked
();
return
ds
;
}
...
...
@@ -56,6 +58,7 @@ void SettingsPageWidget::setSettings(const DesignerSettings &s)
{
m_ui
.
snapToGridCheckbox
->
setChecked
(
s
.
snapToGrid
);
m_ui
.
showBoundingRectanglesCheckbox
->
setChecked
(
s
.
showBoundingRectangles
);
m_ui
.
onlyShowItemsWithContentsCheckBox
->
setChecked
(
s
.
onlyShowItemsWithContents
);
}
QString
SettingsPageWidget
::
searchKeywords
()
const
...
...
@@ -63,7 +66,8 @@ QString SettingsPageWidget::searchKeywords() const
QString
rc
;
QTextStream
(
&
rc
)
<<
m_ui
.
snapToGridCheckbox
->
text
()
<<
m_ui
.
showBoundingRectanglesCheckbox
->
text
()
<<
' '
<<
m_ui
.
showBoundingRectanglesCheckbox
->
text
()
<<
' '
<<
m_ui
.
onlyShowItemsWithContentsCheckBox
->
text
()
<<
' '
<<
m_ui
.
groupBox
->
title
();
rc
.
remove
(
QLatin1Char
(
'&'
));
return
rc
;
...
...
src/plugins/qmldesigner/settingspage.ui
View file @
f20841ca
...
...
@@ -34,6 +34,13 @@
</property>
</widget>
</item>
<item>
<widget
class=
"QCheckBox"
name=
"onlyShowItemsWithContentsCheckBox"
>
<property
name=
"text"
>
<string>
Only Show Items with Contents
</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment