上一页 1 2 3 4 5 6 7 8 ··· 19 下一页
摘要: netstat -an | find ":" /c 阅读全文
posted @ 2025-05-30 11:43 liliyou 阅读(28) 评论(0) 推荐(0)
摘要: // 构建JSON对象 QJsonObject json; json.insert("state", "error"); json.insert("age", 11); // 构建JSON文档 QJsonDocument document; document.setObject(json); // 阅读全文
posted @ 2025-05-30 11:31 liliyou 阅读(137) 评论(0) 推荐(0)
摘要: 获取选择的值 int index = ui->comboBox->currentIndex(); QString value = ui->comboBox->itemText(index); qDebug() <<" comboBox选中的值="<<value; 设置选择项: ui->comboBo 阅读全文
posted @ 2025-05-30 11:20 liliyou 阅读(44) 评论(0) 推荐(0)
摘要: QListView *listview = new QListView(this); //创建QListView对象 listview->setGeometry(50, 20, 100, 200); //设置位置和大小 QStringList list; //创建数据显示列表 list.append 阅读全文
posted @ 2025-05-29 16:05 liliyou 阅读(85) 评论(0) 推荐(0)
摘要: // // Created by lenovo on 2025-05-29. // #ifndef MAX_H #define MAX_H //template 关键字告诉C++编译器 要开始泛型编程了 //T - 参数化数据类型 template <typename T> T Max(T a, T 阅读全文
posted @ 2025-05-29 14:40 liliyou 阅读(24) 评论(0) 推荐(0)
摘要: 1、定义 template <typename T> class A { public: // A(T t) { // this->t = t; // } void setT(T t) { this->t =t; } T& getT() { return t; } private: T t; }; 阅读全文
posted @ 2025-05-27 09:33 liliyou 阅读(18) 评论(0) 推荐(0)
摘要: auto value = ui->lineEdit->text().toUtf8(); auto tm= ui->dateTimeEdit->dateTime().toString("yyyy-MM-dd hh:mm:ss").toUtf8(); 阅读全文
posted @ 2025-05-23 17:03 liliyou 阅读(14) 评论(0) 推荐(0)
摘要: auto now = time(0); auto dd= std::to_string(now); 阅读全文
posted @ 2025-05-23 16:32 liliyou 阅读(39) 评论(0) 推荐(0)
摘要: // 基于当前系统的当前日期/时间 // 该函数返回系统的当前日历时间,自 1970 年 1 月 1 日以来经过的秒数。如果系统没有时间,则返回 -1。 time_t now = time(0); cout << "1970 到目前经过秒数:" << now << endl; // 把 now 转换 阅读全文
posted @ 2025-05-23 15:52 liliyou 阅读(42) 评论(0) 推荐(0)
摘要: vector<int> vect = {1,2,3,4}; vect.push_back(5);// 在后面插入一个元素 vect.pop_back(); // 后面删除一个元素 vect.erase(vect.begin()+0);// 删除第一个元素 auto a = vect.at(1); / 阅读全文
posted @ 2025-05-23 15:49 liliyou 阅读(38) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 8 ··· 19 下一页