mirror of
https://github.com/crystalidea/qt6windows7.git
synced 2025-07-02 15:26:00 +08:00
6.5.3 clean
This commit is contained in:
@ -38,8 +38,7 @@ double BindableSubscription::calculateDiscount() const
|
||||
case Yearly:
|
||||
return 0.6;
|
||||
}
|
||||
Q_ASSERT(false);
|
||||
return -1;
|
||||
Q_UNREACHABLE_RETURN(-1);
|
||||
}
|
||||
|
||||
int BindableSubscription::basePrice() const
|
||||
|
@ -11,6 +11,10 @@
|
||||
#include <QPushButton>
|
||||
#include <QRadioButton>
|
||||
#include <QSpinBox>
|
||||
#include <QProperty>
|
||||
#include <QString>
|
||||
#include <QDateTimeEdit>
|
||||
#include <QBindable>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
@ -19,6 +23,8 @@ int main(int argc, char *argv[])
|
||||
BindableSubscription subscription(&user);
|
||||
|
||||
SubscriptionWindow w;
|
||||
// clazy:excludeall=lambda-in-connect
|
||||
// when subscription is out of scope so is window
|
||||
|
||||
// Initialize subscription data
|
||||
QRadioButton *monthly = w.findChild<QRadioButton *>("btnMonthly");
|
||||
@ -49,9 +55,8 @@ int main(int argc, char *argv[])
|
||||
});
|
||||
|
||||
QSpinBox *ageSpinBox = w.findChild<QSpinBox *>("ageSpinBox");
|
||||
QObject::connect(ageSpinBox, &QSpinBox::valueChanged, [&](int value) {
|
||||
user.setAge(value);
|
||||
});
|
||||
QBindable<int> ageBindable(ageSpinBox, "value");
|
||||
user.bindableAge().setBinding([ageBindable](){ return ageBindable.value();});
|
||||
|
||||
QLabel *priceDisplay = w.findChild<QLabel *>("priceDisplay");
|
||||
|
||||
|
Reference in New Issue
Block a user