Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Mananing multiples Uis or using QGraphicsview ?
Qt 6.11 is out! See what's new in the release blog

Mananing multiples Uis or using QGraphicsview ?

Scheduled Pinned Locked Moved Unsolved General and Desktop
13 Posts 5 Posters 922 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    aftalib
    wrote on last edited by
    #3

    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

    1 Reply Last reply
    0
    • nageshN Offline
      nageshN Offline
      nagesh
      wrote on last edited by
      #4

      @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)
      
      A 1 Reply Last reply
      0
      • nageshN nagesh

        @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)
        
        A Offline
        A Offline
        aftalib
        wrote on last edited by
        #5

        @nagesh i didnt know about the promoting widget mechanism. how can i do this in my case ?

        1 Reply Last reply
        0
        • Christian EhrlicherC Online
          Christian EhrlicherC Online
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on last edited by
          #6

          @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

          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
          Visit the Qt Academy at https://academy.qt.io/catalog

          1 Reply Last reply
          1
          • A Offline
            A Offline
            aftalib
            wrote on last edited by
            #7

            ive tried this but it really doesnt solve my problem. it says that i have an "undefined reference" in my ui_ file

            1 Reply Last reply
            0
            • Christian EhrlicherC Online
              Christian EhrlicherC Online
              Christian Ehrlicher
              Lifetime Qt Champion
              wrote on last edited by
              #8

              @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.

              Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
              Visit the Qt Academy at https://academy.qt.io/catalog

              1 Reply Last reply
              0
              • A Offline
                A Offline
                aftalib
                wrote on last edited by
                #9

                what i should do according to this is promote my TreeView that is in my Ui with my treeView class right ?

                1 Reply Last reply
                0
                • Christian EhrlicherC Online
                  Christian EhrlicherC Online
                  Christian Ehrlicher
                  Lifetime Qt Champion
                  wrote on last edited by
                  #10

                  @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.

                  Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                  Visit the Qt Academy at https://academy.qt.io/catalog

                  1 Reply Last reply
                  0
                  • A Offline
                    A Offline
                    aftalib
                    wrote on last edited by
                    #11

                    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 ?

                    jeremy_kJ 1 Reply Last reply
                    0
                    • Christian EhrlicherC Online
                      Christian EhrlicherC Online
                      Christian Ehrlicher
                      Lifetime Qt Champion
                      wrote on last edited by
                      #12

                      @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.

                      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                      Visit the Qt Academy at https://academy.qt.io/catalog

                      1 Reply Last reply
                      0
                      • A aftalib

                        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 ?

                        jeremy_kJ Offline
                        jeremy_kJ Offline
                        jeremy_k
                        wrote on last edited by
                        #13

                        @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.

                        Asking a question about code? http://eel.is/iso-c++/testcase/

                        1 Reply Last reply
                        0

                        • Login

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • Users
                        • Groups
                        • Search
                        • Get Qt Extensions
                        • Unsolved