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. TableWidget creates new row after item drop from listWidget

TableWidget creates new row after item drop from listWidget

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 270 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.
  • ApprenticeRenoA Offline
    ApprenticeRenoA Offline
    ApprenticeReno
    wrote on last edited by
    #1

    Hi guys, i have a listWidget that contains some items that i drag and drop in a table widget. The problem is, if i drop an item in the space out of the table it creates a new row with the item that i've dropped. How can i prevent this behaviour ? There is something like : ui->tableWidget->setMaximumRow/Col ?
    thanks.

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

      Hi,

      I would say that you have to reimplement the dragEnter and dragMove event and refuse the event if not on top of a cell.

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

      ApprenticeRenoA 1 Reply Last reply
      1
      • SGaistS SGaist

        Hi,

        I would say that you have to reimplement the dragEnter and dragMove event and refuse the event if not on top of a cell.

        ApprenticeRenoA Offline
        ApprenticeRenoA Offline
        ApprenticeReno
        wrote on last edited by
        #3

        @SGaist thank you.

        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