Selected Rows in QTableView, copy to QClipboard

后端 未结 12 675
别那么骄傲
别那么骄傲 2020-12-25 08:14

I have a SQLite-Database and I did it into a QSqlTableModel. To show the Database, I put that Model into a QTableView.

Now I want to create

12条回答
  •  渐次进展
    2020-12-25 08:34

    What you'll need to do is access the text data in the model, then pass that text to the QClipboard.

    To access the text data in the model, use QModelIndex::data(). The default argument is Qt::DisplayRole, i.e. the displayed text.

    Once you've retrieved the text, pass that text to the clipboard using QClipboard::setText().

提交回复
热议问题