Passage à Qt6

This commit is contained in:
Philippe Roy 2023-01-29 17:28:54 +01:00
parent 280123b0d5
commit f49ffab656
5 changed files with 40 additions and 9 deletions

10
twin_config-bak.xml Executable file
View File

@ -0,0 +1,10 @@
<data>
<screen>
<width>1280</width>
<height>720</height>
<quality>1</quality>
</screen>
<plot>
<config>True</config>
</plot>
</data>

View File

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

22
twin_file_wx.py Normal file
View File

@ -0,0 +1,22 @@
import wx
###############################################################################
# twin_file_wx.py
# @title: Selecteur de fichier (wxPython)
# @project: Blender-EduTech
# @lang: fr
# @authors: Philippe Roy <philippe.roy@ac-grenoble.fr>
# @copyright: Copyright (C) 2023 Philippe Roy
# @license: GNU GPL
###############################################################################
app = wx.App()
frame = wx.Frame(None, -1, 'win.py')
# frame.SetDimensions(0,0,200,50)
openFileDialog = wx.FileDialog(frame, "Sélection du fichier de commande", "", "",
"Fichier Python (*.py)|*.py", wx.FD_OPEN | wx.FD_FILE_MUST_EXIST)
openFileDialog.ShowModal()
print(openFileDialog.GetPath())
openFileDialog.Destroy()

View File

@ -1,19 +1,18 @@
import sys import sys
import random import random
import importlib import importlib
import matplotlib
import matplotlib.pyplot as plts
import csv import csv
import xml.etree.ElementTree as ET # Creating/parsing XML file import xml.etree.ElementTree as ET # Creating/parsing XML file
matplotlib.use('Qt5Agg') import matplotlib
from PyQt5 import QtCore, QtGui, QtWidgets
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg, NavigationToolbar2QT as NavigationToolbar
import matplotlib.pyplot as plts import matplotlib.pyplot as plts
matplotlib.use('QtAgg')
from PyQt6 import QtCore, QtWidgets
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg, NavigationToolbar2QT as NavigationToolbar
############################################################################### ###############################################################################
# twin_plot_qt.py # twin_plot_qt.py
# @title: Visualisation des données (pyQt5+Matplotlib) # @title: Visualisation des données (pyQt6+Matplotlib)
# @project: Blender-EduTech # @project: Blender-EduTech
# @lang: fr # @lang: fr
# @authors: Philippe Roy <philippe.roy@ac-grenoble.fr> # @authors: Philippe Roy <philippe.roy@ac-grenoble.fr>
@ -348,5 +347,5 @@ class MainWindow(QtWidgets.QMainWindow):
app = QtWidgets.QApplication(sys.argv) app = QtWidgets.QApplication(sys.argv)
# w = DynamicPlot() # w = DynamicPlot()
w = MainWindow() # StaticPlot() w = MainWindow() # StaticPlot()
app.exec_() app.exec()
sys.exit(0) sys.exit(0)