Skip to content
GitLab
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
ed5d10a1
Commit
ed5d10a1
authored
Mar 24, 2011
by
Daniel Molkentin
Browse files
Calculate proper size hint for target Creator.
Task-Number: QTCREATORBUG-4172 Reviewed-by: Robert Loehning
parent
5bfe61a5
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/plugins/projectexplorer/miniprojecttargetselector.cpp
View file @
ed5d10a1
...
...
@@ -143,11 +143,14 @@ ProjectExplorer::Project *ProjectListWidget::project() const
QSize
ProjectListWidget
::
sizeHint
()
const
{
int
height
=
0
;
for
(
int
itemPos
=
0
;
itemPos
<
count
();
++
itemPos
)
int
width
=
0
;
for
(
int
itemPos
=
0
;
itemPos
<
count
();
++
itemPos
)
{
height
+=
item
(
itemPos
)
->
sizeHint
().
height
();
width
=
qMax
(
width
,
item
(
itemPos
)
->
sizeHint
().
width
());
}
// We try to keep the height of the popup equal to the actionbar
QSize
size
(
QListWidget
::
sizeHint
().
width
()
,
height
);
QSize
size
(
width
,
height
);
static
QStatusBar
*
statusBar
=
Core
::
ICore
::
instance
()
->
statusBar
();
static
QWidget
*
actionBar
=
Core
::
ICore
::
instance
()
->
mainWindow
()
->
findChild
<
QWidget
*>
(
"actionbar"
);
Q_ASSERT
(
actionBar
);
...
...
@@ -525,8 +528,7 @@ void MiniProjectTargetSelector::addTarget(ProjectExplorer::Target *target, bool
MiniTargetWidget
*
targetWidget
=
new
MiniTargetWidget
(
target
);
connect
(
targetWidget
,
SIGNAL
(
changed
()),
this
,
SLOT
(
updateAction
()));
targetWidget
->
setSizePolicy
(
QSizePolicy
::
Maximum
,
QSizePolicy
::
Preferred
);
// width==0 size hint to avoid horizontal scrolling in list widget
lwi
->
setSizeHint
(
QSize
(
0
,
targetWidget
->
sizeHint
().
height
()));
lwi
->
setSizeHint
(
targetWidget
->
sizeHint
());
plw
->
setItemWidget
(
lwi
,
targetWidget
);
if
(
activeTarget
)
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment