How to implement this UI with QT?
-
I'm a qt beginner.I believe qt have great energy.So I want to know how to implement a UI just like the image below:
(I wrote this with JavaFx)
I want to know tow things here:
One is how QT implement a component may contains several other widget such like a icon,a string and a layout.As shown in the diagram. And at the same time ,this component may also contained by other containers (as a item) like QListView. It really like a nesting of div in front end.
Another is how to implement the frosted glass effect?I believe qt can do that effortlessly.I need some guide and ideas.
-
Hi
For views ( ListView/Treeview etc and also the ListWidgets etc )
the best way is QStyledItemDelegate.
http://doc.qt.io/qt-5/model-view-programming.html
( Delegates section )
They allow any type of custom editing and painting with good
performance and model integration.Example of special edit one.
http://doc.qt.io/qt-5/qtwidgets-itemviews-stardelegate-example.htmlIf you search the user @VRonin posts, you will find many examples of
delegates for comboboxes and buttons.
The other option is setCellWidget that
allows to set a complete widget to a cell. ( including sub widgets )
http://doc.qt.io/qt-5/qtablewidget.html#setCellWidget
However, this suffer from bad performance if the list is big and integrate poorly with the model. ( all editing is must be manually synced )Regarding the frosted effect.
Its very hard to make in any crossplatform way fi you need the actual window to be like that.