[Interest] Writing custom Qt Widgets is overly complicated

Jonathan Purol contact at folling.de
Tue Apr 28 14:38:33 CEST 2020


On 4/28/2020 2:17 PM, Federico Ferri wrote:
> Sorry, I don’t really have a solution for Qt Widgets. But is QHBoxLayout 
> really the best pick there? I would go for a “flow” layout, like the QML 
> ‘Flow’ positioner (but you’d have to make it yourself). In this way your 
> tags can wrap correctly according to widget’s width.
> 
> 
> In fact this is what I did in my QML Tag Edit widget 
> (https://github.com/fferri/QtQuick-TagsEditItem) maybe this is the 
> shoddy one you said you already found :-D

Hello Federico,

Qt has an example for a flow layout in QtWidgets: 
https://doc.qt.io/qt-5/qtwidgets-layouts-flowlayout-example.html 
(although I'm uncertain why it isn't part of the Qt Libraries). I 
appreciate your recommendation, though that's more of a secondary 
concern for me. I'd just love to get the widget working first, before 
dealing with details like this!

And no, yours wasn't the shoddy one :P
I only looked for examples with QtWidgets, as we're not using QML at all.

Best Regards,
Jonathan Purol


More information about the Interest mailing list