Qt Designer - expose children widget in Custom Container Widget Plugin
-
I hope I got your question right: You have items in a QListView, which you want to address individually when they are double clicked.
The signal clicked(const QModelIndex &) is indeed emitted by the QListView and not by its items.
You have to connect your slot to this signal as you did in your constructor.
In your methodsetCurrentIndex(const QModelIndex &index)
you can obtain the current item's row and column (which is the item that was clicked).const int myRow = index->row(); const int myColumn = index->column();
Depending on how the model of your QListView is designed and how you populate it, this can always direct you to the item in question.
-
thank you for yor reaction. my problem is i need the slot to execute in the qt designer becouse a try to create a custom widget plugin just lik the QTabWidget but insted of tab i want to use list to navigate between tha pages. so in the qt designer whene i click on one of the items the entrie widget clicked and not the only the item but whene i use the widget i created in any project and excuted it the wedget behave normally. so my problem is in the qt designer i hope i explained my point well
-
@MehdiGh
If I get you right, your multipagewidget is just like a QTabWidget turned to the left by 90°.
What you mean by "child" is actually a tab, each of which you want to populate with different widgets.
You have to look at the implementation of your custom widget. It seems to consist of a QListView, as displayed on the left side. This list view is (probably) on the same hierarchy level as your pages, which seem to be something like a QFrame or so. You need to handle the switching between pages on the level of the QListView inside your custom widget. The most straight forward implementation is to size all the frames (or whatever it is) equally, put them on the same position and hide/unhide them programmatically depending on the current row of the QListView. But I guess you know that.
If you want to fully integrate your custom widget in Qt Designer, you have to implement a plugin as described here.IMHO that is a lot of work for a QTabWidget turned to the left by 90°. I would consider populating your pages programmatically or going with a generic QTabWidget.