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
d24cd037
Commit
d24cd037
authored
15 years ago
by
dt
Browse files
Options
Downloads
Patches
Plain Diff
Change the apppereanve slightly for environment widgets.
parent
7be8be25
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/plugins/projectexplorer/environmenteditmodel.cpp
+28
-48
28 additions, 48 deletions
src/plugins/projectexplorer/environmenteditmodel.cpp
src/plugins/projectexplorer/environmenteditmodel.h
+2
-3
2 additions, 3 deletions
src/plugins/projectexplorer/environmenteditmodel.h
with
30 additions
and
51 deletions
src/plugins/projectexplorer/environmenteditmodel.cpp
+
28
−
48
View file @
d24cd037
...
...
@@ -31,6 +31,7 @@
#include
<QtGui/QVBoxLayout>
#include
<QtGui/QHeaderView>
#include
<QtGui/QToolButton>
using
namespace
ProjectExplorer
;
...
...
@@ -424,46 +425,36 @@ void EnvironmentModel::setUserChanges(QList<EnvironmentItem> list)
////
EnvironmentWidget
::
EnvironmentWidget
(
QWidget
*
parent
,
QWidget
*
additionalDetailsWidget
)
:
Q
Stacked
Widget
(
parent
)
:
QWidget
(
parent
)
{
m_model
=
new
EnvironmentModel
();
m_model
->
setMergedEnvironments
(
true
);
connect
(
m_model
,
SIGNAL
(
userChangesUpdated
()),
this
,
SIGNAL
(
userChangesUpdated
()));
m_summaryPage
=
new
QWidget
();
addWidget
(
m_summaryPage
);
QVBoxLayout
*
vbox
=
new
QVBoxLayout
(
m_summaryPage
);
vbox
->
setContentsMargins
(
0
,
-
1
,
0
,
-
1
);
QPushButton
*
detailsButton
=
new
QPushButton
(
this
);
detailsButton
->
setText
(
tr
(
"Show Details"
));
QHBoxLayout
*
hdetailsButtonLayout
=
new
QHBoxLayout
();
hdetailsButtonLayout
->
setMargin
(
0
);
hdetailsButtonLayout
->
addWidget
(
detailsButton
);
hdetailsButtonLayout
->
addStretch
(
10
);
connect
(
detailsButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
switchToDetails
()));
vbox
->
addLayout
(
hdetailsButtonLayout
);
QVBoxLayout
*
vbox
=
new
QVBoxLayout
(
this
);
m_summaryText
=
new
QLabel
(
this
);
m_summaryText
->
setText
(
""
);
vbox
->
addWidget
(
m_summaryText
);
m_detailsPage
=
new
QWidget
();
//addWidget(m_detailsPage);
QVBoxLayout
*
vbox2
=
new
QVBoxLayout
(
m_detailsPage
);
vbox2
->
setContentsMargins
(
0
,
-
1
,
0
,
-
1
);
QToolButton
*
detailsButton
=
new
QToolButton
(
this
);
detailsButton
->
setText
(
tr
(
"Details"
));
connect
(
detailsButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
switchToDetails
()));
QPushButton
*
summaryButton
=
new
QPushButton
(
this
);
summaryButton
->
setText
(
tr
(
"Hide Details"
));
QHBoxLayout
*
hbox
=
new
QHBoxLayout
();
hbox
->
addWidget
(
m_summaryText
);
hbox
->
addWidget
(
detailsButton
);
hbox
->
setMargin
(
0
);
hbox
->
addWidget
(
summaryButton
);
hbox
->
addStretch
(
10
);
connect
(
summaryButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
switchToSummary
()));
vbox2
->
addLayout
(
hbox
);
vbox
->
addLayout
(
hbox
);
m_details
=
new
QWidget
(
this
);
m_details
->
setVisible
(
false
);
QVBoxLayout
*
vbox2
=
new
QVBoxLayout
(
m_details
);
vbox2
->
setMargin
(
0
);
if
(
additionalDetailsWidget
)
vbox2
->
addWidget
(
additionalDetailsWidget
);
...
...
@@ -478,30 +469,32 @@ EnvironmentWidget::EnvironmentWidget(QWidget *parent, QWidget *additionalDetails
m_environmentTreeView
->
setMinimumHeight
(
400
);
horizontalLayout
->
addWidget
(
m_environmentTreeView
);
QVBoxLayout
*
vertical
Layout
_2
=
new
QVBoxLayout
();
QVBoxLayout
*
button
Layout
=
new
QVBoxLayout
();
m_editButton
=
new
QPushButton
(
this
);
m_editButton
->
setText
(
tr
(
"&Edit"
));
vertical
Layout
_2
->
addWidget
(
m_editButton
);
button
Layout
->
addWidget
(
m_editButton
);
m_addButton
=
new
QPushButton
(
this
);
m_addButton
->
setText
(
tr
(
"&Add"
));
vertical
Layout
_2
->
addWidget
(
m_addButton
);
button
Layout
->
addWidget
(
m_addButton
);
m_removeButton
=
new
QPushButton
(
this
);
m_removeButton
->
setEnabled
(
false
);
m_removeButton
->
setText
(
tr
(
"&Reset"
));
vertical
Layout
_2
->
addWidget
(
m_removeButton
);
button
Layout
->
addWidget
(
m_removeButton
);
m_unsetButton
=
new
QPushButton
(
this
);
m_unsetButton
->
setEnabled
(
false
);
m_unsetButton
->
setText
(
tr
(
"&Unset"
));
vertical
Layout
_2
->
addWidget
(
m_unsetButton
);
button
Layout
->
addWidget
(
m_unsetButton
);
QSpacerItem
*
verticalSpacer
=
new
QSpacerItem
(
20
,
40
,
QSizePolicy
::
Minimum
,
QSizePolicy
::
Expanding
);
vertical
Layout
_2
->
addItem
(
verticalSpacer
);
horizontalLayout
->
addLayout
(
vertical
Layout
_2
);
button
Layout
->
addItem
(
verticalSpacer
);
horizontalLayout
->
addLayout
(
button
Layout
);
vbox2
->
addLayout
(
horizontalLayout
);
vbox
->
addWidget
(
m_details
);
connect
(
m_model
,
SIGNAL
(
dataChanged
(
const
QModelIndex
&
,
const
QModelIndex
&
)),
this
,
SLOT
(
updateButtons
()));
...
...
@@ -520,26 +513,13 @@ EnvironmentWidget::EnvironmentWidget(QWidget *parent, QWidget *additionalDetails
EnvironmentWidget
::~
EnvironmentWidget
()
{
delete
m_summaryPage
;
delete
m_detailsPage
;
delete
m_model
;
m_model
=
0
;
}
void
EnvironmentWidget
::
switchToDetails
()
{
addWidget
(
m_detailsPage
);
setCurrentWidget
(
m_detailsPage
);
removeWidget
(
m_summaryPage
);
}
void
EnvironmentWidget
::
switchToSummary
()
{
updateSummaryText
();
addWidget
(
m_summaryPage
);
setCurrentWidget
(
m_summaryPage
);
removeWidget
(
m_detailsPage
);
m_details
->
setVisible
(
!
m_details
->
isVisible
());
}
void
EnvironmentWidget
::
setBaseEnvironment
(
const
ProjectExplorer
::
Environment
&
env
)
...
...
This diff is collapsed.
Click to expand it.
src/plugins/projectexplorer/environmenteditmodel.h
+
2
−
3
View file @
d24cd037
...
...
@@ -89,7 +89,7 @@ private:
bool
m_mergedEnvironments
;
};
class
PROJECTEXPLORER_EXPORT
EnvironmentWidget
:
public
Q
Stacked
Widget
class
PROJECTEXPLORER_EXPORT
EnvironmentWidget
:
public
QWidget
{
Q_OBJECT
public:
...
...
@@ -122,9 +122,8 @@ private slots:
private:
void
updateSummaryText
();
EnvironmentModel
*
m_model
;
QWidget
*
m_summaryPage
;
QWidget
*
m_detailsPage
;
QLabel
*
m_summaryText
;
QWidget
*
m_details
;
QTreeView
*
m_environmentTreeView
;
QPushButton
*
m_editButton
;
QPushButton
*
m_addButton
;
...
...
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