From 791dd7bf888f8ccbfa0d7d7c23325b18c8176151 Mon Sep 17 00:00:00 2001 From: Znurre Date: Sun, 18 Feb 2018 20:29:22 +0100 Subject: [PATCH] Alias QPushButton::default to QPushButton::isDefault --- extensionplugin/extensionplugin_plugin.cpp | 3 +- lib/declarativepushbutton.cpp | 32 +++++++++++++++++ lib/declarativepushbutton_p.h | 42 ++++++++++++++++++++++ lib/lib.pro | 22 ++++++------ 4 files changed, 88 insertions(+), 11 deletions(-) create mode 100644 lib/declarativepushbutton.cpp create mode 100644 lib/declarativepushbutton_p.h diff --git a/extensionplugin/extensionplugin_plugin.cpp b/extensionplugin/extensionplugin_plugin.cpp index 2dd532c..1a2c47c 100644 --- a/extensionplugin/extensionplugin_plugin.cpp +++ b/extensionplugin/extensionplugin_plugin.cpp @@ -63,6 +63,7 @@ #include "scrollareawidgetcontainer_p.h" #include "stackedwidgetwidgetcontainer_p.h" #include "toolbarwidgetcontainer_p.h" +#include "declarativepushbutton_p.h" #include #include @@ -168,7 +169,7 @@ void ExtensionpluginPlugin::registerTypes(const char *uri) qmlRegisterExtendedType(uri, 1, 0, "MessageBox"); qmlRegisterExtendedType(uri, 1, 0, "PlainTextEdit"); qmlRegisterExtendedType(uri, 1, 0, "ProgressBar"); - qmlRegisterExtendedType(uri, 1, 0, "PushButton"); + qmlRegisterExtendedType(uri, 1, 0, "PushButton"); qmlRegisterExtendedType(uri, 1, 0, "RadioButton"); qmlRegisterExtendedType >(uri, 1, 0, "ScrollArea"); qmlRegisterExtendedType(uri, 1, 0, "ScrollBar"); diff --git a/lib/declarativepushbutton.cpp b/lib/declarativepushbutton.cpp new file mode 100644 index 0000000..74e5cea --- /dev/null +++ b/lib/declarativepushbutton.cpp @@ -0,0 +1,32 @@ +/* + declarativeloaderwidget_p.h + + This file is part of DeclarativeWidgets, library and tools for creating QtWidget UIs with QML. + + Copyright (C) 2013-2017 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com + Author: Lova Widmark + + Licensees holding valid commercial KDAB DeclarativeWidgets licenses may use this file in + accordance with DeclarativeWidgets Commercial License Agreement provided with the Software. + + Contact info@kdab.com if any conditions of this licensing are not clear to you. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include "declarativepushbutton_p.h" + +DeclarativePushButton::DeclarativePushButton(QWidget *parent) : QPushButton(parent) +{ +} diff --git a/lib/declarativepushbutton_p.h b/lib/declarativepushbutton_p.h new file mode 100644 index 0000000..0714ed6 --- /dev/null +++ b/lib/declarativepushbutton_p.h @@ -0,0 +1,42 @@ +/* + declarativeloaderwidget_p.h + + This file is part of DeclarativeWidgets, library and tools for creating QtWidget UIs with QML. + + Copyright (C) 2013-2017 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com + Author: Lova Widmark + + Licensees holding valid commercial KDAB DeclarativeWidgets licenses may use this file in + accordance with DeclarativeWidgets Commercial License Agreement provided with the Software. + + Contact info@kdab.com if any conditions of this licensing are not clear to you. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#ifndef DECLARATIVEPUSHBUTTON_P_H +#define DECLARATIVEPUSHBUTTON_P_H + +#include + +class DeclarativePushButton : public QPushButton +{ + Q_OBJECT + Q_PROPERTY(bool isDefault READ isDefault WRITE setDefault) + + public: + explicit DeclarativePushButton(QWidget *parent = 0); +}; + +#endif // DECLARATIVEPUSHBUTTON_P_H diff --git a/lib/lib.pro b/lib/lib.pro index 0482a66..9951099 100644 --- a/lib/lib.pro +++ b/lib/lib.pro @@ -66,11 +66,12 @@ HEADERS = \ staticdialogmethodattached_p.h \ toolbarwidgetcontainer_p.h \ widgetcontainerinterface_p.h \ - declarativeloaderwidget_p.h \ - declarativespaceritem_p.h \ - declarativeline_p.h \ - declarativelabelextension_p.h \ - declarativetabstops_p.h + declarativeloaderwidget_p.h \ + declarativespaceritem_p.h \ + declarativeline_p.h \ + declarativelabelextension_p.h \ + declarativetabstops_p.h \ + declarativepushbutton_p.h SOURCES = \ abstractdeclarativeobject.cpp \ @@ -116,8 +117,9 @@ SOURCES = \ stackedwidgetwidgetcontainer.cpp \ staticdialogmethodattached.cpp \ toolbarwidgetcontainer.cpp \ - declarativeloaderwidget.cpp \ - declarativespaceritem.cpp \ - declarativeline.cpp \ - declarativelabelextension.cpp \ - declarativetabstops.cpp + declarativeloaderwidget.cpp \ + declarativespaceritem.cpp \ + declarativeline.cpp \ + declarativelabelextension.cpp \ + declarativetabstops.cpp \ + declarativepushbutton.cpp