[SOLVED]Calling new window from menu bar
-
Hello everyone
I'm writing a program in Qt and I've placed menu bar in it. What i want to do is call "About author" window form it. There goes my problem: How do I create new window that shows info about me?
I know that I have to connect signal from menu button with a slot that will call new window, but I don't know how to create new window and so on.
I'll be very grateful for any helpPS. Sorry if it has been already answered but i didn't find anything.
-
If you are using "QMenuBar":http://doc.qt.nokia.com/4.7/qmenubar.html you could use one of the signals. With triggered for instance you can pass the signal to a method displaying the about text.
-
A window is just a class. So, like any other class, you can create a new instance on either the stack or the heap, depending on what you want to achieve. If you subclass QDialog for your "About Author" display, I would do something like this:
@
//declared as slot in the header
void showAboutAuthor()
{
AboutAuthorWindow aboutAuthor;
aboutAuthor.exec();
}
@ -
I think Andre just used AboutAuthorWindow to refer to whatever class you want to use for the about author window.