Using HTML with QLabel : QLabel « Qt « C++






Using HTML with QLabel

  

#include <QApplication>
#include <QMainWindow>
#include <QLabel>

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

    QMainWindow mainWindow;
    QLabel *label =new QLabel("<center>Central Widget</center>");
    mainWindow.setCentralWidget(label);
    mainWindow.show();

    return a.exec();
}

   
    
  








Related examples in the same category

1.Adding image to QLabel
2.Add a label and display
3.Clock label
4.Create a Label and show
5.Set tooltip for QLabel
6.Set QLabel buddy