QML (using Canvas element) and QtQWidgets (using QPainter in combination with QPainterPath) is capable of drawing such things.
In either way it's all about the math and doing the calculations of each shape (arcs, lines, texts, ...)
The bottom image is rather easy. Yyou just need to calculate the translation along the x-axis based on your input values which make up the direction.
@goldstar2154 Totally agree with you - there is a obvious bug. But thanks to @raven-worx 's code we've got a way to get a result at least. And "solved" will help in web search:)
Thank you very much for this question:)
Im not sure what "material ripple animation" really is so its hard to say which design i would prefer.
Copying Paint of QMenu would be last choice as there might be bugs and its involving to keep in sync.
If the items can do all the drawing them self i would go for that. (2 i think :)
There are the same errors occured in the "esimplelabel.cpp" file, but I didn't write down here, since it'll consume too much place.
Make sure you have all virtual functions that are declared defined. While a declaration of a regular function without a definition is perfectly valid (until it's called), that's not true for virtual methods.
basically now my model controls text color through Qt::ForegroundRole regardless of the application's CSS.
I feel like it's the wrong place to put theming, but it works for me at the moment.
Well... until we decide to have different themes :-°
you made me curious, and so i played around a bit.
This example renders the widget and forwards mouse- and key-events to the widget (i used a QTextEdit in this case).
But it also points out the problems very well:
you can't use widgets with popup windows (e.g. combobox)
cursor blinking and text-selection isn't painted (may be fixed somehow - didn't investigate further)
correct focus handling might be pretty tricky to implement
correct state handling is essential for visual appearance
But i think it might be a good starting point. It still needs a lot of work to behave as someone would expect it to behave.
when you already have a layout set, you don't need to create a new one.
Just access your existing Layout with the layout() function.
In general every QWidget has its own layout (there are different kinds of layouts) and you can add widgets to them.
So if you want to add a widget to your QMainWindows layout you can call inside your main windows code something like this:
For further information please read http://doc.qt.io/qt-4.8/layout.html.
@Chris-Kawa I just have to say this is hilarious and spot on. I did this same thing in wxWidgets a couple years ago and this was my experience verbatim. In the end I went on to use the same basic technique that is described here: https://github.com/deimos1877/BorderlessWindow. Thanks for making me feel less stupid.