diff options
author | J-P Nurmi <jpnurmi@digia.com> | 2013-08-20 19:22:43 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@digia.com> | 2013-08-20 19:24:31 +0200 |
commit | 3dbfd45f6f278f8e521fa9f035acf5310102b836 (patch) | |
tree | f16cd11ceba046eb9d15872153d482fe81965c31 | |
parent | b3f1ed3b3b359722dc692256cbb3b89818bab49b (diff) | |
parent | 09b0cb956940f45deaf35392630bd05453558d43 (diff) | |
download | qtquickcontrols-3dbfd45f6f278f8e521fa9f035acf5310102b836.tar.gz |
Merge remote-tracking branch 'origin/stable' into dev
Change-Id: I97e6044a5d28ab875628e61ea67474f3c0a4ef4b
-rw-r--r-- | src/controls/MenuBar.qml | 1 | ||||
-rw-r--r-- | src/controls/Styles/Base/CheckBoxStyle.qml | 3 | ||||
-rw-r--r-- | src/controls/Styles/Base/RadioButtonStyle.qml | 3 | ||||
-rw-r--r-- | src/controls/Styles/Base/ScrollViewStyle.qml | 2 | ||||
-rw-r--r-- | src/controls/Styles/Base/TableViewStyle.qml | 2 | ||||
-rw-r--r-- | src/controls/controls.pro | 1 | ||||
-rw-r--r-- | src/controls/qquickexclusivegroup.cpp | 6 | ||||
-rw-r--r-- | src/controls/qquickmenu.cpp | 14 | ||||
-rw-r--r-- | src/controls/qquickmenu_p.h | 2 | ||||
-rw-r--r-- | src/controls/qquickmenubar_p.h | 2 | ||||
-rw-r--r-- | src/controls/qquickmenuitem_p.h | 2 | ||||
-rw-r--r-- | src/layouts/layouts.pro | 2 | ||||
-rw-r--r-- | tests/auto/controls/controls.pro | 2 |
13 files changed, 30 insertions, 12 deletions
diff --git a/src/controls/MenuBar.qml b/src/controls/MenuBar.qml index ea8844a9..22124af8 100644 --- a/src/controls/MenuBar.qml +++ b/src/controls/MenuBar.qml @@ -182,6 +182,7 @@ MenuBarPrivate { sourceComponent: menuBarLoader.menuItemStyle property int menuItemIndex: index + visible: menuItem.visible Connections { target: menuBarLoader diff --git a/src/controls/Styles/Base/CheckBoxStyle.qml b/src/controls/Styles/Base/CheckBoxStyle.qml index 0f38668f..18dfec6a 100644 --- a/src/controls/Styles/Base/CheckBoxStyle.qml +++ b/src/controls/Styles/Base/CheckBoxStyle.qml @@ -179,8 +179,7 @@ Style { Loader { id: labelLoader sourceComponent: label - anchors.top: parent.top - anchors.bottom: parent.bottom + anchors.verticalCenter: parent.verticalCenter } } } diff --git a/src/controls/Styles/Base/RadioButtonStyle.qml b/src/controls/Styles/Base/RadioButtonStyle.qml index ef3f2229..bac69d05 100644 --- a/src/controls/Styles/Base/RadioButtonStyle.qml +++ b/src/controls/Styles/Base/RadioButtonStyle.qml @@ -137,8 +137,7 @@ Style { Loader { id: labelLoader sourceComponent: label - anchors.top: parent.top - anchors.bottom: parent.bottom + anchors.verticalCenter: parent.verticalCenter } } } diff --git a/src/controls/Styles/Base/ScrollViewStyle.qml b/src/controls/Styles/Base/ScrollViewStyle.qml index ed7dd171..e8df1a55 100644 --- a/src/controls/Styles/Base/ScrollViewStyle.qml +++ b/src/controls/Styles/Base/ScrollViewStyle.qml @@ -71,7 +71,7 @@ Style { /*! This Component paints the frame around scroll bars. */ property Component frame: Rectangle { - color: "white" + color: control["backgroundVisible"] ? "white": "transparent" border.color: "#999" border.width: 1 radius: 1 diff --git a/src/controls/Styles/Base/TableViewStyle.qml b/src/controls/Styles/Base/TableViewStyle.qml index 4484f1c9..dd47f7ca 100644 --- a/src/controls/Styles/Base/TableViewStyle.qml +++ b/src/controls/Styles/Base/TableViewStyle.qml @@ -61,7 +61,7 @@ ScrollViewStyle { property color textColor: __syspal.text /*! The background color. */ - property color backgroundColor: __syspal.base + property color backgroundColor: control.backgroundVisible ? __syspal.base : "transparent" /*! The alternate background color. */ property color alternateBackgroundColor: Qt.darker(__syspal.base, 1.06) diff --git a/src/controls/controls.pro b/src/controls/controls.pro index 0a9d42c0..78eadf36 100644 --- a/src/controls/controls.pro +++ b/src/controls/controls.pro @@ -1,5 +1,6 @@ TARGET = qtquickcontrolsplugin TARGETPATH = QtQuick/Controls +IMPORT_VERSION = 1.0 QT += qml quick gui-private core-private diff --git a/src/controls/qquickexclusivegroup.cpp b/src/controls/qquickexclusivegroup.cpp index f1b6935e..a512bc34 100644 --- a/src/controls/qquickexclusivegroup.cpp +++ b/src/controls/qquickexclusivegroup.cpp @@ -131,9 +131,9 @@ static bool isChecked(const QObject *o) \section1 Adding support to ExclusiveGroup - It is possible to add support for ExclusiveGroup for an object, or control. It should have a \c checked + It is possible to add support for ExclusiveGroup for an object or control. It should have a \c checked property, and either a \c checkedChanged, \c toggled(), or \c toggled(bool) signal. It also needs - to be bound with \l ExclusiveGroup::bindCheckable() when its ExclusiveGroup ty[ped property is set. + to be bound with \l ExclusiveGroup::bindCheckable() when its ExclusiveGroup typed property is set. \code Item { @@ -149,7 +149,7 @@ static bool isChecked(const QObject *o) } \endcode - The example above shows the minimum necessary to add ExclusiveGroup support to any item. + The example above shows the minimum code necessary to add ExclusiveGroup support to any item. */ /*! diff --git a/src/controls/qquickmenu.cpp b/src/controls/qquickmenu.cpp index 01fd30be..f2823f16 100644 --- a/src/controls/qquickmenu.cpp +++ b/src/controls/qquickmenu.cpp @@ -40,6 +40,7 @@ ****************************************************************************/ #include "qquickmenu_p.h" +#include "qquickmenubar_p.h" #include "qquickmenuitemcontainer_p.h" #include "qquickmenupopupwindow_p.h" @@ -110,7 +111,7 @@ QT_BEGIN_NAMESPACE \qmlproperty bool Menu::visible Whether the menu should be visible. This is only enabled when the menu is used as - a submenu. Its value defaults to \c true. + a submenu or in the menubar. Its value defaults to \c true. */ /*! @@ -271,6 +272,17 @@ QQuickMenu::~QQuickMenu() m_platformMenu = 0; } +void QQuickMenu::setVisible(bool v) +{ + QQuickMenuBase::setVisible(v); + if (m_platformMenu) { + m_platformMenu->setVisible(v); + QQuickMenuBar *menubar = qobject_cast<QQuickMenuBar *>(parent()); + if (menubar && menubar->platformMenuBar()) + menubar->platformMenuBar()->syncMenu(m_platformMenu); + } +} + void QQuickMenu::updateText() { if (m_platformMenu) diff --git a/src/controls/qquickmenu_p.h b/src/controls/qquickmenu_p.h index 6207e3e0..54f7451b 100644 --- a/src/controls/qquickmenu_p.h +++ b/src/controls/qquickmenu_p.h @@ -103,6 +103,8 @@ public: QQuickMenu(QObject *parent = 0); virtual ~QQuickMenu(); + void setVisible(bool); + int selectedIndex() const { return m_selectedIndex; } void setSelectedIndex(int index); diff --git a/src/controls/qquickmenubar_p.h b/src/controls/qquickmenubar_p.h index c1aeece8..09a297fb 100644 --- a/src/controls/qquickmenubar_p.h +++ b/src/controls/qquickmenubar_p.h @@ -82,6 +82,8 @@ public: QQuickWindow *parentWindow() const { return m_parentWindow; } void setParentWindow(QQuickWindow *); + QPlatformMenuBar *platformMenuBar() const { return m_platformMenuBar; } + private: static void append_menu(QQmlListProperty<QQuickMenu> *list, QQuickMenu *menu); static int count_menu(QQmlListProperty<QQuickMenu> *list); diff --git a/src/controls/qquickmenuitem_p.h b/src/controls/qquickmenuitem_p.h index 61229685..02e7f5e3 100644 --- a/src/controls/qquickmenuitem_p.h +++ b/src/controls/qquickmenuitem_p.h @@ -90,7 +90,7 @@ public: ~QQuickMenuBase(); bool visible() const { return m_visible; } - void setVisible(bool); + virtual void setVisible(bool); QQuickMenu *parentMenu() const; virtual void setParentMenu(QQuickMenu *parentMenu); diff --git a/src/layouts/layouts.pro b/src/layouts/layouts.pro index 3f2e3836..caa496c3 100644 --- a/src/layouts/layouts.pro +++ b/src/layouts/layouts.pro @@ -1,7 +1,7 @@ CXX_MODULE = qml TARGET = qquicklayoutsplugin TARGETPATH = QtQuick/Layouts -IMPORT_VERSION = 2.1 +IMPORT_VERSION = 1.0 QT *= qml-private quick-private gui-private core-private diff --git a/tests/auto/controls/controls.pro b/tests/auto/controls/controls.pro index 49f8f0f3..e1da1d55 100644 --- a/tests/auto/controls/controls.pro +++ b/tests/auto/controls/controls.pro @@ -42,3 +42,5 @@ OTHER_FILES += \ $$PWD/data/tst_splitview.qml \ $$PWD/data/tst_styles.qml \ $$PWD/data/tst_layout.qml + +win32-msvc2010:contains(QT_CONFIG, angle):CONFIG += insignificant_test # QTBUG-33029 |