2024年1月15日
摘要: public static void RunCmd(string cmd) { ProcessStartInfo startInfo = new ProcessStartInfo("cmd.exe"); startInfo.CreateNoWindow = true; startInfo.UseSh 阅读全文
posted @ 2024-01-15 06:29 朱迎春 阅读(2) 评论(0) 推荐(0) 编辑
  2022年12月17日
摘要: static class Program { [DllImport("kernel32.dll", EntryPoint = "CopyMemory", SetLastError = false)] public static extern void CopyMemory(IntPtr dest, 阅读全文
posted @ 2022-12-17 12:28 朱迎春 阅读(649) 评论(0) 推荐(0) 编辑
  2022年12月15日
摘要: HOperatorSet.GenEmptyObj(out HObject hobject0); bool b0 = hobject0.IsInitialized(); // true int n0 = hobject0.CountObj(); // 0 HObject hobject1 = new 阅读全文
posted @ 2022-12-15 10:27 朱迎春 阅读(203) 评论(0) 推荐(0) 编辑
  2022年3月8日
摘要: // 向文本文件尾部追加,如果文件不存在,自动新建void AppendMessage(const QString &fileName, const QString& message) { QFile file(fileName); file.open(QIODevice::WriteOnly | 阅读全文
posted @ 2022-03-08 15:42 朱迎春 阅读(1388) 评论(0) 推荐(0) 编辑
  2022年3月1日
摘要: #include <iostream> #include <opencv2\opencv.hpp> #include <QtCore/QCoreApplication> #include "LogHelper.h" using namespace std; int main(int argc, ch 阅读全文
posted @ 2022-03-01 09:14 朱迎春 阅读(146) 评论(0) 推荐(0) 编辑
摘要: // QString与文本文件互操作:#include <QFile> QString s1("ABCD\nEFGH"); QFile file("D:\\Temp\\s1.txt"); if (file.open(QIODevice::WriteOnly | QIODevice::Text)) { 阅读全文
posted @ 2022-03-01 08:59 朱迎春 阅读(86) 评论(0) 推荐(0) 编辑
摘要: // 要么使用"QStringLiteral",要么使用"#pragma execution_character_set("utf-8")",但不能同时使用。 // 长度是6,宽字符。 QString s(QStringLiteral("ABCD中文")); // b1长度:10,能恢复 QByte 阅读全文
posted @ 2022-03-01 08:13 朱迎春 阅读(340) 评论(0) 推荐(0) 编辑
  2022年2月28日
摘要: 新建空QDialog,在空白处右击|布局,此时布局功能是禁用的,需要加入控件后才可用。 拖入两个Text Edit控件,右击|布局|水平布局,两个控件自动水平布局,并填满整个Dialog。 选中主窗体对象,在属性编辑器里找到layout(选一下别的对象,再选回来才能看到),修改Margin,即可改变 阅读全文
posted @ 2022-02-28 09:22 朱迎春 阅读(1292) 评论(0) 推荐(0) 编辑
  2022年2月23日
摘要: // // 调用std::future::get时,异步任务会堵塞,直至任务结束。 // std::future对象析构时,异步任务也会堵塞,直至任务结束。 // 如果没有保存std::async的返回值,相当于返回的std::future对象立即析构,此时的异步与同步没有区别。 // void T 阅读全文
posted @ 2022-02-23 08:32 朱迎春 阅读(470) 评论(0) 推荐(0) 编辑
摘要: // // thread对象一定要join,否则Debug会报错:"abort() has been called",Release不报错 // void Test1() { std::cout << "\n Test1 \n"; int res; thread t([&res] (int x) { 阅读全文
posted @ 2022-02-23 08:12 朱迎春 阅读(196) 评论(0) 推荐(0) 编辑