Mananing multiples Uis or using QGraphicsview ?
-
here's what i'm trying to do :
AntArrayDialog w1; connect(ui->treeView,&TreeView::currentItemChanged,&w1,&AntArrayDialog::setFileName);so let met explain : AntArrayDialog is my first Window. i am declaring it in order the method that i want to use here, which is setFileName
in this current window, we have a TreeView, and i also have a treeview class where i reimplemented the eventFilter() method in order to get the signal that you see in the connect (&TreeView::currentItemChanged)
but this code doesnt work. i know that what you wrote is correct but i dont know how to use it in my case
-
@aftalib does your ui treeview is promoted widget?
in this current window, we have a TreeView, and i also have a treeview class where i reimplemented the eventFilter() method in order to get the signal that you see in the connect (&TreeView::currentItemChanged) -
@aftalib does your ui treeview is promoted widget?
in this current window, we have a TreeView, and i also have a treeview class where i reimplemented the eventFilter() method in order to get the signal that you see in the connect (&TreeView::currentItemChanged) -
@aftalib said in Mananing multiples Uis or using QGraphicsview ?:
how can i do this in my case ?
By reading: https://doc.qt.io/qt-5/designer-using-custom-widgets.html
-
@aftalib said in Mananing multiples Uis or using QGraphicsview ?:
it says that i have an "undefined reference" in my ui_ file
read again and think over on how we should help you with this information.
-
@aftalib said in Mananing multiples Uis or using QGraphicsview ?:
what i should do according to this is promote my TreeView that is in my Ui with my treeView class right ?
I don't understand what you're trying to tell me.
The documentation clearly shows you how to promote a QTreeView to a custom TreeView. That your custom TreeView must derive from QTreeView then should be out of question then.
-
i'm sorry, i really dont understand the concept behind this. What i have is :
a Ui File, which i have put a normal TreeView inside of it
a treeview.h and treeview.cpp file where i have redefined the eventFilter() method in order to get the signal i want.
what is the custom TreeView youre talking about ?
-
@aftalib said in Mananing multiples Uis or using QGraphicsview ?:
what is the custom TreeView youre talking about ?
a custom TreeView is a class derived from QTreeView.
-
i'm sorry, i really dont understand the concept behind this. What i have is :
a Ui File, which i have put a normal TreeView inside of it
a treeview.h and treeview.cpp file where i have redefined the eventFilter() method in order to get the signal i want.
what is the custom TreeView youre talking about ?
@aftalib said in Mananing multiples Uis or using QGraphicsview ?:
a treeview.h and treeview.cpp file where i have redefined the eventFilter() method in order to get the signal i want.
What does this mean?
QObject::eventFilter isn't usually involved in application code related to signals and slots.