Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
flatpak-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
Marco Bubke
flatpak-qt-creator
Commits
773504b2
Commit
773504b2
authored
14 years ago
by
dt
Browse files
Options
Downloads
Patches
Plain Diff
Add a additional summary label to the DetailsWidget
used by the targetsetuppage Reviewed-By: hunger
parent
8a180f71
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/libs/utils/detailswidget.cpp
+22
-1
22 additions, 1 deletion
src/libs/utils/detailswidget.cpp
src/libs/utils/detailswidget.h
+6
-0
6 additions, 0 deletions
src/libs/utils/detailswidget.h
with
28 additions
and
1 deletion
src/libs/utils/detailswidget.cpp
+
22
−
1
View file @
773504b2
...
...
@@ -56,6 +56,8 @@
+------------+-------------------------+---------------+
+summaryLabel| toolwidget | detailsButton |
+------------+-------------------------+---------------+
+ additional summary |
+------------+-------------------------+---------------+
| widget |
+------------+-------------------------+---------------+
\endcode
...
...
@@ -72,6 +74,7 @@ namespace Utils {
QGridLayout
*
m_grid
;
QLabel
*
m_summaryLabel
;
QCheckBox
*
m_summaryCheckBox
;
QLabel
*
m_additionalSummaryLabel
;
Utils
::
FadingPanel
*
m_toolWidget
;
QWidget
*
m_widget
;
...
...
@@ -88,6 +91,7 @@ namespace Utils {
m_grid
(
new
QGridLayout
),
m_summaryLabel
(
new
QLabel
(
parent
)),
m_summaryCheckBox
(
new
QCheckBox
(
parent
)),
m_additionalSummaryLabel
(
new
QLabel
(
parent
)),
m_toolWidget
(
0
),
m_widget
(
0
),
m_state
(
DetailsWidget
::
Collapsed
),
...
...
@@ -108,10 +112,16 @@ namespace Utils {
d
->
m_summaryCheckBox
->
setContentsMargins
(
MARGIN
,
MARGIN
,
MARGIN
,
MARGIN
);
d
->
m_summaryCheckBox
->
setVisible
(
false
);
d
->
m_additionalSummaryLabel
->
setTextInteractionFlags
(
Qt
::
TextSelectableByMouse
);
d
->
m_additionalSummaryLabel
->
setContentsMargins
(
MARGIN
,
MARGIN
,
MARGIN
,
MARGIN
);
d
->
m_additionalSummaryLabel
->
setWordWrap
(
true
);
d
->
m_additionalSummaryLabel
->
setVisible
(
false
);
d
->
m_grid
->
setContentsMargins
(
0
,
0
,
0
,
0
);
d
->
m_grid
->
setSpacing
(
0
);
d
->
m_grid
->
addWidget
(
d
->
m_summaryLabel
,
0
,
0
);
d
->
m_grid
->
addWidget
(
d
->
m_detailsButton
,
0
,
2
);
d
->
m_grid
->
addWidget
(
d
->
m_additionalSummaryLabel
,
1
,
0
,
1
,
3
);
setLayout
(
d
->
m_grid
);
connect
(
d
->
m_detailsButton
,
SIGNAL
(
toggled
(
bool
)),
...
...
@@ -209,6 +219,17 @@ namespace Utils {
return
d
->
m_summaryLabel
->
text
();
}
QString
DetailsWidget
::
additionalSummaryText
()
const
{
return
d
->
m_additionalSummaryLabel
->
text
();
}
void
DetailsWidget
::
setAdditionalSummaryText
(
const
QString
&
text
)
{
d
->
m_additionalSummaryLabel
->
setText
(
text
);
d
->
m_additionalSummaryLabel
->
setVisible
(
!
text
.
isEmpty
());
}
DetailsWidget
::
State
DetailsWidget
::
state
()
const
{
return
d
->
m_state
;
...
...
@@ -269,7 +290,7 @@ namespace Utils {
if
(
d
->
m_widget
)
{
d
->
m_widget
->
setContentsMargins
(
MARGIN
,
MARGIN
,
MARGIN
,
MARGIN
);
d
->
m_grid
->
addWidget
(
d
->
m_widget
,
1
,
0
,
1
,
3
);
d
->
m_grid
->
addWidget
(
d
->
m_widget
,
2
,
0
,
1
,
3
);
}
updateControls
();
}
...
...
This diff is collapsed.
Click to expand it.
src/libs/utils/detailswidget.h
+
6
−
0
View file @
773504b2
...
...
@@ -51,6 +51,7 @@ class QTCREATOR_UTILS_EXPORT DetailsWidget : public QWidget
{
Q_OBJECT
Q_PROPERTY
(
QString
summaryText
READ
summaryText
WRITE
setSummaryText
DESIGNABLE
true
)
Q_PROPERTY
(
QString
additionalSummaryText
READ
additionalSummaryText
WRITE
setAdditionalSummaryText
DESIGNABLE
true
)
Q_PROPERTY
(
bool
useCheckBox
READ
useCheckBox
WRITE
setUseCheckBox
DESIGNABLE
true
)
Q_PROPERTY
(
bool
checked
READ
isChecked
WRITE
setChecked
DESIGNABLE
true
)
Q_PROPERTY
(
State
state
READ
state
WRITE
setState
)
...
...
@@ -69,6 +70,9 @@ public:
void
setSummaryText
(
const
QString
&
text
);
QString
summaryText
()
const
;
void
setAdditionalSummaryText
(
const
QString
&
text
);
QString
additionalSummaryText
()
const
;
void
setState
(
State
state
);
State
state
()
const
;
...
...
@@ -87,6 +91,7 @@ public:
void
setUseCheckBox
(
bool
b
);
/// Sets an icon, only supported if useCheckBox is true
void
setIcon
(
const
QIcon
&
icon
);
signals
:
void
checked
(
bool
);
private
slots
:
...
...
@@ -103,6 +108,7 @@ private:
void
changeHoverState
(
bool
hovered
);
DetailsWidgetPrivate
*
d
;
QString
m_additionalSummaryText
;
};
}
// namespace Utils
...
...
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