Revenir à Qt5 pour GNU/Linux

This commit is contained in:
Philippe Roy 2023-01-31 05:06:52 +01:00
parent 1b742a4aeb
commit 9759e19a0a
4 changed files with 18 additions and 13 deletions

Binary file not shown.

View File

@ -1,6 +1,6 @@
import sys
from PyQt6 import QtWidgets
from PyQt6.QtWidgets import QApplication, QFileDialog
from PyQt5 import QtWidgets
from PyQt5.QtWidgets import QApplication, QFileDialog
###############################################################################
# twin_file_qt.py

View File

@ -1,17 +1,19 @@
import sys
import random
import importlib
import matplotlib
import matplotlib.pyplot as plts
import csv
import xml.etree.ElementTree as ET # Creating/parsing XML file
import matplotlib
import matplotlib.pyplot as plts
matplotlib.use('QtAgg')
from PyQt6 import QtCore, QtWidgets
matplotlib.use('Qt5Agg')
from PyQt5 import QtCore, QtGui, QtWidgets
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg, NavigationToolbar2QT as NavigationToolbar
import matplotlib.pyplot as plts
###############################################################################
# twin_plot_qt.py
# @title: Visualisation des données (pyQt6+Matplotlib)
# @title: Visualisation des données (pyQt5+Matplotlib)
# @project: Blender-EduTech
# @lang: fr
# @authors: Philippe Roy <philippe.roy@ac-grenoble.fr>
@ -96,6 +98,9 @@ class DynamicPlot(QtWidgets.QMainWindow):
super(MainWindow, self).__init__(*args, **kwargs)
self.canvas = MplCanvas(self, width=5, height=4, dpi=100)
self.setCentralWidget(self.canvas)
n_data = 50
# self.xdata = list(range(n_data))
# self.ydata = [random.randint(0, 10) for i in range(n_data)]
self.xdata = [0]
self.ydata = [0]
self.update_plot()
@ -340,8 +345,9 @@ class MainWindow(QtWidgets.QMainWindow):
# Application
###############################################################################
app = QtWidgets.QApplication(sys.argv)
# w = DynamicPlot()
w = MainWindow() # StaticPlot()
app.exec()
sys.exit(0)
if __name__ == "__main__":
app = QtWidgets.QApplication(sys.argv)
# w = DynamicPlot()
w = MainWindow() # StaticPlot()
app.exec_()
sys.exit(0)

View File

@ -233,4 +233,3 @@ class App(wx.App):
if __name__ == "__main__":
app = App()
app.MainLoop()