Planned maintenance: From Sunday 8th December 10:00 CET there will be changes to try and solve the caching issues that have been experienced. If anyone has a problem connecting after this period then please PM @AndyS or any of the moderators.
[SOLVED]Calling new window from menu bar
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 help
PS. Sorry if it has been already answered but i didn't find anything.
koahnig last edited by
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.
andre last edited by
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
Thanks a lot :)
I'll try it and tell if something will go wrong
Did You mean about something like that:
I think Andre just used AboutAuthorWindow to refer to whatever class you want to use for the about author window.
Yeah, I've archived what I wanted. I've made new class like Andre said, and added another form to my project to make it look how i wanted.
Thank you very much :]