摘要: 1 #include <iostream> 2 using namespace std; 3 int gcd(int a, int b) 4 { 5 if (0 == a % b) 6 { 7 return b; 8 } 9 return gcd(b, a % b); 10 } 11 int gcd 阅读全文
posted @ 2022-01-07 16:38 wisdomroc 阅读(22) 评论(0) 推荐(0) 编辑
摘要: 查看流逝时间: 1 #include <time.h> 2 #include <iostream> 3 4 clock_t startClock = clock(); 5 clock_t endClock = clock(); 6 cout << "耗时:" << endClock - startC 阅读全文
posted @ 2021-11-17 22:10 wisdomroc 阅读(47) 评论(0) 推荐(0) 编辑
摘要: -Wl,-Bstatic指示跟在后面的-lxxx选项链接的都是静态库,-Wl,-Bdynamic指示跟在后面的-lxxx选项链接的都是动态库 例如: LIBS += -Wl,-Bstatic -lssh2 静态链接ssh2库LIBS += -Wl,-Bdynamic -lssl 动态链接ssl库 添 阅读全文
posted @ 2020-11-30 14:44 wisdomroc 阅读(857) 评论(0) 推荐(0) 编辑
摘要: QCommandLineParser parser; QCommandLineOption option("命令②名称", "命令说明", "命令所带参数"); parser.setApplicationDescription("程序名描述"); parser.addHelpOption(); // 阅读全文
posted @ 2020-11-23 15:36 wisdomroc 阅读(305) 评论(0) 推荐(0) 编辑
摘要: 继承QEvent类,在type()函数中调用QEvent::registerEventType()得到一个合法的eventType: 1 class QCustomEvent : public QEvent 2 { 3 public: 4 QCustomEvent() : QEvent(QCusto 阅读全文
posted @ 2020-07-29 15:30 wisdomroc 阅读(377) 评论(0) 推荐(0) 编辑
摘要: 中文匹配: QRegExp reg("^[\u4e00-\u9fa5]+$"); QValidator*validator = new QRegExpValidator(reg); ui->lineEdit->setValidator(validator); 字母数字匹配: QRegExp reg( 阅读全文
posted @ 2019-12-31 11:26 wisdomroc 阅读(1635) 评论(0) 推荐(0) 编辑
摘要: 一、LayoutMirroring.enabled: true 可以用在Row、Grid、ListView、GridView上用来反转布局。 可以在不使用弹簧( Item { Layout.fillWidth: true } )的前提下实现OkButton和CancelButton的靠右侧显示。 二 阅读全文
posted @ 2019-12-11 16:07 wisdomroc 阅读(141) 评论(0) 推荐(0) 编辑
摘要: int main(int argc, char *argv[]) { int t = 10; //t: 左值 int t2 = t + 1; //t: 右值 int a = 1; const int &b = a + 1; // 左值引用 // int &b = a + 1; // 错误 cout 阅读全文
posted @ 2019-11-21 11:20 wisdomroc 阅读(174) 评论(0) 推荐(0) 编辑
摘要: 1 #include <iostream> 2 3 using namespace std; 4 5 class Base { 6 public: 7 virtual void VirtualFunc() { cout << "Base virtual" << endl; } 8 void NonV 阅读全文
posted @ 2019-11-20 10:45 wisdomroc 阅读(181) 评论(0) 推荐(0) 编辑
摘要: 1 #include <stdio.h> 2 #include <stdlib.h> 3 #include <process.h> 4 #include <winsock2.h> 5 #include <windows.h> 6 7 #define BUF_SIZE 1024 8 #define R 阅读全文
posted @ 2019-11-15 16:47 wisdomroc 阅读(152) 评论(0) 推荐(0) 编辑