Hello
I am trying to do quite a simple thing. I just want to write the text "My Text" on a widget. But when I execute this piece of code, which in my opinion was the solution, I see only the widget but nothing is written on that. Can anyone tell me what have I done wrong? Here is the code
#include <qapplication.h>
#include <qpainter.h>
#include <qwidget.h>
int main(int argc, char **argv)
{
QApplication a(argc, argv);
QWidget w;
QPainter p(&w);
p.drawText(w.rect(), Qt::AlignHCenter, "My Text" );
w.show();
return a.exec();
}