摘要:
1. 利用QFile和QTextStream读写文本文件 vector<QString> Dialog::ReadFile(const QString &fileName) { vector<QString> contents; QFile file(fileName); if(file.open( 阅读全文
posted @ 2022-02-24 15:26
不再低调
阅读(264)
评论(0)
推荐(0)
摘要:
1. 由于启动画面通常在程序初始化时间较长的情况下出现,所以在主窗口程序中看情况调用Sleep(),使主窗口程序在初始化时休眠几秒 int main(int argc, char *argv[]) { QApplication a(argc, argv); QPixmap pixmap("Qt.pn 阅读全文
posted @ 2022-02-24 12:53
不再低调
阅读(350)
评论(0)
推荐(0)
摘要:
1. setMask():为窗体设置遮罩,实现不规则窗体,参数可为QBitmap对象或QRegion对象。设置遮罩后的窗体尺寸仍是原窗体大小,只是被遮罩的地方不可见 QPixmap pix = QPixmap(); pix.load("16.png", 0, Qt::AvoidDither | Qt 阅读全文
posted @ 2022-02-24 11:37
不再低调
阅读(173)
评论(0)
推荐(0)
摘要:
1. currentTime():获取当前的系统时间 QTime currentTime = QTime::currentTime(); QString currentTimeText = currentTime.toString("hh:mm"); 2. toString():将获取的当前时间转换 阅读全文
posted @ 2022-02-24 10:49
不再低调
阅读(426)
评论(0)
推荐(0)