Results 1 to 4 of 4

Thread: Promoting a QDockWidget to a custom subclass in Designer

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2009
    Posts
    2
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Promoting a QDockWidget to a custom subclass in Designer

    I made a custom QDockWidget subclass to handle some specific I/O tasks, but I am having some trouble placing it into a Qt Designer form (a QMainWindow based form).

    Qt versions: 4.5.1 on Gentoo Linux, 4.5.2 on Mac OS X

    Promoting the QDockWidget doesn't cause any complaints, but when I run my program, the widgets inside my custom dock widget do not appear. The generated code shows Qt is trying to set the contents of my widget to an empty QWidget (dockWidgetContents). Designer does not seem to let me get rid of this dockWidgetContents QWidget, but I can modify its properties. The attached example is for this scenario.

    I tried making a plugin for Designer, but that seems like a lot of work just to place it in a form with Designer. Also, I seem to have failed some form of container widget aspect of creating plugins (domXml stuff that I'm supposed to put in).

    Promoting the QWidget (dockWidgetContents) inside a generic QDockWidget on the main form has layout issues. The generated code seems to want to replace the layout that the QWidget version of my custom subclass already has. The runtime error is: QLayout: Attempting to add QLayout "" to CustomSubclass "ObjectName", which already has a layout


    Any thoughts on how best to solve this issue? It seems strange that Qt Designer lets you put together custom QDockWidget based forms, but fails at letting QDockWidgets be promoted. I can live with the custom code solution, but it seems like the Designer should have a decent way to handle this.
    Attached Files Attached Files

Similar Threads

  1. Replies: 15
    Last Post: 25th March 2007, 03:40
  2. Custom Style and Qt Designer 3
    By iukpo in forum Qt Tools
    Replies: 1
    Last Post: 23rd January 2007, 00:39
  3. Global includes with designer custom widgets
    By mab in forum Qt Programming
    Replies: 2
    Last Post: 5th October 2006, 22:06
  4. Promoting a custom widget derived from QWidget Qt4
    By high_flyer in forum Qt Tools
    Replies: 1
    Last Post: 2nd March 2006, 18:50
  5. Replies: 4
    Last Post: 1st March 2006, 23:11

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.