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. Questions concerning QTableView and QListView
Qt 6.11 is out! See what's new in the release blog

Questions concerning QTableView and QListView

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 2 Posters 1.8k 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.
  • L Offline
    L Offline
    Lynxerious
    wrote on last edited by
    #1

    Hello everyone,

    I have to views that are QTableView and QListView, I could drag items from QTableView to QListView, I have some questions about this matter:
    -If I drag items to the white space of QListView it gonna append the list, but if the list view is full ( the vertical scroll bar appear) there is no longer white space, so it's impossible to append items to the list view, I could only drag on the last item of the list and insert the new one between the last item and the rest. Is there anyway to add some white space to the end of the list?
    -The QTableView items I had is really wide horizontally, so when I drag it has this big widget sticking to the mouse cursor. How can I change the UI of what I'm dragging?
    -I want to add some button on QTableView items whenever the user selected an item (it works similar to when you select a song in Groove Music, two buttons will appear). How to do this?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      1. Don't remember for that one
      2. You can subclass your model and reimplement startDrag, there you can set the image you want on the QDrag object.
      3. Implement your own QStyledItemDelegate

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      L 1 Reply Last reply
      1
      • SGaistS SGaist

        Hi,

        1. Don't remember for that one
        2. You can subclass your model and reimplement startDrag, there you can set the image you want on the QDrag object.
        3. Implement your own QStyledItemDelegate
        L Offline
        L Offline
        Lynxerious
        wrote on last edited by
        #3

        @SGaist Hello thank for you answer. I want to know one more thing is that how could I perform a middle mouse scroll while dragging. I need to move items in a view but it doesn't allow me to scroll.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          I don't know right now if it's implemented but it should rather be the view scrolling up/down when you are close to one of the uppper/lower edge.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          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