What is the process behind making custom widgets (using Qt) that don't look...well...ugly?
I know it is fairly trivial to make a "custom widget" that has say, a listbox and a pushbutton slapped together into one, but how would I go about making something that looks more like this:
QAnalogWidgets
I have made some rough mock-ups that basically use a PNG background (that I made in Photoshop) with basic elements like QLabels placed on top of them, but I don't think this is how I should be doing it. I know that Qt supports CSS -- is this what people use to create widgets that actually look good? Do I need to be working in the paintEvent methods? OpenGL?
Trying to search for anything "custom widget qt" related is just giving me tons of info about how to import them into the Designer, etc -- so any leads would be appreciated.
Thanks!
Adding the Custom Widget to Qt Designer. Click Tools|Custom|Edit Custom Widgets to invoke the Edit Custom Widgets dialog. Click New Widget so that we are ready to add our new widget. Change the Class name from 'MyCustomWidget' to 'Vcr'.
Qt Widgets provide means for customization via style sheets, but Qt Quick is a better performing choice for user interfaces that do not aim to look native. Qt Widgets do not scale well for animations. Qt Quick offers a convenient and natural way to implement animations in a declarative manner.
There's basically three different things to try, in the order listed:
Basically, go with the easiest possible solution that will work for you. Also, take a look at Qt Creator, it's nicely styled and all the source code is available.
Here is a tutorial to create custom Window by removing System top bar and drawing the bacground : http://qt.developpez.com/tutoriels/braindeadbzh/customwindow/.
Since he is sub-classing a QWidget, you can do this for all QWidget subclass like QPushButton).
When You want to use them in QTDesigner, just include your class and then promote a "classic" widget to your custom one. This can be helpful: http://pepper.troll.no/s60prereleases/doc/designer-using-custom-widgets.html.
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