化工企業(yè)商城網(wǎng)站建設(shè)公司網(wǎng)絡(luò)銷售平臺上市公司有哪些
目錄
一、QLine界面相關(guān)
1、布局介紹
2、界面基本屬性
二、QLCDNumber的介紹
1、界面布局
2、定時器代碼測試?
三、QTextBrowser????
此文為作者原創(chuàng),創(chuàng)作不易,轉(zhuǎn)載請標(biāo)明出處!
一、QLine界面相關(guān)
1、布局介紹
先看下界面中創(chuàng)建個QLine,有水平方向,也有垂直方向
2、界面基本屬性
一般在界面布局時,如果需要有線條的使用時,可以添加此功能。如果想要更改線條的顏色,得先進行更改屬性中的frameShadow中的值為Plain,然后再來添加樣式效果
二、QLCDNumber的介紹
1、界面布局
更改下可顯示數(shù)目,如下:
2、定時器代碼測試?
MainWindow::MainWindow(QWidget *parent) :QMainWindow(parent),ui(new Ui::MainWindow)
{ui->setupUi(this);QTimer *timer = new QTimer(this);connect(timer,&QTimer::timeout,this,&MainWindow::TimeOutSlot);timer->start(100);
}MainWindow::~MainWindow()
{delete ui;
}void MainWindow::TimeOutSlot()
{QDateTime current_date_time =QDateTime::currentDateTime();QString current_date =current_date_time.toString("hh:mm:ss");ui->lcdNumber->display(current_date);
}
展示下效果如下:
?
三、QTextBrowser????
主要用于接收文本顯示作用,當(dāng)有文本接收過來,信號textChange()就會發(fā)生改變
插入文本:
ui->textBrowser->textCursor().insertText("hello_world");//插入文本到光標(biāo)位置
?
模擬定時器不斷的接收數(shù)據(jù):
QTimer *timer = new QTimer(this);
connect(timer,&QTimer::timeout,this,&MainWindow::TimeOutSlot);
timer->start(100);void MainWindow::TimeOutSlot()
{ui->textBrowser->textCursor().insertText("hello_world");//插入文本到光標(biāo)位置
}
測試接收槽函數(shù)的變化:
void MainWindow::on_textBrowser_textChanged()
{qDebug()<<"textBrowser";
}
?
展示如下:
推薦博客:精靈球Plus介紹_清風(fēng)徐來Groot的博客-CSDN博客?
百度云盤:鏈接:https://pan.baidu.com/s/11b634VvKMIsGdahyBLpZ3Q?? 提取碼:6666?
?
?
?