Making a view from a QPlainTextEdit
-
wrote on 17 Jul 2014, 17:08 last edited by
I'm trying to find some pointers for using a QPlainTextEdit as a view for a QAbstractTableModel. Unfortunately Google seems to only bring me threads that deal with using QPlainTextEdit as an editor inside a QTableView.
The idea is to have a read-only QPlainTextEdit that is updated with data based on the QAbstractTableModel. For example, a scrollbar would represent size of the model, the actual data displayed would be based on where you are in the model.
Can anyone say where I should even start from? I'm surprised that using a text-editor is not so common in the model/view scenarios.
-
wrote on 17 Jul 2014, 18:30 last edited by
i'm a bit newbie, but i would try to make a connect(signal/slot) from the scroll valeuChange, to a slot that do something like QPlainTextEdit->setData(index, QAbs->dataThatIWant() ,qt:DisplayRole);
-
wrote on 20 Jul 2014, 08:25 last edited by
Thanks for your idea Brochadinho. I'm not sure still how to proceed with it, but you may have nudged me to some good direction. Or not - we will see.
Any other input from members is still welcome.
1/3