So it works for top but fails for bottom, correct? Can you prepare a minimal compilable example reproducing the problem?
This seems to work fine:
#include <QtGui>
public:
protected:
p.drawText(rect(), Qt::AlignHCenter|Qt::AlignBottom, "Hier\nText\neingeben");
}
};
int main(int argc, char **argv) {
Widget w;
w.resize(449, 359);
w.show();
return app.exec();
}
#include <QtGui>
class Widget : public QWidget {
public:
Widget() : QWidget() {}
protected:
void paintEvent(QPaintEvent *) {
QPainter p(this);
p.drawText(rect(), Qt::AlignHCenter|Qt::AlignBottom, "Hier\nText\neingeben");
}
};
int main(int argc, char **argv) {
QApplication app(argc, argv);
Widget w;
w.resize(449, 359);
w.show();
return app.exec();
}
To copy to clipboard, switch view to plain text mode
Did you remember to put newline characters (\n) in your string? I can't see them in what you posted.
Bookmarks