[PATCH 3/3] Add a slot to mainwindow but amend to use Q_SLOTS
Dirk Hohndel
dirk at hohndel.org
Tue Apr 9 06:53:20 PDT 2013
amit.k.chaudhuri at gmail.com writes:
> From: Amit Chaudhuri <amit.k.chaudhuri at gmail.com>
>
> For some reason, 'private slots:' causes a build error but private
> Q_SLOTS: works.
>
> The error was that 'slots' did not name a type and it appeared to be
> insensitive to whether the Makefile rule for .moc was in its current
> place or preceeded the rule for .cpp.
>
> Add a slot using the connectByName idiom e.g. actionNew connects to slot
> on_actionNew_triggered(). Use qDebug to show this fires if the menu
> option is selected.
>
> Above to demonstrate how to begin to link menu to code paths.
I add this to the Qt branch, but it seems of somewhat limited value
:-)
> +void MainWindow::on_actionNew_triggered()
> +{
> + qDebug() << "actionNew";
> +}
> +
By the way: this is a part of C++ syntax that I really dislike... the
whole streams thing is just ugly.
/D
More information about the subsurface
mailing list