Read and understand the chapter. We can give you the exact code for your problem but then you won't learn anything and you'll come right back with a simmilar issue.
Read and understand the chapter. We can give you the exact code for your problem but then you won't learn anything and you'll come right back with a simmilar issue.
But in book, there appear one more line after QApplication app... It's
which not appear in my application, but it works.
Hi than. I read chapter 2, I understand it, but I still don't know how to connect action to another dialog. It shows how to make slots and use it, but not how to connect two different dialogs. Regards
I want to connect action in my menu called actionAbout to dialog which is in ui_about
if a ucer clicks a button, than about dialog is displayed
Right
And if I have a dialog included to my file called Dialog, so the OtherDialog will the replaced by Dialog? And what about "dlg"? and must on_aboutAction_triggered() be defined in slots section? I mean the same way that I do it with other functions?Qt Code:
void MainWindow::on_actionAbout_triggered() { OtherDialog dlg( this ); dlg.exec(); }To copy to clipboard, switch view to plain text mode
Last edited by Salazaar; 18th May 2007 at 21:58.
Yes, you have to replace it with the name of a class you want to use.
It doesn't matter, it's just a variable.
Yes, it has to be a slot.
As a homework, please, get a copy of C++ Primer (Polish edition is called Podstawy języka C++) by S. Lippman and J. Lajoie and read parts 2--5.
And to connect dialog to a slot, I have to do this, what is described in posts #65, 66
and also include this ui_about.h dialog file and nothing else? Will it be done correctly?
You don't connect a dialog to a slot. You connect a signal triggered() of the action actionAbout to a slot that has code which creates the dialog object and calls exec() on it to show it as modal.
Bookmarks