QT5-control-QLabel and QLCDNumber-Label display pictures or videos. LCD is good for PC,
#ifndef MAINWINDOW_H#define MAINWINDOW_H#include <QMainWindow>#include <QLabel>#include <QLCDNumber>#include <QPixmap>class MainWindow : public QMainWindow{ Q_OBJECTpublic: MainWindow(QWidget *parent = 0); ~MainWindow(); QLabel* label[10]; QLCDNumber* lcd[10];};#endif // MAINWINDOW_H
# Include "mainwindow. h "MainWindow: MainWindow (QWidget * parent): QMainWindow (parent) {this-> resize (600,400); this-> centralWidget (); label [0] = new QLabel ("world, bad", this); label [0]-> setGeometry ); QPixmap pix = QPixmap ("res/01.png"); label [1] = new QLabel (this); label [1]-> setPixmap (pix ); label [1]-> setGeometry (300,300,); LCD [0] = new QLCDNumber (2, this); LCD [0]-> display ("24 "); LCD [0]-> s EtGeometry (200,100,); LCD [0] = new QLCDNumber (5, this); LCD [0]-> display "); LCD [0]-> setGeometry (350,150,200,100); // set the display style // QLCDNumber: The same color of the Outline display and window background // QLCDNumber :: the same color as the font for Filled display. // QLCDNumber: Flat does not show the style of the font outer box line. // LCD [1]-> setSegmentStyle (QLCDNumber: Filled);} MainWindow :: ~ MainWindow (){}
#include "mainwindow.h"#include <QApplication>int main(int argc, char *argv[]){ QApplication a(argc, argv); MainWindow w; w.show(); return a.exec();}