Results 1 to 4 of 4

Thread: margins in QSimpleRichText

  1. #1
    Join Date
    Jan 2006
    Location
    Poland/Poznań
    Posts
    14
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default margins in QSimpleRichText

    Qt automaticly adds some margins to every QSimpleRichText. What can I do to avoid this behaviour?

  2. #2
    Join Date
    Jan 2006
    Location
    Paris, France
    Posts
    227
    Thanks
    3
    Thanked 21 Times in 21 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: margins in QSimpleRichText

    I think it must be related to the parent widget, containing the QSimpleRichText object.

    What is exactly the parent widget ?

    Guilugi.

  3. #3
    Join Date
    Jan 2006
    Location
    Poland/Poznań
    Posts
    14
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: margins in QSimpleRichText

    no, it is not connected with parent widget.
    look at this code:
    Qt Code:
    1. QSimpleRichText rich_text("<img src=image.jpg border=0>", app.font());
    2. QRect rect(0, 0, rich_text.widthUsed(), rich_text.height());
    3. QPixmap buffer(rect.size());
    4. buffer.fill(Qt::red);
    5.  
    6. QPainter p( &buffer );
    7. rich_text.draw(&p, 0, 0, rect, app.palette().active());
    8. p.end();
    9.  
    10. QLabel *label = new QLabel(0);
    11. label->setPixmap(buffer);
    12. label->show();
    To copy to clipboard, switch view to plain text mode 
    This "image.jpg" is an green image 150px*150px.
    Now look at results:

    red borders are QSimpleRichText's margins.

  4. #4
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    99
    Thanks
    1
    Thanked 3 Times in 3 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: margins in QSimpleRichText

    There is a similar thread active about these margins :

    see :
    http://www.qtcentre.org/forum/showthread.php?t=511
    As far as I can see there is no solution yet for QT3.

Similar Threads

  1. Replies: 2
    Last Post: 7th March 2024, 12:40
  2. left and right margins in QPrinter
    By igor_x in forum Newbie
    Replies: 0
    Last Post: 2nd November 2006, 10:42
  3. QComboBox Margins
    By ToddAtWSU in forum Qt Programming
    Replies: 1
    Last Post: 19th August 2006, 11:58
  4. Force redraw of QSimpleRichText when QStyleSheet changes
    By SHesselbarth in forum Qt Programming
    Replies: 1
    Last Post: 12th April 2006, 16:10
  5. width in QSimpleRichText
    By Pan Wojtas in forum Qt Programming
    Replies: 1
    Last Post: 28th January 2006, 21:29

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.