随笔分类 -  QT

摘要:设置QStackedWidget背景 设置QStackedWidget背景时其他在窗口内的内容样式均发生改变的解决办法: QStackedWidget#stackedWidget{background-image: url(:/new/pix/pix/jianbian.jpg);} 阅读全文 »
posted @ 2022-05-11 11:13 西北小蚂蚁 阅读(45) 评论(0) 推荐(0) 编辑
摘要:1、键盘事件 #include <QKeyEvent> void keyPressEvent(QKeyEvent *event); //键盘事件 //按键会触发此函数 void Widget::keyPressEvent(QKeyEvent *event) { //按下A执行的动作 if(event 阅读全文 »
posted @ 2022-05-09 10:21 西北小蚂蚁 阅读(90) 评论(0) 推荐(0) 编辑
摘要:main.cpp #include "myapp.h" #include <QApplication> int main(int argc, char *argv[]) { QApplication a(argc, argv); myapp w; w.show(); return a.exec(); 阅读全文 »
posted @ 2022-05-05 11:38 西北小蚂蚁 阅读(115) 评论(0) 推荐(0) 编辑
摘要:#include <windows.h> Sleep(1000);//延时一秒 阅读全文 »
posted @ 2022-04-29 10:03 西北小蚂蚁 阅读(129) 评论(0) 推荐(0) 编辑
摘要:1、显示图片: ui->label->setStyleSheet("border-image: url(:/new/prefix1/BiaoGe.png);");//在lable1插图片 #include <QMovie> QMovie *mov = new QMovie(":/new/prefix 阅读全文 »
posted @ 2022-04-28 11:12 西北小蚂蚁 阅读(101) 评论(0) 推荐(0) 编辑
摘要:一、重载resizeEvent 1、添加mymessagebox.cpp文件 #include "mymessagebox.h" MyMessageBox::MyMessageBox(QWidget *parent) : QMessageBox(parent), _width(0), _height 阅读全文 »
posted @ 2021-08-12 10:59 西北小蚂蚁 阅读(2381) 评论(2) 推荐(0) 编辑
摘要:一、学到的东西: 1、gcc *.c可以同时编译当前文件夹下的所有文件 二、客户端代码: 1、设计界面: 2、.pro QT += core gui QT += network QT += core greaterThan(QT_MAJOR_VERSION, 4): QT += widgets CO 阅读全文 »
posted @ 2021-07-22 18:54 西北小蚂蚁 阅读(421) 评论(1) 推荐(1) 编辑
摘要:一、设计的界面内容 二、.pron内加代码 QT += network 三、widget.h #ifndef WIDGET_H #define WIDGET_H #include <QWidget> #include <QTcpSocket> QT_BEGIN_NAMESPACE namespace 阅读全文 »
posted @ 2021-07-21 18:14 西北小蚂蚁 阅读(251) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示