I am looking to create a digital Rolodex to keep track of contacts in Qt 5.9 and am uncertain how to efficiently create custom widgets. Examples online like the classic clock example show to completely override paint, but I want only to create a widget in design that is a collection of labels and buttons to display a list of contacts, and a few buttons to edit, delete, and create contacts beside it. The element entire arrangement appear multiple times across different parts of the application and it should look exactly the same in each.
I will have to create many other widgets just like this, so I am hoping to be able to drag-and-drop elements in designer rather than programmatically set everything.
Since each contact has its own little panel and picture, each contact is arranged in a scrolling list, and buttons are placed beside, we have:
- Create a
ContactLabelcustom widget with the picture, name, and address labels arranged
- Create a
ContactsWidgetcustom widget with a Widget Listview containing a series of
ContactLabelwidgets, and buttons on the right.
- Wherever needed, drop the `contacts widget into a form.
It appears that visual studio addons and Qt Creator only want to create forms (which you can easily drop ui elements onto) or custom widgets, which only create code and do not automatically link in a ui file.
Is this an appropriate way to approach this problem and is there an easy way to drop in custom arrangements of controls?