LCD font:Qt's basic controls - display controls-Font Tutorial免费ppt模版下载-道格办公

Qt's basic controls - display controls

You can add resource files (such as images) to a Qt project and use label controls to display these resources. 1. First, create a resource file (.qrc) in the project. Right-click on the project folder, select "Add New", enter a name, such as "resources",

display control

1, label

The function is to display some text , or for mapping

1. Way of loading resources: Right-click the project -->add new

Enter the name, you can get a package of qrc, and then add the prefix /image to this position to indicate the picture

Then add the file to add it to the resource

2. lable set the text content through setText

ui->label_2->setText(" Today is the second class of QT");

3, lable set pictures by setPixmap

QPixmap mImage=QPixmap(":/image/C:/Users/yxd/Desktop/image/png/chudai.png");//This is the path ui-> label_6->setScaledContents(true);//Setting can be scaled ui->label_6->setPixmap(mImage);

4, lable set the gif image through setMovie

QMovie *pMovie=new QMovie(":/image/C:/Users/yxd/Desktop/image/gif/C++ .gif");ui->label_8->setFixedSize(300,168);//Set the size of the animation ui->label_8->setMovie(pMovie);pMovie->start(); 

2, textbrowser

provides a rich text browser with hypertext navigation device

【Lead QT Development Tutorial learning materials, Click the link below to collect the fee ↓↓, code first to not get lost~]

Click → Receive "Link"

3. ​​LCD number

Display the number in LCD font

ui->lcdNumber->display(QTime::currentTime().toString("hh:mm:ss"));ui->lcdNumber_2->display(QTime::currentTime( ).toString("hh:mm:ss:zzz"));//zzz displays milliseconds

4. progressBar

progress bar

Through the F4 mode, associate the scroll bar, and move according to the progressBar

setMaximum(int) set maximum value setValue(int) set value setMinimum(int) set minimum value

Articles are uploaded by users and are for non-commercial browsing only. Posted by: Lomu, please indicate the source: https://www.daogebangong.com/en/articles/detail/Qts%20basic%20controls%20%20display%20controls.html

Like (810)
Reward 支付宝扫一扫 支付宝扫一扫
single-end

Related Suggestion