I'm trying to figure out how to add a custom widget to Qt Designer. So far I've been unsuccessful. Very new to Qt. I'm running Qt 4.8.6. I know there is a newer version but due to project constraints I have to stick with this one. Essentially I'm need to add a hex spin box, ie a spinbox that counts in hex rather than in decimals. I even found code that implements it . It does explain how to integrate it into Qt Designer , however it is explained for version 3. Can someone offer assistance?
Any help is greatly appreciated
Read about creating designer widgets and using them , but briefly:
QDesignerCustomWidgetInterface
to create your custom designer plugin for your custom widget $QTDIR/plugins/designer
There's also an example to follow.
Here is a documentation. At short, you just add any widget (eg QSpinBox
to draw it nice in the Designer) to your form and convert it to the needed one.
To add a custom widget to Qt designer simply follow the steps:
In your MainWindow/Dialog wherever you want to display this widget add a "Widget" from the "Containers" section of the designer.
Now right-click the "Widget" container you just added and click "Promote to..."
Cheers !!!
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.