会员
周边
众包
新闻
博问
闪存
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
RedWetPlace
博客园
首页
新随笔
联系
管理
订阅
随笔- 324 文章- 0 评论- 2 阅读-
12万
10 2022 档案
QT——保存数据到文件,用户选择保存路径,在该路径下生成指定格式的文件,进行保存数据
摘要:QString wc_createdata = QFileDialog::getSaveFileName(NULL, QString::fromLocal8Bit("生成报告"), tr(".csv")); if (wc_createdata.at(wc_createdata.size()-1)==
阅读全文
posted @
2022-10-25 15:45
雾枫
阅读(312)
评论(0)
推荐(0)
编辑
qt 查看控件类型
摘要:qt的大部分控件都是基于QWidget的,所以有时需要通过一种方法判断获取到的Widget是哪种类型的控件; 解决文案是:QWidget->metaObject()->className(), 例如: ui->label->metaObject()->className() == "QLabel";
阅读全文
posted @
2022-10-23 15:08
雾枫
阅读(182)
评论(0)
推荐(0)
编辑
Qt获取QObject对应的类名并把它转为真实类型
摘要:QObject是有窗口类的父类,比如QWidget,QLabel,QPushButton等都直接或间接继承自QObject类。如果把某个窗口中的所有控件都装到一个QList<QObject*>中,那么如何区分当前的是那种类型控件呢? QObject *obj; if (obj->metaObject
阅读全文
posted @
2022-10-23 15:07
雾枫
阅读(488)
评论(0)
推荐(0)
编辑
QT——qt布局达不到理想状态,不妨调一下这里
摘要:
阅读全文
posted @
2022-10-22 00:16
雾枫
阅读(34)
评论(0)
推荐(0)
编辑
QT——QlineEdit输入完数据后,回车触发按钮
摘要:connect(wc_object_lineEditProjectName, &QLineEdit::returnPressed, [=]() { wc_object_lineEditProjectName->clearFocus(); wc_object_toolok->clicked(true)
阅读全文
posted @
2022-10-19 16:46
雾枫
阅读(1561)
评论(0)
推荐(0)
编辑
QT——设置窗口背景颜色以及透明度
摘要:void Mytoolbarwidget::_setBackgroundColor() { QColor color(255, 0, 255,25); QPalette pal(palette()); pal.setColor(QPalette::Background, color); setAut
阅读全文
posted @
2022-10-14 21:33
雾枫
阅读(291)
评论(0)
推荐(0)
编辑
QT——QTreeWidget树形控件,点击节点,获取给节点设定的编号
摘要:connect(ui.treewidget, SIGNAL(itemClicked(QTreeWidgetItem * , int )), this,SLOT(wc_fun_treewidgetTest(QTreeWidgetItem * , int ))); void Mainwidget::wc
阅读全文
posted @
2022-10-13 21:13
雾枫
阅读(676)
评论(0)
推荐(0)
编辑
QT——QVector二维数组使用注意事项
摘要:QVector<QVector<QString>> Vector(5); //必须先给定数组大小 Vector[i].append( wc_object_jsonobject.value("item").toString());
阅读全文
posted @
2022-10-12 16:45
雾枫
阅读(316)
评论(0)
推荐(0)
编辑
c++中使用and
摘要:#include <iso646.h> int main() { int a =0; int b =1; bool = a and b; }
阅读全文
posted @
2022-10-11 22:27
雾枫
阅读(200)
评论(0)
推荐(0)
编辑
QT——设置Qtablewidget指定单元格不能编辑
摘要:QTableWidgetItem* pItem = ui.tablewidget->item(iRowIndex, iColIndex); //获取该单元格的pItem pItem->setFlags(Qt::ItemIsEditable);
阅读全文
posted @
2022-10-09 15:54
雾枫
阅读(315)
评论(0)
推荐(0)
编辑
QT——QTableWidget样式设计
摘要:链接1 链接2 (1)创建一个新的表格控件 QTableWidget *table=new QTableWidget(); (2)设置列数 table->setColumnCount(3);//设置3列 注意:如果内容超过3列,则无法显示超过3列的内容,所以需要看情况重新设置列数 (3)设置行数 t
阅读全文
posted @
2022-10-09 15:46
雾枫
阅读(1602)
评论(0)
推荐(0)
编辑
QT——代码布局
摘要:#include "w_titlebarwidget.h" #include <QLabel> #include <QToolButton> #include <QHBoxLayout> #include <QDesktopWidget> #include <QApplication> #inclu
阅读全文
posted @
2022-10-08 20:47
雾枫
阅读(63)
评论(0)
推荐(0)
编辑
QT——代码添加弹簧,QSpacerItem
摘要:QWidget *w=new QWidget(this); w->setGeometry(0,0,500,80); QHBoxLayout *layout=new QHBoxLayout; QPushButton *button1=new QPushButton; QPushButton *butt
阅读全文
posted @
2022-10-08 20:23
雾枫
阅读(680)
评论(0)
推荐(0)
编辑
QT——删除文件夹(目录)下的所有内容
摘要:bool clearDir(QString path) { if (path.isEmpty()) { return false; } QDir dir(path); if (!dir.exists()) { return false; } dir.setFilter(QDir::AllEntrie
阅读全文
posted @
2022-10-06 00:41
雾枫
阅读(878)
评论(0)
推荐(0)
编辑
QT——删除目录(文件夹)
摘要:QString path = "D:\\file\\test"; QDir dir(path); dir.removeRecursively();
阅读全文
posted @
2022-10-06 00:28
雾枫
阅读(112)
评论(0)
推荐(0)
编辑
公告
昵称:
雾枫
园龄:
2年10个月
粉丝:
2
关注:
6
+加关注
<
2025年2月
>
日
一
二
三
四
五
六
26
27
28
29
30
31
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
1
2
3
4
5
6
7
8
搜索
常用链接
我的随笔
我的评论
我的参与
最新评论
我的标签
更多链接
我的标签
c++
(13)
return
(1)
指针
(1)
运算符
(1)
用户标识符命名
(1)
项目练习
(1)
数组
(1)
数据类型
(1)
结构体
(1)
函数
(1)
更多
随笔分类
C++ 收集(1)
c++学习笔记(26)
linux(15)
navicat(1)
Opencv(1)
OpenGL学习(17)
osg学习(3)
qt(146)
Qt cmake项目CMakeLists.txt文件(内容,写法)(9)
Redmine(1)
stm32(10)
vtk(1)
软件功能设计笔记(2)
我的工具(qt、c++)(1)
小笔记(21)
银河麒麟操作系统使用(4)
随笔档案
2025年2月(1)
2025年1月(1)
2024年12月(1)
2024年9月(1)
2024年8月(4)
2024年7月(6)
2024年6月(8)
2024年5月(6)
2024年4月(22)
2024年3月(3)
2024年2月(8)
2024年1月(4)
2023年12月(8)
2023年11月(8)
2023年10月(6)
2023年9月(3)
2023年8月(2)
2023年7月(3)
2023年6月(10)
2023年5月(8)
2023年4月(15)
2023年3月(23)
2023年2月(8)
2023年1月(3)
2022年12月(10)
2022年11月(12)
2022年10月(15)
2022年9月(12)
2022年8月(12)
2022年7月(15)
2022年6月(35)
2022年5月(14)
2022年4月(37)
更多
阅读排行榜
1. Qt——(复制)拷贝一个文件夹下的所有内容到另一个文件夹下(5476)
2. QT——LineEdit输入框,输入完数据,按下回车,让输入框失去焦点,可以表示内容输入完毕,执行一些操作。(3333)
3. c++指定路径创建文件(3298)
4. Qt执行bat批处理文件(3141)
5. Qt——QString 设置固定的小数位数,去掉小数点后的0(2893)
评论排行榜
1. QT QGraphicsView 如何实现图片按照鼠标点进行放大缩小效果(2)
推荐排行榜
1. cmake管理qt项目,设置windows和linux下生成的程序图标,以及任务栏显示设置的图标(1)
2. qt——自己手动添加菜单栏、工具栏(自定义菜单栏、工具栏的位置)(1)
3. Qt_——关联xml文件(获取xml文件里的节点数据)(1)
4. Qt——(复制)拷贝一个文件夹下的所有内容到另一个文件夹下(1)
5. Qt执行bat批处理文件(1)
最新评论
1. Re:QT QGraphicsView 如何实现图片按照鼠标点进行放大缩小效果
@pysun 不好意思,好久之前的了我忘记了。代码应该贴全的,下次注意。...
--雾枫
2. Re:QT QGraphicsView 如何实现图片按照鼠标点进行放大缩小效果
matrix 是哪里冒出来的?
--pysun
点击右上角即可分享