So I'm trying to work out how to design my wire-frame. It is essentially just two QScrollAreas, one above another, with a header (and button inside the header) for each.

Inside one design of the scroll area, I want to have items similar to a list of QListWidgetItems, however they would have a small image on the left side, and description on the right

On a another design of the scroll area, I would want just Rectangles filled with a color or pattern / image. They would all need to be selectable and emit a clicked signal.

Should I take the Class approach, and create a new class to act as a custom widget? Implement QWidget, and calculate where everything should be placed, changing background colors / opacities on mouse events, etc.? Or is there another approach I should take to this? From what I've read, creating custom widgets is an absolute pain.

Below are wireframes of what I want to design - is there anything already available that would do the job? If not, how should I go about designing these? I thought about using a couple QListWidgets or QTreeWidgets, but they wouldn't accomplish everything I am looking for.

Wireframes of custom "widgets"

有帮助吗?

解决方案

I've chosen to instead take a different approach. Instead of a list or QScrollArea, I am just going to take a QGraphicsView and paint my own objects into it. I need it to handle a few more interactions (left and right clicks, tiny buttons inside it, etc.). I may implement it into a QListView when I understand it better, but for now, this will work.

其他提示

I think you may create your own QWidget based control. For the header part just drag a label and a button, for the rest, you may use a QListWidget or QListView with custom cells

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top