随笔分类 -  Qt

上一页 1 2 3 4 5 6 ··· 14 下一页
摘要:#include <QApplication> #include <QLineEdit> #include <QIntValidator> int main(int argc, char *argv[]) { QApplication app(argc, argv); QLineEdit lineE 阅读全文
posted @ 2024-01-30 20:32 西北逍遥 阅读(614) 评论(0) 推荐(0)
摘要:#include <QTcpSocket> #include <QDataStream> #include <QByteArray> void sendObjectList(QTcpSocket *socket, const QList<QObject *> &objectList) { QByte 阅读全文
posted @ 2024-01-14 23:04 西北逍遥 阅读(33) 评论(0) 推荐(0)
摘要:QMap深度拷贝 #include <QMap> #include <QPair> #include <QDebug> QMap<int, QString> deepCopyQMap(const QMap<int, QString>& source) { QMap<int, QString> tar 阅读全文
posted @ 2024-01-10 22:19 西北逍遥 阅读(359) 评论(0) 推荐(0)
摘要:#include <QMap>#include <QString>#include <iostream>int main() { QMap<QString, int> map; map["apple"] = 1; map["banana"] = 2; map["orange"] = 3; QStri 阅读全文
posted @ 2024-01-07 21:38 西北逍遥 阅读(508) 评论(0) 推荐(0)
摘要:QCheckBox* indexCheckBox = new QCheckBox(); connect(indexCheckbox,SIGNAL(stateChanged(int)),this,SLOT(slotStateChangedAction(int))); void slotStateCha 阅读全文
posted @ 2024-01-06 20:59 西北逍遥 阅读(16) 评论(0) 推荐(0)
摘要:Qt随机生成颜色 QColor #include <QColor> #include <QRandomGenerator> // 创建一个随机颜色 QColor randomColor() { QRandomGenerator generator; int r = generator.bounded 阅读全文
posted @ 2024-01-04 18:54 西北逍遥 阅读(520) 评论(0) 推荐(0)
摘要:qt 15有新的库产生随机数了,再也不用担心在for循环中会获取重复的随机数了。 #include <QRandomGenerator> // ... for (int i = 0; i < 10; ++i) { QRandomGenerator generator; generator.seed( 阅读全文
posted @ 2023-12-29 16:43 西北逍遥 阅读(204) 评论(0) 推荐(0)
摘要:QImage originalImage("path/to/your/image.jpg"); QImage scaledImage = originalImage.scaled(800, 600, Qt::IgnoreAspectRatio, Qt::SmoothTransformation); 阅读全文
posted @ 2023-12-27 19:38 西北逍遥 阅读(81) 评论(0) 推荐(0)
摘要:QWidget::raise() 将此qwidget提升到父小部件堆栈的顶部。 在这个调用之后,qwidget将在视觉上位于任何重叠的同级widget之前。 注意:使用activateWindow()时,可以调用此函数以确保窗口堆叠在顶部。 另请参见lower()和stackUnder()。 ### 阅读全文
posted @ 2023-12-18 21:13 西北逍遥 阅读(585) 评论(0) 推荐(0)
摘要:QDomEntity Public Functions QDomEntity() QDomEntity(const QDomEntity &x) QDomNode::NodeType nodeType() const QString notationName() const QString publ 阅读全文
posted @ 2023-11-22 17:32 西北逍遥 阅读(16) 评论(0) 推荐(0)
摘要:QDomNode Public Functions QDomNode() QDomNode(const QDomNode &n) ~QDomNode() QDomNode appendChild(const QDomNode &newChild) QDomNamedNodeMap attribute 阅读全文
posted @ 2023-11-20 19:30 西北逍遥 阅读(96) 评论(0) 推荐(0)
摘要:QFileInfo #include <QFileInfo> Public Functions QFileInfo() QFileInfo(const QString &file) QFileInfo(const QFile &file) QFileInfo(const QDir &dir, con 阅读全文
posted @ 2023-11-18 19:03 西北逍遥 阅读(147) 评论(0) 推荐(0)
摘要:pyqt qlabel hide from PyQt5.QtWidgets import QApplication, QWidget, QVBoxLayout, QLabel class MyApp(QWidget): def __init__(self): super().__init__() s 阅读全文
posted @ 2023-11-12 16:29 西北逍遥 阅读(50) 评论(0) 推荐(0)
摘要:from PyQt5.QtCore import QThread, pyqtSignal import time class MyThread(QThread): finished = pyqtSignal() def run(self): print('Thread started.') time 阅读全文
posted @ 2023-09-25 16:52 西北逍遥 阅读(21) 评论(0) 推荐(0)
摘要:在PyQt中,可以使用matplotlib库来绘制折线图并设置y轴的最大最小值。 import sys from PyQt5.QtWidgets import QApplication, QMainWindow, QVBoxLayout, QWidget from matplotlib.figure 阅读全文
posted @ 2023-09-10 13:47 西北逍遥 阅读(200) 评论(0) 推荐(0)
摘要:1、 (base) C:\Users\Administrator> (base) C:\Users\Administrator> (base) C:\Users\Administrator>conda create -n wind_2023 python==3.7 Collecting packag 阅读全文
posted @ 2023-09-08 20:09 西北逍遥 阅读(203) 评论(0) 推荐(0)
摘要:import sys from PyQt5.QtWidgets import QApplication, QMainWindow, QVBoxLayout, QWidget from matplotlib.figure import Figure from matplotlib.backends.b 阅读全文
posted @ 2023-09-07 07:34 西北逍遥 阅读(304) 评论(0) 推荐(0)
摘要:QSurface #include <QSurface> Public Types enum SurfaceClass { Window, Offscreen } enum SurfaceType { RasterSurface, OpenGLSurface, RasterGLSurface, Op 阅读全文
posted @ 2023-08-07 20:12 西北逍遥 阅读(194) 评论(0) 推荐(0)
摘要:QFuture #include <QFuture> Public Functions QFuture() QFuture(const QFuture<T> &other) ~QFuture() QFuture::const_iterator begin() const void cancel() 阅读全文
posted @ 2023-07-15 21:30 西北逍遥 阅读(301) 评论(0) 推荐(0)
摘要:QIODevice #include <QIODevice> Public Functions QIODevice() QIODevice(QObject *parent) virtual ~QIODevice() virtual bool atEnd() const virtual qint64 阅读全文
posted @ 2023-07-14 19:19 西北逍遥 阅读(109) 评论(0) 推荐(0)

上一页 1 2 3 4 5 6 ··· 14 下一页