Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Making a view from a QPlainTextEdit

    General and Desktop
    2
    3
    877
    Loading More Posts
    • 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.
    • F
      frankiefrank 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.

      "Roads? Where we're going, we don't need roads."

      1 Reply Last reply Reply Quote 0
      • B
        Brochadinho 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);

        1 Reply Last reply Reply Quote 0
        • F
          frankiefrank 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.

          "Roads? Where we're going, we don't need roads."

          1 Reply Last reply Reply Quote 0
          • First post
            Last post