Important: Please read the Qt Code of Conduct -

[SOLVED] Require help on Dragging a Row From QTableview and drop into a sub-classed PushButton

  • Hello
    First of all, thanks for taking time to read my post.

    I am trying to acheive the following.
    On a form i have an array of pushbuttons (that are subclassed already from QPushbutton to mypushbutton - Events currently handled are EnterEvent and LeaveEvent) .

    1. I have a QTableView with QSqlQueryModel to fill in the data from a database.
    2. I need to be able to drag a row from the QTableView to a pushbutton.
      (a). Can a QSqlQueryModel be used to achieve this.
      (b). What functions do I need to subclass and re-implement in the QTableView.
      (c). What additional functions do I need to re-implement in mypushbutton class.

    Your thoughts and suggestions would be well appreciated.

  • Hi,

    drag and drop is well documented, even for models. Have a look "here":

Log in to reply