123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- #!/usr/bin/env python
- # -*- encoding: utf-8 -*-
- '''
- @文件 :qt.py
- @时间 :2022/02/21 16:48:46
- @作者 :None
- @版本 :1.0
- @说明 : pyqt和pyside2兼容包
- '''
- QT_CHOSE = 1
- if QT_CHOSE:
- # PySide2
- from PySide2 import ( # noqa F401
- QtGui, QtWidgets, QtCore
- )
- from PySide2.QtWidgets import ( # noqa F401
- QMainWindow, QDesktopWidget, QStyleFactory, QWidget, QFrame,
- QApplication, QSizePolicy, QHBoxLayout, QVBoxLayout, QGridLayout,
- QLabel, QPushButton, QLineEdit, QProgressBar, QComboBox, QLCDNumber,
- QMessageBox, QFileDialog, QPlainTextEdit, QStatusBar, QGroupBox, QTabBar,
- QTabWidget, QTableWidget, QAbstractItemView, QCheckBox, QHeaderView,
- QStyle, QStyleOptionButton, QTableWidgetItem, QSpacerItem
- )
- from PySide2.QtGui import ( # noqa F401
- QGuiApplication, QPalette, QPainter, QColor, QPen,
- QLinearGradient, QFont, QBrush, QPixmap, QIcon, QRegExpValidator, QKeySequence
- )
- from PySide2.QtCore import ( # noqa F401
- QObject, QCoreApplication, QStandardPaths, QMetaObject, Qt,
- QPoint, QRect, QRectF, QPointF, QDateTime, QTimer, QSize,
- QThread, QMutex, QSemaphore, QRegExp, QModelIndex, Signal, Slot
- )
- from PySide2.QtCharts import QtCharts
- QChartView = QtCharts.QChartView
- QChart = QtCharts.QChart
- QLineSeries = QtCharts.QLineSeries
- QCategoryAxis = QtCharts.QCategoryAxis
- QValueAxis = QtCharts.QValueAxis
- QLegendMarker = QtCharts.QLegendMarker
- else:
- # PyQt5
- from PyQt5 import ( # noqa F401
- QtGui, QtWidgets, QtCore, QtChart
- )
- from PyQt5.QtWidgets import ( # noqa F401
- QMainWindow, QDesktopWidget, QStyleFactory, QWidget, QFrame,
- QApplication, QSizePolicy, QHBoxLayout, QVBoxLayout, QGridLayout,
- QLabel, QPushButton, QLineEdit, QProgressBar, QComboBox, QLCDNumber,
- QMessageBox, QFileDialog, QPlainTextEdit, QStatusBar, QGroupBox, QTabBar,
- QTabWidget, QTableWidget, QAbstractItemView, QCheckBox, QHeaderView,
- QStyle, QStyleOptionButton, QTableWidgetItem, QSpacerItem
- )
- from PyQt5.QtGui import ( # noqa F401
- QGuiApplication, QPalette, QPainter, QColor, QPen,
- QLinearGradient, QFont, QBrush, QPixmap, QIcon, QRegExpValidator, QKeySequence
- )
- from PyQt5.QtCore import ( # noqa F401
- QObject, QCoreApplication, QStandardPaths, QMetaObject, Qt, QRect, QRectF,
- QPoint, QPointF, QDateTime, QTimer, QSize,
- QThread, QMutex, QSemaphore, QRegExp, QModelIndex, pyqtSignal as Signal, pyqtSlot as Slot
- )
- from PyQt5.QtChart import ( # noqa F401
- QChartView, QLineSeries, QChart, QCategoryAxis, QValueAxis, QLegendMarker
- )
|