Hi,

use Following program
Qt Code:
  1. #include <QtGui/QApplication>
  2. #include <QLabel>
  3. #include <QPushButton>
  4. #include<QtGui>
  5.  
  6. int main(int argc, char *argv[])
  7. {
  8. QApplication a(argc, argv);
  9.  
  10. QPushButton *button = new QPushButton(Main);
  11. QLabel *label = new QLabel(Main);
  12. label->setText("<h2><i>Hello</i> ""<font color=red>Qt!</font></h2>");
  13. label->setVisible(true);
  14. label->setGeometry(30,30,40,80);
  15. QObject::connect(button, SIGNAL(clicked()),label, SLOT(clear()));
  16. label->setAlignment(Qt::AlignCenter|Qt::AlignVCenter);
  17. label->setWindowTitle("HelloWorld Test Program");
  18. Main->show();
  19. return a.exec();
  20. }
To copy to clipboard, switch view to plain text mode