Al_
2nd May 2014, 07:58
Hi
I prefer to use the more modern signal/slot connect() version as it is typesafe at run-time. Copied from the Qt documentation: "QObject::connect(lineEdit, &QLineEdit::textChanged, label, &QLabel::setText);". How is this done when there are overloaded functions and/or signals?
Examples:
"connect(camera, &QCamera::error, this, &CaptureDialog::errorSlot);" does not compile because there are two QCamera::error functions: the signal "QCamera::error(QCamera::Error)" and the regular function "QCamera::error() const"
"connect(camera, &QCamera::lockStatusChanged, this, &CaptureDialog::lockStatusChangedSlot);" does not compile because there are two signals QCamera::lockStatusChanged with different parameters
I prefer to use the more modern signal/slot connect() version as it is typesafe at run-time. Copied from the Qt documentation: "QObject::connect(lineEdit, &QLineEdit::textChanged, label, &QLabel::setText);". How is this done when there are overloaded functions and/or signals?
Examples:
"connect(camera, &QCamera::error, this, &CaptureDialog::errorSlot);" does not compile because there are two QCamera::error functions: the signal "QCamera::error(QCamera::Error)" and the regular function "QCamera::error() const"
"connect(camera, &QCamera::lockStatusChanged, this, &CaptureDialog::lockStatusChangedSlot);" does not compile because there are two signals QCamera::lockStatusChanged with different parameters