上一页 1 2 3 4 5 6 7 8 ··· 30 下一页
摘要: // 读图片QImageReader reader(fileName); reader.setAutoTransform(true); const QImage newImage = reader.read(); if (newImage.isNull()) { return false; } // 阅读全文
posted @ 2021-12-26 16:16 osbreak 阅读(155) 评论(0) 推荐(0) 编辑
摘要: class DigitalClock : public QLCDNumber { Q_OBJECT public: DigitalClock(QWidget *parent = nullptr); private slots: void showTime(); }; DigitalClock::Di 阅读全文
posted @ 2021-12-26 15:45 osbreak 阅读(58) 评论(0) 推荐(0) 编辑
摘要: class CodeEditor : public QPlainTextEdit { Q_OBJECT public: CodeEditor(QWidget *parent = nullptr); void lineNumberAreaPaintEvent(QPaintEvent *event); 阅读全文
posted @ 2021-12-26 15:05 osbreak 阅读(194) 评论(0) 推荐(0) 编辑
摘要: //使用QLocale加载多语言 localeCombo = new QComboBox; int curLocaleIndex = -1; int index = 0; for (int _lang = QLocale::C; _lang <= QLocale::LastLanguage; ++_ 阅读全文
posted @ 2021-12-21 21:29 osbreak 阅读(105) 评论(0) 推荐(0) 编辑
摘要: calendar = new QCalendarWidget; calendar->setMinimumDate(QDate(1900, 1, 1)); calendar->setMaximumDate(QDate(3000, 1, 1)); QTextCharFormat format; form 阅读全文
posted @ 2021-12-21 21:14 osbreak 阅读(256) 评论(0) 推荐(0) 编辑
摘要: // 通过指针绑定槽函数Button *createButton(const QString &text, const char *slotFunc) { Button *button = new Button(text); connect(button, SIGNAL(clicked()), th 阅读全文
posted @ 2021-12-21 21:01 osbreak 阅读(170) 评论(0) 推荐(0) 编辑
摘要: QtConcurrent 是命名空间 (namespace),它提供了高层次的函数接口 (APIs),使所写程序,可根据计算机的 CPU 核数,自动调整运行的线程数目。 使用 QtConcurrent 模块,需要在 .pro 中添加: QT += concurrent #include "qtcon 阅读全文
posted @ 2021-12-02 16:59 osbreak 阅读(167) 评论(0) 推荐(0) 编辑
摘要: https://www.cnblogs.com/osbreak/p/15634071.html 阅读全文
posted @ 2021-12-02 16:54 osbreak 阅读(57) 评论(0) 推荐(0) 编辑
摘要: 继承QRunnable。和QThread使用一样,线程类继承于QRunnable。 重写run函数。和QThread一样,需要重写run函数,run是一个纯虚函数,必须重写。 使用QThreadPool启动线程 class PThreadRunnable : public QRunnable { p 阅读全文
posted @ 2021-12-02 16:51 osbreak 阅读(90) 评论(0) 推荐(0) 编辑
摘要: class Worker : public QObject { Q_OBJECT public: explicit Worker(QObject *parent = 0); void WorkRun(); void setFlag(bool flag = true); signals: void s 阅读全文
posted @ 2021-12-02 11:41 osbreak 阅读(183) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 30 下一页