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. Making a view from a QPlainTextEdit

Making a view from a QPlainTextEdit

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.1k Views
  • 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 Offline
    F Offline
    frankiefrank
    wrote on last edited by
    #1

    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
    0
    • B Offline
      B Offline
      Brochadinho
      wrote on last edited by
      #2

      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
      0
      • F Offline
        F Offline
        frankiefrank
        wrote on last edited by
        #3

        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
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved