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. QTableWidgetItem Class text = data(Qt::DisplayRole).toString()
QtWS25 Last Chance

QTableWidgetItem Class text = data(Qt::DisplayRole).toString()

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 2.7k 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.
  • D Offline
    D Offline
    doru001
    wrote on last edited by
    #1

    I found in some book the statement that the text property of QTableWidgetItem Class is equivalent to calling data(Qt::DisplayRole).toString(). My question is about assistant: how do I check the statement using assistant? I found no explanations of text and roles in QTableWidgetItem Class and no connection to Qt::DisplayRole. Should I expect that many parts of assistant can not be understood regardless how carefully they are read? I mean, some classes are not completely explained in the documentation?

    1 Reply Last reply
    0
    • raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      the doc page of the QTableWidgetItem class has a reference to this "page":http://qt-project.org/doc/qt-4.8/model-view-programming.html which gives an overview of the concept in Qt.

      To come back to your question:
      QTableWidgetItem is a helper class which does most of the work for you. But it builds upon also builds upon a "model":http://qt-project.org/doc/qt-4.8/qabstractitemmodel.html.
      It's "::data()":http://qt-project.org/doc/qt-4.8/qabstractitemmodel.html#data method should give you more clearness what the values mean.

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      0
      • D Offline
        D Offline
        doru001
        wrote on last edited by
        #3

        Thank you for your answer. I did not know that the concept of role is part of the model/view model. Now everything is clear.

        [quote author="raven-worx" date="1367068601"]the doc page of the QTableWidgetItem class has a reference to this "page":http://qt-project.org/doc/qt-4.8/model-view-programming.html which gives an overview of the concept in Qt.

        To come back to your question:
        QTableWidgetItem is a helper class which does most of the work for you. But it builds upon also builds upon a "model":http://qt-project.org/doc/qt-4.8/qabstractitemmodel.html.
        It's "::data()":http://qt-project.org/doc/qt-4.8/qabstractitemmodel.html#data method should give you more clearness what the values mean. [/quote]

        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