IMHO the best way to do it is catch signal from button by MainWidow (I assume that this is your window widget), and this slot invoke a custom signal which will fit to your requirements or simply call this method (best approach depends on how you designed your code). Direct connection is impossible in this case.
Added after 11 minutes:
Example of slot:
void MainWindow::pushButton_clicked()
{
if (date.isValid()) {
emit dateHasBeenSelected(date);
} else {
ui.
edit->setText
(QDate::currentDate().
toString());
}
}
void MainWindow::pushButton_clicked()
{
QDate date(QDate::fromString(ui.edit->text()));
if (date.isValid()) {
emit dateHasBeenSelected(date);
} else {
ui.edit->setText(QDate::currentDate().toString());
}
}
To copy to clipboard, switch view to plain text mode
Bookmarks