摘要: 编译环境(windows 10/qt 5.14.2/mingw32) 问题:在使用QProcess进行进程交互时出现UnKnown error 错误代码: // 创建一个 tesseract 进程对象 QProcess* process = new QProcess(this); process-> 阅读全文
posted @ 2023-06-07 12:59 乐吴 阅读(263) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> using namespace std; int jh(const void* a, const void* b) { int i = *((int*)a);//类型转换 int j = *((int*)b); cout << "jh被调用" << endl; 阅读全文
posted @ 2022-07-02 15:15 乐吴 阅读(18) 评论(0) 推荐(0) 编辑
摘要: .h class MainWindow : public QMainWindow { Q_OBJECT public: MainWindow(QWidget *parent = nullptr); ~MainWindow(); void mousePressEvent(QMouseEvent* e) 阅读全文
posted @ 2022-04-25 14:57 乐吴 阅读(96) 评论(0) 推荐(0) 编辑
摘要: 图片文件: .h文件 class Widget : public QWidget { Q_OBJECT public: Widget(QWidget *parent = nullptr); ~Widget(); protected: void paintEvent(QPaintEvent *even 阅读全文
posted @ 2022-04-20 15:37 乐吴 阅读(239) 评论(0) 推荐(0) 编辑
摘要: QListWidget listWidget; //添加项目 new QListWidgetItem("**",&listWidget); QListWidgetItem *listWidgetItem = new QListWidgetItem; listWidgetItem->setText(" 阅读全文
posted @ 2022-04-11 19:05 乐吴 阅读(30) 评论(0) 推荐(0) 编辑
摘要: QFile file("E:\\QT_Practice\\FileInfo\\dome.txt"); //文件写入 //int data = 100000000; double db = 172.16801; if(file.open(QFile::WriteOnly | QFile::Trunca 阅读全文
posted @ 2022-03-25 15:58 乐吴 阅读(60) 评论(0) 推荐(0) 编辑
摘要: QStringList str; //追加元素 str.append("星期一"); str.append("星期二"); str.append("星期三"); str.append("星期四"); //插入元素 str.insert(0,"星期零"); qDebug()<<str; for(int 阅读全文
posted @ 2022-03-20 09:54 乐吴 阅读(140) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> using namespace std; #define HEAP_MAX 120 typedef struct _Heap { int size;//元素个数 int capacity;//容量 int* arr;//堆数组 }Heap; //设置最小堆 v 阅读全文
posted @ 2022-02-23 11:04 乐吴 阅读(218) 评论(0) 推荐(0) 编辑
摘要: 数组:数组是用于储存多个相同类型数据的集合。 指针:指针是一个变量,但是它和普通变量不一样,它存放的是其它变量在内存中的地址。 1.赋值 数组:只能一个一个元素的赋值或拷贝 指针:指针变量可以相互赋值 2.表示范围 数组有效范围就是其空间的范围,数组名使用下表引用元素,不能指向别的数组 指针可以指向 阅读全文
posted @ 2022-02-14 11:14 乐吴 阅读(377) 评论(0) 推荐(0) 编辑
摘要: 能跑,有点小问题 #include <iostream> using namespace std; #define QUEUEMAX 5 typedef int dataType; typedef struct Queue { int queue[QUEUEMAX]; int front;//队头指 阅读全文
posted @ 2022-02-12 13:19 乐吴 阅读(71) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> //#include <vector> using namespace std; class merge { public: merge() { } void mergeadd(int arr[],int left,int mid,int right,int 阅读全文
posted @ 2022-02-08 13:11 乐吴 阅读(56) 评论(0) 推荐(0) 编辑
摘要: int partition(int arr[], int low, int high) { int i = low; int j = high; int base = arr[low]; if (low < high) { while (i < j) { while (i < j && arr[j] 阅读全文
posted @ 2022-02-07 10:52 乐吴 阅读(33) 评论(0) 推荐(0) 编辑
摘要: 插入排序: int main(void) { int beauties[] = { 2, 1, 4, 6, 8, 5, 9, 7, 5 }; int len = sizeof(beauties) / sizeof(beauties[0]); int preindex = 0, current = 0 阅读全文
posted @ 2022-02-04 14:00 乐吴 阅读(31) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> using namespace std; int main(void) { int beauties[] = { 2, 1, 4, 6, 8, 5, 9, 7, 5 }; int len = sizeof(beauties) / sizeof(beauties 阅读全文
posted @ 2022-02-02 11:31 乐吴 阅读(28) 评论(0) 推荐(0) 编辑
摘要: 使用指针交换数据 void swap(int* num1, int* num2) { int test; test = *num1; *num1 = *num2; *num2 = test; } 非指针交换并排序(低到高) void lowtoheight(int height[],int len) 阅读全文
posted @ 2022-01-31 18:10 乐吴 阅读(23) 评论(0) 推荐(0) 编辑