PDA

View Full Version : Open Dialog from MainWindow.



halvors
30th March 2010, 14:04
Hi!

I want to open AboutDialog.ui when i click QAction "About".



void MainWindow::on_actionAbout_triggered()
{
//Code for viewing AboutDialog.ui file here.
}

sudhansu
30th March 2010, 14:13
Create a pointer of the class which is derived from AboutDialog.Ui.
call pointer->show();
It will display the dialog.

halvors
30th March 2010, 14:34
I am a beginner so how can i do that?

Create in Qt Designer or?

Lykurg
30th March 2010, 14:38
I am a beginner
Then you should use the Newbie section! Therefore it exists.

Read this http://doc.trolltech.com/4.6/designer-using-a-ui-file.html and QDialog.

sudhansu
30th March 2010, 15:09
I am a beginner so how can i do that?

Create in Qt Designer or?

Yes. u should create the aboutdialog ui in creator. Create an user define class which is derived from this dialog. and create this class pointer inside mainwindow calss. call the show methode.

halvors
30th March 2010, 17:21
Can you show some exemples??

Plz =)=)

squidge
30th March 2010, 20:40
There are lots of examples bundled with Qt in the 'Examples' directory which show you how to do it.

sudhansu
31st March 2010, 07:39
Can you show some exemples??

Plz =)=)

Chk attached code.

halvors
1st April 2010, 02:09
Thanks, i gor it work.

Do you know how i can make a void or someting who connect to a server via RCON.