Originally Posted by
Salazaar
Hi all. I've gotta few questions.
----------------------------------------------
1. I have created a main window, complete menus and toolbars, all is good, but I want to make a dialog, which will be called when a user clicks a About button in my menu. Ok, so I have created new dialog, but I can't connect it to the actionAbout (beacuse I saved the dialog in other file). I mean that i can't connect it even if both files are opened in the same time. How can I connect it?
----------------------------------------------
2. How to do it: If a user clicks a save button, program saves LineEdit contents in to a file which user select. And how to make more difficult actions?
----------------------------------------------
3. Finally, how to build a program when everything is designed?
1)
void MainWindow::slotAboutButton()
{
dlg->show();
}
use this connect statement in your mainwindow
connect( btnAction, SIGNAL( clicked() ), this, slotAboutButton() ));
void MainWindow::slotAboutButton()
{
QDialog* dlg = new QDialog(this);
dlg->show();
}
use this connect statement in your mainwindow
connect( btnAction, SIGNAL( clicked() ), this, slotAboutButton() ));
To copy to clipboard, switch view to plain text mode
2) Similar way connect clicked signal of save Button to some slot and use QTextStream to save data to a file.
3) It depends what you are using (linux or windows). On windows you can create a vcproject using the pro file and load it. Then there is a build button to build the program.
On linux either you can use kdevelop or just say
qmake test.pro
make
qmake test.pro
make
To copy to clipboard, switch view to plain text mode
There are many ways to do so.. Please read qtAssistance about qmake you will get an idea about what to do.
Thanks
Bookmarks