Results 1 to 4 of 4

Thread: Stand-alone colorbar (no canvas)

  1. #1
    Join Date
    Aug 2008
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Stand-alone colorbar (no canvas)

    Hi,

    I just recently started looking into QWT.

    Is it possible to create a widget that solely contains of a colorbar? So just the colormap, with a range, possibly ticks, labels and a title, and no raster/canvas?

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

    Default Re: Stand-alone colorbar (no canvas)

    This is a QwtScaleWidget.

    Uwe

  3. #3
    Join Date
    Aug 2008
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Stand-alone colorbar (no canvas)

    Quote Originally Posted by Uwe View Post
    This is a QwtScaleWidget.

    Uwe
    yes, I figured that much, but I'm not sure how to paint it using a QPainter as the draw function is protected and even subclassing it and making the draw function public results in the title or a colorbar being drawn, but not both.
    However I guess there is a better way to draw it using a QPainter object. Any example code in this regard is highly appreciated

  4. #4
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,277
    Thanked 871 Times in 819 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Stand-alone colorbar (no canvas)

    QwtScaleWidget is a widget - you don't need a QPainter to use it.

    Look at the spectrogram example how to use it - there is no difference between the scale widget of a plot widget or a standalone one.

    Uwe

Similar Threads

  1. When is the best time to delete a QCanvasItem
    By irudkin in forum Qt Programming
    Replies: 12
    Last Post: 8th March 2007, 21:28

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.