Standard "About" dialog in Qt
In my program Wallch ( http://sourceforge.net/projects/wall-changer/ ), i have added a new qt designer form class.
It works just fine!
( I referred the name of my application so if you want to check the project , not because it is my app )
You can use QMessageBox::about for simple about dialogs, or write your own QDialog subclass if you need anything more special/fancy.
- Create a form. Right click on Project, Add New.., then select Qt in Files and Classes, select Qt Designer Form Class on right side and click choose..
- Select Dialog without Buttons and click next.
- Name it, for example "About".
- Open About.ui in designer and change this window as desired, i.e. add icon, text, buttons (maybe only OK button) and save it.
- In mainwindow.h add this object, i.e.
About *about;
- In mainwinodw.cpp instantiate it,
about = new About(this);
If you put0
instead ofthis
, it will not be a "modal" window, so addthis
in parentheses. - Go to Designer and in Action Editor right click on menu item and select Go to slot -> triggered.
- Write
about->show();
in that slot.