PDA

View Full Version : Stand-alone colorbar (no canvas)



llamas
13th August 2008, 12:29
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?

Uwe
13th August 2008, 14:53
This is a QwtScaleWidget.

Uwe

llamas
19th August 2008, 21:49
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 :)

Uwe
20th August 2008, 09:47
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