摘要:
std::vector<int> arr = {0,1,2,3,4,5 }; auto it = std::find(arr.begin(), arr.end(), 3); auto index = it - arr.begin(); std::cout << "[" << index << "]" 阅读全文
摘要:
如果有一个基类: class Dog { public: virtual ~Dog() {} void show(int a) { cout << "我是一只狗!" << a << "岁" << '\n'; } void mysong() { cout << "哈哈哈..." << '\n'; } 阅读全文
摘要:
服务端 // 服务端 #include <cstdio> #include <cstdlib> #include <WinSock2.h> #include <Ws2tcpip.h> // inet_pton 函数所在头文件 #pragma comment(lib, "ws2_32.lib") // 阅读全文
摘要:
QTextCursor cursor = ui.textEdit_Recive->textCursor(); cursor.movePosition(QTextCursor::End); // 移动光标到文档末尾 ui.textEdit_Recive->setTextCursor(cursor); 阅读全文
摘要:
对 C 语言构成要素的一点思考: 数组 // 泛指容器 枚举 // 与数组配合 结构体 指针 函数 阅读全文
摘要:
void MyWidgets::setWindowTopFixStyle(QString title, QWidget * widget) { widget->setWindowTitle(title); widget->setWindowFlags(windowFlags() & ~Qt::Win 阅读全文
摘要:
基于形状轮廓的模板匹配 https://www.cnblogs.com/ybqjymy/p/14445887.html // 基于形状的模板匹配 https://blog.csdn.net/weixin_45672157/article/details/134998447 // Halcon 模板匹 阅读全文
摘要:
Demo: class Animal { public: Animal() { cout << "animal..." << endl; } virtual ~Animal() { cout << "~animal..." << endl; } virtual void ShowAnimal() = 阅读全文
摘要:
class CatBase { public: CatBase() { show1(); } ~CatBase() { } //virtual void show1() = 0; // 如果不实现,运行时会错误 virtual void show1() { cout << "cat base ... 阅读全文
摘要:
可以自定义一个类QtImageLabel继承于QLabel,重写paintEvent事件划线,写文字等。如果用 ui 设计,将 QLabel 控件提升为 QtImageLabel 类型即可。 QtImageLabel.h protected: void paintEvent(QPaintEvent 阅读全文