Hello!
I don't know why the code below is not working and I can't explain the way
1) widget->setScaleDraw(new draw()); calls the class draw so that it doesn't setAlignment on the widget.
I know two other ways to put it right such as
2) widget->setAlignment(QwtScaleDraw::TopScale)
3) widget->setScaleDraw(inst_draw = new draw());
But im not interested in them. I would like to particularly know why the first option is not working and what I'm missing to know.Thank you a lot!
class drawublic QwtScaleDraw{
public:
draw();
};
draw::draw(){this->setAlignment(QwtScaleDraw::TopScale);};
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QwtScaleWidget* widget = new QwtScaleWidget;
widget->setScaleDraw(new draw());
widget->show();
return a.exec();
}
Bookmarks