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
35bab5e7
Commit
35bab5e7
authored
15 years ago
by
Thomas Hartmann
Browse files
Options
Downloads
Patches
Plain Diff
QmlDesigner.propertyEditor: fixing some glitcheS
parent
b1669660
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/plugins/qmldesigner/components/propertyeditor/basicwidgets.cpp
+29
-7
29 additions, 7 deletions
...ns/qmldesigner/components/propertyeditor/basicwidgets.cpp
with
29 additions
and
7 deletions
src/plugins/qmldesigner/components/propertyeditor/basicwidgets.cpp
+
29
−
7
View file @
35bab5e7
...
...
@@ -1001,6 +1001,8 @@ class MyGroupBox : public QGroupBox
{
Q_OBJECT
Q_PROPERTY
(
bool
animated
READ
isAnimated
)
public:
MyGroupBox
(
QWidget
*
parent
=
0
)
:
QGroupBox
(
parent
),
m_animated
(
false
),
m_firstExpand
(
true
)
{}
...
...
@@ -1014,6 +1016,9 @@ void setAnimated(bool animated)
void
finishFirstExpand
()
{
m_firstExpand
=
false
;
}
bool
isAnimated
()
{
return
m_animated
;
}
public
slots
:
virtual
void
setVisible
(
bool
visible
);
...
...
@@ -1048,15 +1053,17 @@ class QGroupBoxDeclarativeUI : public QObject
Q_OBJECT
Q_PROPERTY
(
bool
collapsed
READ
isCollapsed
WRITE
setCollapsed
)
Q_PROPERTY
(
bool
smooth
READ
isSmooth
WRITE
setSmooth
)
public:
QGroupBoxDeclarativeUI
(
QObject
*
parent
=
0
)
:
QObject
(
parent
),
m_expanded
(
true
)
{
gb
=
qobject_cast
<
MyGroupBox
*>
(
parent
);
connect
(
&
m_timeLine
,
SIGNAL
(
frameChanged
(
int
)),
this
,
SLOT
(
animate
(
int
)));
connect
(
&
m_timeLine
,
SIGNAL
(
frameChanged
(
int
)),
this
,
SLOT
(
animate
(
int
)));
connect
(
&
m_timeLine
,
SIGNAL
(
finished
()),
this
,
SLOT
(
finish
()));
m_timeLine
.
setDuration
(
1
5
0
);
m_timeLine
.
setDuration
(
1
0
0
);
m_timeLine
.
setFrameRange
(
0
,
5
);
m_smooth
=
true
;
}
bool
isCollapsed
()
...
...
@@ -1070,6 +1077,11 @@ public:
expand
();
}
bool
isSmooth
()
{
return
m_smooth
;
}
void
setSmooth
(
bool
smooth
)
{
m_smooth
=
smooth
;
}
public
slots
:
void
collapse
();
void
expand
();
...
...
@@ -1085,6 +1097,7 @@ private:
int
m_oldMAxHeight
;
int
m_oldMinHeight
;
QPixmap
m_contens
;
bool
m_smooth
;
void
hideChildren
();
void
showChildren
();
...
...
@@ -1094,21 +1107,27 @@ private:
void
QGroupBoxDeclarativeUI
::
reLayout
()
{
gb
->
setUpdatesEnabled
(
false
);
QLayout
*
layout
=
gb
->
parentWidget
()
->
layout
();
QPoint
oldPos
=
gb
->
pos
();
if
(
layout
)
{
layout
->
invalidate
();
layout
->
activate
();
layout
->
update
();
}
gb
->
move
(
oldPos
);
gb
->
setUpdatesEnabled
(
true
);
gb
->
update
();
}
void
QGroupBoxDeclarativeUI
::
finish
()
{
gb
->
setAnimated
(
false
);
if
(
m_expanded
)
{
showChildren
();
gb
->
setUpdatesEnabled
(
false
);
gb
->
setMinimumHeight
(
m_oldMinHeight
);
gb
->
setMaximumHeight
(
m_oldMAxHeight
);
gb
->
resize
(
gb
->
sizeHint
());
gb
->
setUpdatesEnabled
(
true
);
//gb->resize(gb->sizeHint());
gb
->
finishFirstExpand
();
}
else
{
...
...
@@ -1117,6 +1136,7 @@ void QGroupBoxDeclarativeUI::finish()
gb
->
resize
(
gb
->
sizeHint
().
width
(),
30
);
}
reLayout
();
gb
->
setAnimated
(
false
);
}
void
QGroupBoxDeclarativeUI
::
hideChildren
()
...
...
@@ -1155,6 +1175,7 @@ void QGroupBoxDeclarativeUI::collapse()
gb
->
setPixmap
(
m_contens
,
1
);
hideChildren
();
m_expanded
=
false
;
gb
->
setAnimated
(
true
);
m_timeLine
.
start
();
}
...
...
@@ -1163,12 +1184,14 @@ void QGroupBoxDeclarativeUI::expand()
if
(
m_expanded
)
return
;
m_expanded
=
true
;
gb
->
setAnimated
(
true
);
m_timeLine
.
start
();
}
void
QGroupBoxDeclarativeUI
::
animate
(
int
frame
)
{
gb
->
setAnimated
(
true
);
if
(
!
m_smooth
)
return
;
qreal
height
;
if
(
m_expanded
)
{
...
...
@@ -1186,7 +1209,6 @@ void QGroupBoxDeclarativeUI::animate(int frame)
gb
->
setMaximumHeight
(
height
);
gb
->
setMinimumHeight
(
height
);
reLayout
();
gb
->
update
();
}
class
QTabWidgetDeclarativeUI
:
public
QObject
...
...
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