随笔分类 -  Qt

摘要:1.创建一个字符串列表作为补全数据源 QStringList wordlist; wordlist<< "apple" <<"banana" << "orange"; 2.将QCompleter的数据源设置为之前创建的QStringList,与QLineEdit控件关联 QCompleter * c 阅读全文
posted @ 2024-04-19 10:30 o·0 阅读(146) 评论(0) 推荐(0) 编辑
摘要:1.创建QTableView内容 QStandardItemModel *model = new QStandardItemModel(ui->tableView); // 四列 model->setHorizontalHeaderItem(0, new QStandardItem("1")); m 阅读全文
posted @ 2024-04-19 10:08 o·0 阅读(742) 评论(0) 推荐(0) 编辑
摘要:1.定时器 QTimer ⭐ 创建定时器对象 QTimer *timer = new QTimer(this); ⭐ 启动定时器 timer->start(毫秒); ⭐ 监听信号 connect(timer,&QTimer::timeout,[=](){ }); 例子 QTimer *timer = 阅读全文
posted @ 2024-01-04 16:31 o·0 阅读(232) 评论(0) 推荐(0) 编辑
摘要:1、给QToolButton添加图片 QToolButton#toolButton { qproperty-icon: url(:/image/complete.png); qproperty-iconSize: 50px 50px; background-color: rgb(21, 27, 32 阅读全文
posted @ 2023-12-25 15:45 o·0 阅读(898) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示