上一页 1 ··· 24 25 26 27 28 29 30 31 32 ··· 35 下一页

2021年5月1日

摘要: //添加资源图片 右键项目->添加文件->Qt->QtResourceFile->起名称->添加前缀->添加文件 ui->actionopen->setIcon(QIcon(":/images/icon/1.png")); //设置对话框 //点击新建按钮弹出对话框 connect(ui->acti 阅读全文
posted @ 2021-05-01 23:20 lodger47 阅读(225) 评论(0) 推荐(0) 编辑
摘要: //添加资源图片 右键项目->添加文件->Qt->QtResourceFile->起名称->添加前缀->添加文件 ui->actionopen->setIcon(QIcon(":/images/icon/1.png")); 阅读全文
posted @ 2021-05-01 22:52 lodger47 阅读(82) 评论(0) 推荐(0) 编辑
摘要: //菜单栏 QMenuBar *bar = menuBar(); this->setMenuBar(bar); QMenu *fileObj = bar->addMenu("文件"); QMenu *fileEdit = bar->addMenu("编辑"); QAction *newAct = f 阅读全文
posted @ 2021-05-01 21:59 lodger47 阅读(116) 评论(0) 推荐(0) 编辑
摘要: connect (信号发送者,发送的信号,信号接收者,处理的槽函数); connect(btn,&QPushButton::clicked,this,&Widget::close); 阅读全文
posted @ 2021-05-01 16:23 lodger47 阅读(74) 评论(0) 推荐(0) 编辑

2021年4月29日

摘要: transform容器拷备 transform容器拷备 class TransForm { public: int operator()(int val) { return val; } }; void test04() { vector<int> v; for (int i = 0; i < 10 阅读全文
posted @ 2021-04-29 13:27 lodger47 阅读(34) 评论(0) 推荐(0) 编辑
摘要: 成员函数适配器 成员函数适配器 //成员函数适配器 class Person { public: Person(string name,int age):m_Name(name),m_Age(age){} string m_Name; int m_Age; void showPerson() { c 阅读全文
posted @ 2021-04-29 12:53 lodger47 阅读(13) 评论(0) 推荐(0) 编辑
摘要: 函数指针适配器 取反适配器 void printFunTwo(int val,int start) { cout << val << endl; cout << start << endl; } //函数指针适配器 void test03() { vector<int> v; for (int i 阅读全文
posted @ 2021-04-29 11:43 lodger47 阅读(36) 评论(0) 推荐(0) 编辑
摘要: 取反适配器 #include <vector> #include <algorithm> #include <functional> class findDafive :public unary_function<int,bool> { public: bool operator()(int val 阅读全文
posted @ 2021-04-29 11:26 lodger47 阅读(140) 评论(0) 推荐(0) 编辑
摘要: 适配器 #include <vector> #include <algorithm> #include <functional> //第一步 绑定 数据 bind2nd //继承类 binary_function<参数类型1,参数类型2,返回值类型> //加const修饰 operator() cl 阅读全文
posted @ 2021-04-29 11:10 lodger47 阅读(20) 评论(0) 推荐(0) 编辑
摘要: c++(谓词) 谓词 class findNum { public: //一元谓词 谓词体现在返回值时bool 一元体现在 形参上 bool operator()(int num) { return num > 20; } }; //一元谓词 void test01() { vector<int> 阅读全文
posted @ 2021-04-29 10:36 lodger47 阅读(37) 评论(0) 推荐(0) 编辑
上一页 1 ··· 24 25 26 27 28 29 30 31 32 ··· 35 下一页

导航