Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


qt docking window


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 Icebraker   Members   -  Reputation: 122

Like
0Likes
Like

Posted 27 April 2008 - 12:03 PM

Hello, I'm currently writing a qt application with docking windows. Basically, I want to modify my state variables from the docking window. I have already created the window, but when I close my application I get a segFault because I haven't connected it to any closing signal, and it is currently also disconnected to the parent window. Has anybody any experience with docking windows and can paste some code for either - how to connect the docking window to the parent so it gets automatically closed when the parent is closed - how to correctly close the docking window once the main window gets closed Thanks, Icebraker

Sponsor:

#2 _Sigma   Members   -  Reputation: 791

Like
0Likes
Like

Posted 27 April 2008 - 05:35 PM

Have you checked the sample apps that come with QT?

#3 Rydinare   Members   -  Reputation: 486

Like
0Likes
Like

Posted 28 April 2008 - 06:15 AM

I don't have time to paste code for you right now, but I can try to assist. First, Sigma's suggestion of trying the sample apps is a very good one. Qt has great sample apps. Just do a grep for QDockWidget (or QDockWindow if you're using Qt3) in the examples folder.

Moving on, you shouldn't segfault for not connecting a signal. Furthermore, the docking window should go away automatically when the parent is closed. That's part of Qt's hierarchy.

What I'm guessing may be your issue is being unaware of Qt's memory management. Qt main windows don't automatically clean up, so general suggestion is to put them on the stack. However, all other Qt widgets that are parented do clean up, so generally put them on the heap and Qt will do the cleanup behind the scenes. Your issue may be more related to something of that flavor. I know it threw me off at first that Qt was actually automatically cleaning up and deallocating the other widgets that were no longer used.

Finally, one other tip that QDockWidgets only work properly, in my experience, when the parent is a QMainWindow (or derivative). This is another thing that threw me off at first.

Let me know if that helps. If not, clarify what issues you're having and I'll see what else I can advise.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS