Results 1 to 8 of 8

Thread: QwtPlot display title border problem

  1. #1
    Join Date
    Apr 2014
    Posts
    2
    Qt products
    Qt4

    Default QwtPlot display title border problem

    Hello, I have problem with border of title of my QwtPlot. On screenshot you can see that right and bottom border is hidden? or rendered incorrectly.

    Piece of code:
    Qt Code:
    1. QwtText text = plot->titleLabel()->text();
    2. text.setBorderPen(QPen(Qt::blue));
    3. plot->titleLabel()->setText(text);
    To copy to clipboard, switch view to plain text mode 

    Screenshot :
    problem.png

    Is there any solution? What am I doing wrong ? I use Qwt 6.1.0.

  2. #2
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,311
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QwtPlot display title border problem

    Looks like a bug QwtText. An quick fix might be to change qwt_text.cpp, line 582:

    Qt Code:
    1. QwtPainter::drawRect( painter, rect.adjusted( 0, 0, -1, -1 ) );
    To copy to clipboard, switch view to plain text mode 

    But I can see several other places in the layout code of QwtTextLabel, where margins etc are missing in the layout code.

    Uwe

  3. #3
    Join Date
    Apr 2014
    Posts
    2
    Qt products
    Qt4

    Default Re: QwtPlot display title border problem

    Thank you for response. Unfortunately I am not able to modify Qwt library. I have to look for another workaround.

  4. #4
    Join Date
    Nov 2014
    Posts
    5
    Thanks
    3
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Windows

    Default Re: QwtPlot display title border problem

    I am also experiencing this problem as well--See attachment.

    Has this been fixed in the most recent releases?

    Cheers,

    Chris
    Attached Images Attached Images

  5. #5
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,311
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QwtPlot display title border problem

    No, but how is your screen shot related to a frame around the plot title ?

    Uwe

  6. #6
    Join Date
    Nov 2014
    Posts
    5
    Thanks
    3
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Windows

    Default Re: QwtPlot display title border problem

    I am missing the right and bottom border on my canvas when it renders and haven't been able to get them to show up--I assumed that the two issues were related. Is this a known issue? I have been sure to set the QFrame shape, line width, and pen on the frame, but I still have the bottom and right side border missing.

  7. #7
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,311
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QwtPlot display title border problem

    Your screen shot shows a canvas with a sunken frame, that gets lost because you can't see white on white. What happens when setting a colored background for the canvas or using a different type of frame ?

    Uwe

  8. The following user says thank you to Uwe for this useful post:

    BagpipesJohnson (11th November 2014)

  9. #8
    Join Date
    Nov 2014
    Posts
    5
    Thanks
    3
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Windows

    Default Re: QwtPlot display title border problem

    Many thanks---Setting the QFrame style to plain box did it. Cheers.

Similar Threads

  1. How to remove title but with frame border?
    By shaoli.xie in forum Qt Programming
    Replies: 4
    Last Post: 11th April 2012, 14:14
  2. qwtplot title alignment
    By ken123 in forum Qwt
    Replies: 1
    Last Post: 20th October 2011, 06:30
  3. Replies: 5
    Last Post: 26th June 2011, 11:43
  4. How to remove QMainWindow's title and border
    By meraj ansari in forum Qt Programming
    Replies: 1
    Last Post: 13th May 2010, 17:22
  5. Replies: 4
    Last Post: 13th July 2009, 18:18

Tags for this Thread

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.