- 博客(145)
- 资源 (32)
- 收藏
- 关注
原创 sqlite 损坏 修复
修复可以使用Undark、Recovery Toolbox for SQLite、 SQLite Forensic Explorer、Stellar Phoenix SQLite Repai 等工具。2sqlite3 test.db < create_table.sql (参考。1.创建一个新的数据库 例如名字叫 test.db。下载sqlite3 对应的系统版本。
2024-03-07 10:34:53 538
原创 QTableView 和 QAbstractTableModel 或QStandardItemModel
QTableView 使用 QAbstractTableModel 委托
2023-11-22 17:44:30 875
原创 使用 QuaZi 解压和打包 添加密码
解压 包括密码bool zipDirWithPassword(const QString &zipName,const QString &dirPATH,const QString& password){ QuaZip zip(zipName); if (!zip.open(QuaZip::mdCreate)) { qWarning("Couldn't open %s", zipName.toUtf8().constData()
2022-05-23 12:09:02 532
原创 QSS 设置图标位置
若想让图标显示的位置 在 某个像素和百分比 不起作用 例如如下例子background-image: url('/i/eg_bg_03.gif');background-repeat: no-repeat;background-attachment:fixed;background-position: 30% 100%;改为如下: 参考qt - Annoying Background-Position problem - Stack Overflowborder: 1px solid #.
2021-12-31 15:12:50 924
原创 qt 线程问题 信号触发 使其 槽函数在子线程中运行
系统:win10qtcreater:5.12.10条件:使用this->moveToThread( &m_thread );//m_thread 为QThread 的对象//this 为一个继承Qobject的类 此例中为ADThread目标 触发信号 使其槽函数在m_thread (子线程)中运行。现象:1:类中 使用ADThread 的信号触发的化 只能在其成员方法中触发 可以 2:类外 使用ADThread 继承基类的信号触发 ...
2021-12-24 16:35:21 2770
原创 QTCreater debug 没问题 reslase 崩溃
release 调试运行有时 会提示如下:QObject::killTimer: Timers cannot be stopped from another threadrelease 运行 崩溃debug 运行和调式 都没有问题开始一直找哪里使用 timer了最后一点一点的缩小范围 是一个内存 越界了 类似如下:int * data[5];for(i=0;i<6;i++)data[i] = new int[10];这个提示很坑,得此记录!...
2021-11-24 15:39:14 463
原创 nanomsg的SURVEY 模式 设置 接收超时时间
使用SURVEY 模式 使用nn_setsockopt(m_fd, NN_SOL_SOCKET, NN_RCVTIMEO, &timeout,sizeof(int));修改默认的超时时间 没有起作用。各种查找 设置只找到python使用类似的方法设置。nn_recv(m_fd, &buf, NN_MSG, 0); //这里超时默认时间是1s最后在官方自带的例子中int deadline = 500;rc = nn_setsockopt (surveyor, NN_SU
2021-11-12 13:39:50 686
原创 qt QTimer 提示 不能在另外一个线程停止
发送 信号 停止 timer 提示QObject::killTimer: Timers cannot be stopped from another threadQObject::~QObject: Timers cannot be stopped from another thread调试状态没有问题发送信号量启动也没有问题搞了半天查案看是m_timer.moveToThread( &m_thread );this->moveToThread( &m_thr
2021-11-12 10:39:19 4755
原创 Qt 主窗口不能最大化
问题现象:1.使用setWindowState(Qt::WindowMaximized);和showMaximized();都不能最大化2.使用以下2句也不能最大化showMaximized();QWidget::setWindowFlags(Qt::WindowMaximizeButtonHint | Qt::WindowCloseButtonHint | Qt::WindowMinimizeButtonHint);出现的界面最大化按钮鼠标放过去显示的提示是“向下还原”最后参考:ht
2021-11-03 10:37:30 3219 1
原创 qt 自定义printf
#include "customizeprint.h"#include <stdio.h>#include <stdarg.h>#include "SocketCMD.h"#if defined __WIN64#define __crt_va_arg(ap, t) \ ((sizeof(t) > sizeof(__int.
2021-09-08 10:03:18 451
原创 QT5.12.10 连接mysql8.0.23
问题 连接提示错误错误QSqlDatabase:QMYSQL Driver not loadedQSqlDatabase: QMYSQL driver not loaded QSqlDatabase: available drivers: QSQLITE QMYSQL3 QODBC QODBC3 QPSQL QPSQL7 "Driver not loaded Driver not loaded"Driver not loaded Driver not loaded原因没有QMYSQL 驱动.
2021-06-15 18:30:07 821 1
原创 qt 备份 mysql 数据库
QProcess p(this); p.setWorkingDirectory("C:/Program Files/MySQL/MySQL Server 5.7/bin");//切换工作目录 p.setProgram("cmd"); QStringList argument; //QString("mysqldump -h127.0.0.1...
2019-12-31 10:51:17 1469
原创 mfc treectrl 树节点添加 图标 和 tooltips(悬停提示信息)
类似 工具栏的tooltips(可作为操作提示使用, 也可以是提示信息方便查看)一、添加图标1、添加ico图标 资源到资源管理库中2、参见见代码如下:HICON hIcon[3]; hIcon[0] = theApp.LoadIcon(IDI_ICON_GREEN_GREEN); hIcon[1] = theApp.LoadIcon(IDI_ICON_GREEN_...
2019-08-30 16:52:15 1796
原创 QT QString
一、QSting删除空白符1、使用正则表达str= str.remove( QRegExp("\\s") )//删除字符床中的所有空白符2、使用simplified()方法str = str.simplified()//删除字符串前后的所有空白符,中间的所有空白符使用单个空格替换3、使用trimmed()方法str = str.trimmed()//删除字符串前后的所有空白...
2018-08-14 09:47:39 556
原创 python del/exec/eval
>>> x =1>>> del x>>> xTraceback (most recent call last): File "<pyshell#55>", line 1, in <module> xNameError: name 'x' is not defined>&am
2018-08-07 13:50:44 201
原创 python 魔法赋值
序列解包>>> x, y, z = 1, 2, 3>>> print(x,y,z)1 2 3>>> x,y = y,x>>> print(x,y,z)2 1 3>>> d = { 'a':1, 'b':2}>>> k,v = d.popi
2018-08-03 14:59:14 254
原创 python - 字典
>>> phonebook = { 'Alice' :'1234','Beth':"1355",'Cecil':'3258'}>>> phonebook{'Alice': '1234', 'Beth': '1355', 'Cecil': '3258'}字典由键和对应的值组成,键和值之间用分号(:)隔开,项之间用逗号(,)隔开。dict函数创建字典...
2018-08-03 11:04:36 219
原创 python 序列-元组
>>> 1,2#元组(大部分)使用圆括号(1, 2)>>> ()#空元组()>>> 4242>>> 43,#一个值的元组(43,)>>> 3*(40+2,)#3个值一样的元组(42, 42, 42)tuple函数将一个序列转换为元组>>&
2018-08-02 11:24:23 252
原创 python 序列-列表
分片>>> numbers = [1,2,3,4,5,6,7,8,9,10]>>> numbers[3:6]#开始包含结尾不包含([))[4, 5, 6]>>> numbers[0:1][1]>>> numbers[7:10][8, 9, 10]>>> numbers[-3:-1]
2018-08-02 10:54:01 397
原创 mfc 多文档 标签的背景色
1、取消标签的背景色自动填充在CMainFrame中能够的OnCreate方法中的结构体变量mdiTabParams中的成员m_bAutoColor改成FALSE
2018-08-02 10:40:58 491
c++ 调用matlab画图
2017-01-11
c#Tavcontrol动态标签的几种做法
2014-10-30
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人