Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
qt-creator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tobias Hunger
qt-creator
Commits
34e19c0f
Commit
34e19c0f
authored
15 years ago
by
Thomas Hartmann
Browse files
Options
Downloads
Patches
Plain Diff
QmlDesigner.propertyEditor adjust CheckBox style
parent
0038a844
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
share/qtcreator/qmldesigner/propertyeditor/Qt/CheckBox.qml
+60
-25
60 additions, 25 deletions
share/qtcreator/qmldesigner/propertyeditor/Qt/CheckBox.qml
with
60 additions
and
25 deletions
share/qtcreator/qmldesigner/propertyeditor/Qt/CheckBox.qml
+
60
−
25
View file @
34e19c0f
import
Qt
4.6
import
Bauhaus
1.0
QCheckBox
{
//This is a special CheckBox that does color coding for states
id
:
CheckBox
;
QWidget
{
//This is a special CheckBox that does color coding for states
property
var
backendValue
;
property
var
baseStateFlag
;
id
:
CheckBox
;
checkable
:
true
;
checked
:
(
backendValue
===
undefined
||
backendValue
===
null
)
?
false
:
backendValue
.
value
;
onToggled
:
{
backendValue
.
value
=
checked
;
}
property
var
backendValue
;
onB
aseStateFlag
Changed
:
{
evaluate
();
}
property
var
b
aseStateFlag
;
property
alias
checkable
:
LocalCheckBox
.
checkable
property
alias
text
:
LocalLabel
.
text
onBa
ckendValue
Changed
:
{
onBa
seStateFlag
Changed
:
{
evaluate
();
}
Script
{
function
evaluate
()
{
onBackendValueChanged
:
{
evaluate
();
}
property
bool
isInModel
:
(
backendValue
===
undefined
||
backendValue
===
null
)
?
false
:
backendValue
.
isInModel
;
onIsInModelChanged
:
{
evaluate
();
}
property
bool
isInSubState
:
(
backendValue
===
undefined
||
backendValue
===
null
)
?
false
:
backendValue
.
isInSubState
;
onIsInSubStateChanged
:
{
evaluate
();
}
Script
{
function
evaluate
()
{
if
(
baseStateFlag
)
{
if
(
backendValue
!=
null
&&
backendValue
.
isInModel
)
CheckBox
.
setStyleSheet
(
"
color: white;
"
);
LocalLabel
.
setStyleSheet
(
"
color: white;
"
);
else
CheckBox
.
setStyleSheet
(
"
color: gray;
"
);
LocalLabel
.
setStyleSheet
(
"
color: gray;
"
);
}
else
{
if
(
backendValue
!=
null
&&
backendValue
.
isInSubState
)
CheckBox
.
setStyleSheet
(
"
color: #7799FF;
"
);
LocalLabel
.
setStyleSheet
(
"
color: #7799FF;
"
);
else
CheckBox
.
setStyleSheet
(
"
color: gray;
"
);
LocalLabel
.
setStyleSheet
(
"
color: gray;
"
);
}
}
}
ExtendedFunctionButton
{
}
}
layout
:
HorizontalLayout
{
spacing
:
4
QCheckBox
{
id
:
LocalCheckBox
checkable
:
true
;
checked
:
(
backendValue
===
undefined
||
backendValue
===
null
)
?
false
:
backendValue
.
value
;
onToggled
:
{
backendValue
.
value
=
checked
;
}
}
QLabel
{
id
:
LocalLabel
font.bold
:
true
;
alignment
:
"
Qt::AlignLeft | Qt::AlignVCenter
"
}
}
ExtendedFunctionButton
{
backendValue
:
CheckBox
.
backendValue
y
:
2
x
:
0
y
:
4
x
:
LocalCheckBox
.
x
+
18
;
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment