How can i create my custom ComboBox?
-
@Yaldiz Depends on the amount of changes you want to do compared to standard combo box.
Also, are we talking about widgets or QML.
For widgets you can either subclass QComboBox and implement your changes or implement your own combo box from scratch. -
@Yaldiz said in How can i create my custom ComboBox?:
Can I change the default views with the method you specified?
I don't know what exactly you want to achieve.
What is "custom objects locations" (what objects?)?
What is "custom geometry"? -
@Yaldiz This still not answers how / what you need different from a normal combobox. How should your combobox look like? What's not achievable with the normal one?
-
@Yaldiz said in How can i create my custom ComboBox?:
I want to use my custom widgets, labels like combobox items
See https://doc.qt.io/qt-5/qcombobox.html
"QComboBox uses the model/view framework for its popup list and to store its items. By default a QStandardItemModel stores the items and a QListView subclass displays the popuplist. You can access the model and view directly (with model() and view()), but QComboBox also provides functions to set and get item data (e.g., setItemData() and itemText()). You can also set a new model and view (with setModel() and setView()). For the text and icon in the combobox label, the data in the model that has the Qt::DisplayRole and Qt::DecorationRole is used. Note that you cannot alter the SelectionMode of the view(), e.g., by using setSelectionMode()."Regarding style see https://doc.qt.io/qt-5/stylesheet-syntax.html