I'm using Qt Creator 4.5.0 and am trying to create a QDockWidget that I could modify in the builtin designer (I do this all the time with QDialogs and QMainWindows, so this is the first time trying with a QDockWidget). But I'm having no luck with being able to add any widget elements of any kind to the QDockWidget.
Here are the steps I've taken
If anyone has run into this problem and knows how to make it work, then that'd be an immense help to me.
Thanks in advance.
update
Currently I'm able to use the designer to customize a standard QWidget object (call it "ImageFilesWidget.ui"). So at the moment my solution is to add a standard QDockWidget to my QMainWindow in the designer, then (still in the designer) I promote the dockWidgetContents from a standard QWidget to my ImageFilesWidget class.
You can override the defaults by clicking on the parent widget of the layout, and scrolling down to the bottom of the Property Editor, where you'll see a Layout section with the relevant values ( -1 means "use the default").
ui file is used to create a ui_calculatorform. h file that can be used by any file listed in the SOURCES declaration. Note: You can use Qt Creator to create the Calculator Form project. It automatically generates the main.
It seems like the problem is when qtcreator 4.5 creates the dockwidgets ui file for you, it doesn't include the "dockWidgetContents" widget that is included in previous versions. Just manually put <widget class="QWidget" name="dockWidgetContents"/>
under the "windowTitle" property of the dockwidget and you'll be able to add ui elements to it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With