__qt__passive_
-
@MehdiGh said in __qt__passive_:
wath _qt_passive do ?
and why it doesn't work with QListView?When you don't know what it is why do you say that it does not work with QListView?
I don't know either what you mean with
_qt_passive
- there is neither a variable nor a define somehwere in the Qt sources -
Hi
Not even Google has ever heard about _qt_passive
so please show how its defined and used.Could be a #define in your project maybe.
-
__qt__passive_...
:https://stackoverflow.com/questions/18830689/access-custom-qtdesigner-plugins-child-widget-from-qtdisgner/
https://falsinsoft.blogspot.com/2016/02/qt-designer-develop-custom-widget.html:)
Basically you need to set a name to all the objects of your widget you want to have "mouse interactive" inside the Qt Designer using the special prefix in red:
pMyConrolObject->setObjectName("__qt__passive_ObjectName");
-
so please show how its defined and used.
so i try to create a Qt Designe's custom widget plugin just like QTabWidget but insted of using tab i want to work with listview and use items to navigate between pages so i started from this source that show how to create custom multi-page plugin for Qt Designer and they use QCombobox for the navigation. i did the same steps but i used Qlistview for the navigation and when i installed the custom widget in the Qt Designer it seem it doesn't receive the down and up mouse events with the result ican not move between pages of your widget.
my code:
MultiPageWidget::MultiPageWidget(QWidget *parent)
: QWidget(parent)
, stackWidget(new QStackedWidget)
, listView (new QListView)
, listModel (new ListModel)
{listView->setEditTriggers(QAbstractItemView::NoEditTriggers); listView->setSelectionRectVisible(true); listView->setModel(listModel); listView->setMouseTracking(true); listView->setObjectName(QStringLiteral("__qt__passive_listView")); connect(listView, SIGNAL(clicked(QModelIndex)), this, SLOT(setCurrentIndex(QModelIndex))); QHBoxLayout *layout = new QHBoxLayout(this); layout->addWidget(listView,1); layout->addWidget(stackWidget,2);
}
the documentation code:MultiPageWidget::MultiPageWidget(QWidget *parent)
: QWidget(parent)
, stackWidget(new QStackedWidget)
, comboBox(new QComboBox)
{
comboBox->setObjectName(QStringLiteral("__qt__passive_comboBox"));connect(comboBox, QOverload<int>::of(&QComboBox::activated), this, &MultiPageWidget::setCurrentIndex); QVBoxLayout *layout = new QVBoxLayout(this); layout->addWidget(comboBox); layout->addWidget(stackWidget);
}
-
__qt__passive_...
:https://stackoverflow.com/questions/18830689/access-custom-qtdesigner-plugins-child-widget-from-qtdisgner/
https://falsinsoft.blogspot.com/2016/02/qt-designer-develop-custom-widget.htmlthank you. i already seen these and it doesn't work with QListView i don't know why
-
This is some undocumented stuff which you can't rely upon.
-
Hi
For an undocumented features, its odd even the examples use it.So I guess the only fix for the listview would to include an extra property that
can change the active tab since its not possible to click on it. -
Hi
- Regarding why it dont work on ListView.
It has a viewport widget that actually gets the events.
So maybe you should add the "tag"listView->viewport()->setObjectName(QStringLiteral("__qt__passive_listViewViewPort"));