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. Qtreeview header mouse entered
QtWS25 Last Chance

Qtreeview header mouse entered

Scheduled Pinned Locked Moved General and Desktop
8 Posts 4 Posters 2.9k Views
  • 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.
  • D Offline
    D Offline
    DBGTMaster
    wrote on last edited by
    #1

    Hello,

    i have a qtreeview, when the mouse enteres the header line, the signal of QHeaderView is not emited? Why?

    @connect(view->header(), SIGNAL(sectionClicked(int)), &_retrospectiveBackupPopup, SLOT(doHide()));@

    The slot is never called :(!

    1 Reply Last reply
    0
    • JeroentjehomeJ Offline
      JeroentjehomeJ Offline
      Jeroentjehome
      wrote on last edited by
      #2

      first of all, when having problems with signals and slots and you have no idea where to start it is always a good idea to check if Qt really connected the signal/slot. The connect function returns a boolean value to indicate that.
      The main thing that pops-up are the arguments in your slot! The slot may never have other arguments then the signal provides! So the slot must have a int value as argument. That might do the trick. I'm also unsure if the sender can be only the header, but if the code compiles it might work.
      Hope this helps a bit, otherwise show a bit more code of your creation of the view and your slot to be called.
      Greetz

      Greetz, Jeroen

      1 Reply Last reply
      0
      • M Offline
        M Offline
        MianKashifAli
        wrote on last edited by
        #3

        use signal sectionEntered (int)

        1 Reply Last reply
        0
        • M Offline
          M Offline
          MianKashifAli
          wrote on last edited by
          #4

          you can use signal sectionEntered

          1 Reply Last reply
          0
          • M Offline
            M Offline
            Macro
            wrote on last edited by
            #5

            +1

            [quote author="Jeroentje@home" date="1360146421"]first of all, when having problems with signals and slots and you have no idea where to start it is always a good idea to check if Qt really connected the signal/slot. The connect function returns a boolean value to indicate that.
            The main thing that pops-up are the arguments in your slot! The slot may never have other arguments then the signal provides! So the slot must have a int value as argument. That might do the trick.
            Greetz[/quote]

            1 Reply Last reply
            0
            • D Offline
              D Offline
              DBGTMaster
              wrote on last edited by
              #6

              Thanks!

              when i use

              @connect(view->header(), SIGNAL(sectionEntered(int)), &_retrospectiveBackupPopup, SLOT(doHide(int)));@
              And i move with the mouse over the header, nothing happens.

              When i use sectionClicked(int), and i click on the header, it works...

              1 Reply Last reply
              0
              • M Offline
                M Offline
                MianKashifAli
                wrote on last edited by
                #7

                you can then reimplement widgets mouse event

                1 Reply Last reply
                0
                • JeroentjehomeJ Offline
                  JeroentjehomeJ Offline
                  Jeroentjehome
                  wrote on last edited by
                  #8

                  Maybe enable the mousetrack option? Might do the trick.

                  Greetz, Jeroen

                  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