05-21-2013 10:19 AM
DropDown *currency_dropdown = mSettings->findChild<DropDown*>("dropdown_currency
bool ss = connect(currency_dropdown,SIGNAL(selectedValueChan
ged(const QVariant& selectedValue)), this,
SLOT(onSettingsCurrencyChanged(const QVariant& selectedValue)));
i'm on 10.1.0.1020
when application lanuch i got
Object::connect: No such signal bb::cascades::DropDown::selectedValueChanged(const QVariant& selectedValue) in ../src/applicationui.cpp:276
is there any mistake on my code?
Solved! Go to Solution.
05-21-2013 10:27 AM
bool ss = QObject::connect(currency_dropdown, SIGNAL(selectedValueChanged(QVariant)), this, SLOT(onSettingsCurrencyChanged(QVariant)));
This one should work.
Do not specify parameter names in SIGNAL() and SLOT(). Const and & can also be omitted when used together, MOC will discard them anyway. But it should work with them too.
05-21-2013 11:55 PM
It's a Qt rule.
Btw, I've read somewhere that normalized forms (without & and const) are preferred. Just now found an interesting article describing why they are preferred:
It seems non-normalized forms introduce a small runtime overhead when connecting signals to slots (the normalization is done at runtime).