aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports/controls/qtquickcontrols2plugin.cpp
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2016-10-02 10:29:39 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2016-10-02 11:24:25 +0000
commitfda44e6fed0062b8ef91d1cfdb10b1ffa6a3d730 (patch)
tree84136387e7fd07b16d9fdf54a64aa160f1bea79c /src/imports/controls/qtquickcontrols2plugin.cpp
parentda61768e9195593f3ad5b262b71e1b90c53fc681 (diff)
Make a plain AbstractButton calculate suitable implicit size
Just like commit 87b21a57 made Control do it, this applies the same logic to AbstractButton. The simple reasoning is that when customizing both the contentItem and the background, it is much better to use the AbstractButton type that does not have any default building blocks. Previously you would have to supply implicit size calculation as well, but this makes it much more convenient to use. [ChangeLog][Controls][AbstractButton] A plain AbstractButton now calculates its implicit size based on the implicit size of the content item plus paddings, and the implicit size of the background item. Change-Id: Ic380366b25940fbb9f28882c4622d58f4c042a07 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Diffstat (limited to 'src/imports/controls/qtquickcontrols2plugin.cpp')
-rw-r--r--src/imports/controls/qtquickcontrols2plugin.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/imports/controls/qtquickcontrols2plugin.cpp b/src/imports/controls/qtquickcontrols2plugin.cpp
index 541d18d6..153d61f7 100644
--- a/src/imports/controls/qtquickcontrols2plugin.cpp
+++ b/src/imports/controls/qtquickcontrols2plugin.cpp
@@ -41,7 +41,6 @@
#include <QtCore/private/qfileselector_p.h>
#include <QtQuickControls2/qquickstyle.h>
-#include <QtQuickTemplates2/private/qquickabstractbutton_p.h>
#include <QtQuickTemplates2/private/qquickbuttongroup_p.h>
#include <QtQuickTemplates2/private/qquickcontainer_p.h>
#include <QtQuickTemplates2/private/qquickcontrol_p.h>
@@ -82,7 +81,6 @@ QtQuickControls2Plugin::QtQuickControls2Plugin(QObject *parent) : QQuickStylePlu
void QtQuickControls2Plugin::registerTypes(const char *uri)
{
- qmlRegisterType<QQuickAbstractButton>(uri, 2, 0, "AbstractButton");
qmlRegisterType<QQuickButtonGroup>(uri, 2, 0, "ButtonGroup");
qmlRegisterType<QQuickButtonGroupAttached>();
@@ -93,6 +91,7 @@ void QtQuickControls2Plugin::registerTypes(const char *uri)
if (!style.isEmpty())
QFileSelectorPrivate::addStatics(QStringList() << style.toLower());
+ qmlRegisterType(selector.select(QStringLiteral("AbstractButton.qml")), uri, 2, 0, "AbstractButton");
qmlRegisterType(selector.select(QStringLiteral("ApplicationWindow.qml")), uri, 2, 0, "ApplicationWindow");
qmlRegisterType(selector.select(QStringLiteral("BusyIndicator.qml")), uri, 2, 0, "BusyIndicator");
qmlRegisterType(selector.select(QStringLiteral("Button.qml")), uri, 2, 0, "Button");