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
Marco Bubke
flatpak-qt-creator
Commits
61493f3e
Commit
61493f3e
authored
Dec 16, 2010
by
Thomas Hartmann
Browse files
QmlDesigner.properyEditor: fix hovering for reset button
parent
fb52b004
Changes
2
Hide whitespace changes
Inline
Side-by-side
share/qtcreator/qmldesigner/propertyeditor/Qt/ExtendedFunctionButton.qml
View file @
61493f3e
import
Qt
4.7
import
Bauhaus
1.0
Q
ToolButton
{
Animated
ToolButton
{
id
:
extendedFunctionButton
property
variant
backendValue
hoverIconFromFile
:
"
images/submenu.png
"
;
function
setIcon
()
{
if
(
backendValue
==
null
)
extendedFunctionButton
.
iconFromFile
=
"
images/placeholder.png
"
...
...
@@ -40,15 +42,6 @@ QToolButton {
styleSheet
:
"
*::down-arrow, *::menu-indicator { image: none; width: 0; height: 0; }
"
;
onMouseOverChanged
:
{
if
(
mouseOver
)
{
iconFromFile
=
"
images/submenu.png
"
;
}
else
{
setIcon
();
}
}
onActiveChanged
:
{
if
(
active
)
{
setIcon
();
...
...
src/plugins/qmldesigner/components/propertyeditor/basicwidgets.cpp
View file @
61493f3e
...
...
@@ -779,6 +779,43 @@ private:
QUrl
_url
;
};
class
AnimatedToolButton
:
public
QToolButton
{
Q_OBJECT
Q_PROPERTY
(
QUrl
hoverIconFromFile
READ
hoverIconFromFile
WRITE
setHoverIconFromFile
)
public:
AnimatedToolButton
(
QWidget
*
parent
=
0
)
:
QToolButton
(
parent
)
{}
private:
QUrl
hoverIconFromFile
()
const
{
return
m_hoverIconUrl
;
}
void
setHoverIconFromFile
(
const
QUrl
&
url
)
{
m_hoverIconUrl
=
url
;
m_hoverIcon
=
QIcon
(
m_hoverIconUrl
.
toLocalFile
());
}
void
leaveEvent
(
QEvent
*
)
{
setIcon
(
m_icon
);
}
void
enterEvent
(
QEvent
*
)
{
m_icon
=
icon
();
setIcon
(
m_hoverIcon
);
}
QUrl
m_hoverIconUrl
;
QIcon
m_hoverIcon
;
QIcon
m_icon
;
};
class
QComboBoxDeclarativeUI
:
public
QObject
{
Q_OBJECT
...
...
@@ -1357,6 +1394,7 @@ QML_DECLARE_TYPE(QTabObject);
QML_DECLARE_TYPE
(
MyGroupBox
);
QML_DECLARE_TYPE
(
WidgetLoader
);
QML_DECLARE_TYPE
(
WidgetFrame
);
QML_DECLARE_TYPE
(
AnimatedToolButton
);
void
BasicWidgets
::
registerDeclarativeTypes
()
{
...
...
@@ -1399,6 +1437,7 @@ void BasicWidgets::registerDeclarativeTypes()
qmlRegisterType
<
QFrame
>
(
"Bauhaus"
,
1
,
0
,
"QFrame"
);
qmlRegisterType
<
WidgetFrame
>
(
"Bauhaus"
,
1
,
0
,
"WidgetFrame"
);
qmlRegisterType
<
WidgetLoader
>
(
"Bauhaus"
,
1
,
0
,
"WidgetLoader"
);
qmlRegisterType
<
AnimatedToolButton
>
(
"Bauhaus"
,
1
,
0
,
"AnimatedToolButton"
);
qmlRegisterExtendedType
<
MyGroupBox
,
QGroupBoxDeclarativeUI
>
(
"Bauhaus"
,
1
,
0
,
"QExtGroupBox"
);
qmlRegisterExtendedType
<
QTabWidget
,
QTabWidgetDeclarativeUI
>
(
"Bauhaus"
,
1
,
0
,
"QTabWidget"
);
qmlRegisterExtendedType
<
QScrollArea
,
QScrollAreaDeclarativeUI
>
(
"Bauhaus"
,
1
,
0
,
"QScrollArea"
);
...
...
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