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. qDebug() - QStandardItemModel

qDebug() - QStandardItemModel

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 2 Posters 509 Views 1 Watching
  • 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.
  • K Offline
    K Offline
    kzkhalil1988
    wrote on last edited by
    #1

    I have a table of type (QStandardItemModel) of 3 lines and 1 colone.
    table = new QStandardItemModel (3,1, this);
    I want to display (qDebug()) just the second box of this table.
    How do I do?

    Gojir4G 1 Reply Last reply
    0
    • K kzkhalil1988

      I have a table of type (QStandardItemModel) of 3 lines and 1 colone.
      table = new QStandardItemModel (3,1, this);
      I want to display (qDebug()) just the second box of this table.
      How do I do?

      Gojir4G Offline
      Gojir4G Offline
      Gojir4
      wrote on last edited by
      #2

      @kzkhalil1988 hi,

      qDebug() << table->item(1, 0)->text(); //Display text of row #2 
      //or
      qDebug() << table->data(table->index(1, 0)); //Display data (QVariant) of row #2
      
      K 1 Reply Last reply
      3
      • Gojir4G Gojir4

        @kzkhalil1988 hi,

        qDebug() << table->item(1, 0)->text(); //Display text of row #2 
        //or
        qDebug() << table->data(table->index(1, 0)); //Display data (QVariant) of row #2
        
        K Offline
        K Offline
        kzkhalil1988
        wrote on last edited by
        #3

        @Gojir4 said in qDebug() - QStandardItemModel:

        qDebug() << table->item(1, 0)->text()

        thank you
        the problem is resolved

        Gojir4G 1 Reply Last reply
        0
        • K kzkhalil1988

          @Gojir4 said in qDebug() - QStandardItemModel:

          qDebug() << table->item(1, 0)->text()

          thank you
          the problem is resolved

          Gojir4G Offline
          Gojir4G Offline
          Gojir4
          wrote on last edited by Gojir4
          #4

          @kzkhalil1988 Glad you solved it ! Please do not forget to mark the post as solved. Thank you !

          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