-
Notifications
You must be signed in to change notification settings - Fork 30
Alias QPushButton::default to QPushButton::isDefault #13
base: master
Are you sure you want to change the base?
Changes from 2 commits
2d7551b
4f4b99d
ae1d0ee
959ae1e
5739971
c2c3ec8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
declarativepushbutton.cpp | ||
|
||
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, [email protected] | ||
Author: Lova Widmark <[email protected]> | ||
|
||
Licensees holding valid commercial KDAB DeclarativeWidgets licenses may use this file in | ||
accordance with DeclarativeWidgets Commercial License Agreement provided with the Software. | ||
|
||
Contact [email protected] 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 <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#include "declarativepushbutton_p.h" | ||
|
||
DeclarativePushButton::DeclarativePushButton(QWidget *parent) : QPushButton(parent) | ||
{ | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
declarativepushbutton_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, [email protected] | ||
Author: Lova Widmark <[email protected]> | ||
|
||
Licensees holding valid commercial KDAB DeclarativeWidgets licenses may use this file in | ||
accordance with DeclarativeWidgets Commercial License Agreement provided with the Software. | ||
|
||
Contact [email protected] 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 <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#ifndef DECLARATIVEPUSHBUTTON_P_H | ||
#define DECLARATIVEPUSHBUTTON_P_H | ||
|
||
#include <QPushButton> | ||
|
||
class DeclarativePushButton : public QPushButton | ||
{ | ||
Q_OBJECT | ||
Q_PROPERTY(bool isDefault READ isDefault WRITE setDefault) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In general all properties of classes exposed to QML should either be CONSTANT or NOTIFYable to properly work as inputs into property bindings. The QML engine will issue warnings for them accordingly. Obviously this is a problem with lots of widget properties, as they were not designed with that in mind and the classes are way older than QML itself. The DeclarativeWidgetExtension fixes that for some of the main ones as good as it can, maybe we should consider a derived extension for QAbstractButton and then one for QPushButton derived from that, with the goal to ideally fix them in Qt itself at some point There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the feedback. I will have a look at doing this. |
||
|
||
public: | ||
explicit DeclarativePushButton(QWidget *parent = 0); | ||
}; | ||
|
||
#endif // DECLARATIVEPUSHBUTTON_P_H |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you change the date in the copyright notices to 2018 please?