Qt 笔记

中文乱码解决方案 // 在文件最前面加下面代码 #pragma execution_character_set("utf-8") // 编译时把程序里的字符串使用 UTF-8 进行处理 // 在 main 函数加这个 QTextCodec::setCodecForLocale(QTextCodec::codecForName("UTF-8")); // 使用 UTF-8 的运行时环境 执行文件所在绝对目录 QApplication::applicationDirPath() ...

python 笔记

字符串 isalpha() 是否只包含A-Za-z isalnum() 是否只包含A-Za-z0-9 isdigit() 是否只包含0-9 时间 时间戳转时间 from datetime import datetime,timezone,timedelta datetime.fromtimestamp(timestamp/1000,tz=timezone(timedelta(hours=+8))).strftime('%y%m-%d %H:%M:%S.%f')[:-3] json ...

python 文件大小转换

def convert_file_size(size): units=('K','M','G','T','P',) #定义单位列表 unit='B' #初始化单位为B for u in units: if size<1024: break size/=1024 unit=u return f'{round(size,2)}{unit}'

windows系统相关笔记

激活 win10 slmgr /skms kms.digiboy.ir #服务器 slmgr /ato #激活 slmgr /dlv #查看激活状态 zh-hans_windows_xp_professional_with_service_pack_3_x86_cd_vl_x14-74070 VLK:HCQ9D-TVCWX-X9QRG-J4B2Y-GR2TT 时间显示秒 ...

Git学习笔记

以 gitee.com 为平台 ssh -T git@gitee.com ssh-keygen -t rsa -C 'vanxkr' git clone git@gitee.com:vanxkr/QQMusic_download.git 克隆仓库 git branch 查看分支 git branch vanxkr 创建分支 git switch vanxkr 切换分支 git switch -c vanxkr 创建并切换到分支 git merge vanxkr 合并某分支到当前分支 ...

Qt操作Excel(其他Office同理)

首先说说方法 阅读Microsoft Excel 开发人员参考手册 终极方法: 录制宏 看宏代码 模仿操作 记录一些操作 QAxObject *excel = new QAxObject(); QAxObject *work_books; QAxObject *work_book; QAxObject *work_sheets; QAxObject *work_sheet; QAxObject *work_cell; QAxObject *obj; if ...

Qt 界面置于指定程序最前

/* windows头文件 #include <Windows.h> #include <tlhelp32.h> */ QTimer *t = new QTimer(); connect(t, &QTimer::timeout, [&]() { HWND hWnd = ::GetLastActivePopup(::GetForegroundWindow()); // 获得顶层窗口句柄 DWORD dwPID; GetWindowThreadProcessId(hWnd, &dwPID); ...

Qt 调试打印 可双击定位

#include <QDebug> #include <QDateTime> #if _DEBUG #define LI qInfo().noquote()<<QStringLiteral("%1(%2):%3(%4)[INFO ]").arg(__FILE__).arg(__LINE__).arg(__FUNCTION__).arg(QDateTime::currentDateTime().toString("HH:mm:ss.zzz")) #define LD ...

Qt编译

流程 用x86 Native Tools Command Prompt for vS 2017编译32位 x64编译64位 到源码目录configure -prefix "C:\Qt\Qt5.15.3" -confirm-license -opensource -debug-and-release -platform win32-msvc -qt-sqlite -qt-zlib -qt-libpng -qt-libjpeg -nomake tests -nomake examples ...

解决GitHub

打开 http://tool.chinaz.com/dns 输入 github.com 打开 C:\Windows\System32\drivers\etc\hosts 填入输入 TTL 最小的一个 hosts 再次访问