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. qlabel html format
Forum Update on Monday, May 27th 2025

qlabel html format

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 340 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.
  • I Offline
    I Offline
    IknowQT
    wrote on last edited by
    #1

    101ef732-33bc-4d14-ba15-3d579d002d5e-image.png

    void QReportForm::CreateTable()
    {
    	QTextDocument textdoc;
    	QString html = "<table border=1 bordercolor=blue width =500 height=300 align =center><tr><td>First11</td><td>Second22</td></tr><tr><td>First33</td><td>Second44</td></ tr></table>";
    
    	this->ui.label_14->setTextFormat(Qt::RichText);
    	this->ui.label_14->setText(html);
    }
    

    42f2658c-7135-40ac-8bfb-d84fa6216db6-image.png

    I put a table in html format on the label, but it occupies the area of fixmap above, is there a solution to this?

    Pl45m4P 1 Reply Last reply
    0
    • I IknowQT

      101ef732-33bc-4d14-ba15-3d579d002d5e-image.png

      void QReportForm::CreateTable()
      {
      	QTextDocument textdoc;
      	QString html = "<table border=1 bordercolor=blue width =500 height=300 align =center><tr><td>First11</td><td>Second22</td></tr><tr><td>First33</td><td>Second44</td></ tr></table>";
      
      	this->ui.label_14->setTextFormat(Qt::RichText);
      	this->ui.label_14->setText(html);
      }
      

      42f2658c-7135-40ac-8bfb-d84fa6216db6-image.png

      I put a table in html format on the label, but it occupies the area of fixmap above, is there a solution to this?

      Pl45m4P Offline
      Pl45m4P Offline
      Pl45m4
      wrote on last edited by
      #2

      @IknowQT said in qlabel html format:

      I put a table in html format on the label, but it occupies the area of pixmap above

      It does not, I would say. It's your scrollArea.


      If debugging is the process of removing software bugs, then programming must be the process of putting them in.

      ~E. W. Dijkstra

      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