上一页 1 2 3 4 5 6 7 8 9 ··· 56 下一页
摘要: 给子窗口设置以下属性: setAttribute(Qt::WA_QuitOnClose,false); 参考: https://blog.csdn.net/qq_40754866/article/details/109217799 阅读全文
posted @ 2024-11-19 17:32 double64 阅读(100) 评论(0) 推荐(0)
摘要: 执行字符集: #pragma execution_character_set("utf-8") 阅读全文
posted @ 2024-11-19 16:31 double64 阅读(117) 评论(0) 推荐(0)
摘要: 以+运算符重载为例: #include <iostream> #include <string> // 前置声明是必须的 namespace mydog { class Dog; } namespace myadd { mydog::Dog operator+(const mydog::Dog do 阅读全文
posted @ 2024-11-14 20:38 double64 阅读(51) 评论(0) 推荐(0)
摘要: int retVal(int &&v) { cout << "右值引用:"; return v; } int retVal(int &v) { cout << "左值引用:"; return v; } int retVal(const int &v) { cout << "const 左值引用:"; 阅读全文
posted @ 2024-11-13 22:49 double64 阅读(71) 评论(0) 推荐(0)
摘要: 既有拷贝构造又有移动构造 这个比较好理解,普通的函数匹配规则就可以。右值移动,左值拷贝。 ——《C++ Primer》 P477 我们不能隐式地将一个右值引用绑定到一个左值。 有拷贝构造但没有移动构造 这种情况,右值也会被拷贝。 如果一个类没有移动构造函数,函数匹配规则保证该类型的对象会被拷贝,即使 阅读全文
posted @ 2024-11-13 19:47 double64 阅读(32) 评论(0) 推荐(0)
摘要: 若有多个信号绑定同一个槽: QCheckBox *ckb = new QCheckBox(this); connect(ckb, &QCheckBox::clicked, this, &MyWidget::ckb_clicked); 槽函数中判断发送者对象: void MyWidget::ckb_c 阅读全文
posted @ 2024-11-12 10:19 double64 阅读(158) 评论(0) 推荐(0)
摘要: 1)单通道图像的绘制 draw_circle (WindowHandle, Row, Column, Radius) gen_circle (Circle, Row, Column, Radius) paint_region (Circle, Image, ImageR, 0, 'fill') pa 阅读全文
posted @ 2024-11-10 09:39 double64 阅读(1085) 评论(0) 推荐(0)
摘要: ▲ https://blog.csdn.net/m1059247324/article/details/116228823 阅读全文
posted @ 2024-11-09 14:54 double64 阅读(28) 评论(0) 推荐(0)
摘要: #include<iostream> using namespace std; template<typename Head, typename ...Tail> double Max(Head first, Tail... rest) { double Maxnum = 0; Maxnum = M 阅读全文
posted @ 2024-11-08 18:03 double64 阅读(61) 评论(0) 推荐(0)
摘要: 两个例外规则 假定 i 是一个 int 对象,我们可能认为像 f3(i) 这样的调用是不合法的。毕竟,i是一个左值,而通常我们不能将一个右值引用绑定到一个左值上。但是,C++语言在正常绑定规则之外定义了两个例外规则,允许这种绑定。这两个例外规则是move 这种标准库设施正确工作的基础。 第一个例外规 阅读全文
posted @ 2024-11-08 17:43 double64 阅读(70) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 8 9 ··· 56 下一页