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. Drag from QHeaderView
Qt 6.11 is out! See what's new in the release blog

Drag from QHeaderView

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 2.7k 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.
  • Q Offline
    Q Offline
    quadbyte
    wrote on last edited by
    #1

    Hi All,

    I try to drag horizontal Header of a QTableView but I have no success with :

    @ ui->tableview->horizontalHeader()->setDragEnabled(true);
    ui->tableview->horizontalHeader()->setDragDropMode(QAbstractItemView::DragOnly);@

    drop mechanism seems to be ok as I can drop all cells of the tableView itself without problem to my drop widget.

    Nothing found that way in the forum. Any idea is welcome.

    1 Reply Last reply
    0
    • EddyE Offline
      EddyE Offline
      Eddy
      wrote on last edited by
      #2

      it doesn't mean that if you can drag and drop your cells that you can drag and drop headers. Those are two separate things.

      from the QHeaderView docs :
      Moving Header Sections

      A header can be fixed in place, or made movable with setMovable()....

      it might be a good idea to use also setDropIndicatorShown(true);

      Qt Certified Specialist
      www.edalsolutions.be

      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