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. QTextTable

QTextTable

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

    Hi, how set text background color in a table cells?

    Taz742T 1 Reply Last reply
    0
    • B bogdann

      Hi, how set text background color in a table cells?

      Taz742T Offline
      Taz742T Offline
      Taz742
      wrote on last edited by Taz742
      #2

      @bogdann
      tableWidget->setItem(row, column, new QTableWidgetItem);
      tableWidget->item(row, column)->setBackground(Qt::red);

      Do what you want.

      B 1 Reply Last reply
      0
      • Taz742T Taz742

        @bogdann
        tableWidget->setItem(row, column, new QTableWidgetItem);
        tableWidget->item(row, column)->setBackground(Qt::red);

        B Offline
        B Offline
        bogdann
        wrote on last edited by
        #3

        @Taz742 Me need QTextTable, not QTableWidget

        1 Reply Last reply
        0
        • EddyE Offline
          EddyE Offline
          Eddy
          wrote on last edited by
          #4

          Hi bogdann,

          Try this :

          QTextTableCell cell = table->cellAt(2, 3); 
          
          QTextCharFormat format = cell.format(); 
          format.setBackground(Qt.blue); 
          
          cell.setFormat(format);
          

          Eddy

          Qt Certified Specialist
          www.edalsolutions.be

          1 Reply Last reply
          4

          • Login

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