欢迎光临
我们一直在努力

QT新手日记22

动画特效
QPropertyAnimation类
引用它
#include<QPropertyAnimation>

使用动画效果
QPropertyAnimation * an = new QPropertyAnimation(this,"Geometry");
an->setDuration(ms);//间隔
an->setStartValue(QRect(x,y,w,h));//起始位置
an->setEndValue(QRect(x,y+10,w,h));//结束位置
an->setEasingCurve();//QEasing :: OutQuan
an->start();

系统延时
引用
#include<QTimer>
调用功能
QTimer :: singleShot(500ms,this,[=](){
延时之后执行的操作。
})

窗口设置固定大小
this->setFixedSize(w,h);
窗口设置图标
this->setWindowIcon(QPixmap("资源图片");
窗口设定标题内容
this->setWindowTitle("标题");

基本功能的Qt就差不多了。其他的细节要多学多用学练。
下一期开始高阶了。多线程QThread。

 

赞(0)
未经允许不得转载:171主机测评 » QT新手日记22
分享到: 更多 (0)

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址