QLabel

The QLabel widget provides a text or image display.

Content  Setting
Plain text  Pass a QString to setText().
Rich text Pass a QString that contains rich text to setText().
A pixmap Pass a QPixmap to setPixmap().
A movie Pass a QMovie to setMovie().
A number  Pass an int or a double to setNum(), which converts the number to plain text.
Nothing  The same as an empty plain text. This is the default. Set by clear().

 

Header: #include <QLabel>
qmake: QT += widgets
Inherits: QFrame

 

插入图片:

 

插入动态图片:

    QMovie *movie = new QMovie("../cruiseSystem/images/2015111016272032815.gif");
    ui->label->setMovie(movie);
    QSize size = ui->label->size();
    movie->setScaledSize(size);
    movie->start();

 

 

posted on 2015-12-03 15:41  微末凡尘12138  阅读(169)  评论(0编辑  收藏  举报

导航