qt.py 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #!/usr/bin/env python
  2. # -*- encoding: utf-8 -*-
  3. QT_CHOSE = 1
  4. if QT_CHOSE:
  5. # PySide2
  6. from PySide2 import ( # noqa F401
  7. QtGui, QtWidgets, QtCore
  8. )
  9. from PySide2.QtWidgets import ( # noqa F401
  10. QMainWindow, QDesktopWidget, QStyleFactory, QWidget, QFrame,
  11. QApplication, QSizePolicy, QHBoxLayout, QVBoxLayout, QGridLayout,
  12. QLabel, QPushButton, QRadioButton, QButtonGroup, QLineEdit, QProgressBar, QComboBox, QLCDNumber,
  13. QMessageBox, QFileDialog, QPlainTextEdit, QStatusBar, QGroupBox, QTabBar,
  14. QTabWidget, QTableWidget, QAbstractItemView, QCheckBox, QHeaderView,
  15. QStyle, QStyleOptionButton, QTableWidgetItem, QSpacerItem, QStackedWidget
  16. )
  17. from PySide2.QtGui import ( # noqa F401
  18. QGuiApplication, QPalette, QPainter, QColor, QPen,
  19. QLinearGradient, QFont, QBrush, QPixmap, QIcon, QRegExpValidator, QKeySequence
  20. )
  21. from PySide2.QtCore import ( # noqa F401
  22. QObject, QCoreApplication, QStandardPaths, QMetaObject, Qt,
  23. QPoint, QRect, QRectF, QPointF, QDateTime, QTimer, QSize,
  24. QThread, QMutex, QSemaphore, QRegExp, QModelIndex, Signal, Slot
  25. )
  26. from PySide2.QtCharts import QtCharts
  27. QChartView = QtCharts.QChartView
  28. QChart = QtCharts.QChart
  29. QLineSeries = QtCharts.QLineSeries
  30. QCategoryAxis = QtCharts.QCategoryAxis
  31. QValueAxis = QtCharts.QValueAxis
  32. QLegendMarker = QtCharts.QLegendMarker
  33. else:
  34. # PyQt5
  35. from PyQt5 import ( # noqa F401
  36. QtGui, QtWidgets, QtCore, QtChart
  37. )
  38. from PyQt5.QtWidgets import ( # noqa F401
  39. QMainWindow, QDesktopWidget, QStyleFactory, QWidget, QFrame,
  40. QApplication, QSizePolicy, QHBoxLayout, QVBoxLayout, QGridLayout,
  41. QLabel, QPushButton, QRadioButton, QButtonGroup, QLineEdit, QProgressBar, QComboBox, QLCDNumber,
  42. QMessageBox, QFileDialog, QPlainTextEdit, QStatusBar, QGroupBox, QTabBar,
  43. QTabWidget, QTableWidget, QAbstractItemView, QCheckBox, QHeaderView,
  44. QStyle, QStyleOptionButton, QTableWidgetItem, QSpacerItem, QStackedWidget
  45. )
  46. from PyQt5.QtGui import ( # noqa F401
  47. QGuiApplication, QPalette, QPainter, QColor, QPen,
  48. QLinearGradient, QFont, QBrush, QPixmap, QIcon, QRegExpValidator, QKeySequence
  49. )
  50. from PyQt5.QtCore import ( # noqa F401
  51. QObject, QCoreApplication, QStandardPaths, QMetaObject, Qt, QRect, QRectF,
  52. QPoint, QPointF, QDateTime, QTimer, QSize,
  53. QThread, QMutex, QSemaphore, QRegExp, QModelIndex, pyqtSignal as Signal, pyqtSlot as Slot
  54. )
  55. from PyQt5.QtChart import ( # noqa F401
  56. QChartView, QLineSeries, QChart, QCategoryAxis, QValueAxis, QLegendMarker
  57. )