Skip to content

Commit 46fcccd

Browse files
committed
PySide 6 support; imrpove styling; fix contour plotting
1 parent 9c91725 commit 46fcccd

File tree

5 files changed

+13
-5
lines changed

5 files changed

+13
-5
lines changed

.github/workflows/publish_to_pypi.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ jobs:
2424
path: dist/
2525
publish-to-pypi:
2626
name: Publish to PyPI
27+
needs: build
2728
if: startsWith(github.ref, 'refs/tags/')
2829
runs-on: ubuntu-latest
2930
environment:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
/pyncview.egg-info
22
/dist
33
/build
4+
__pycache__

pyncview/multiplot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ def plot(self,startmessageloop=True):
257257
if createQApp:
258258
app = QtWidgets.QApplication([' '])
259259
else:
260-
app = QtWidgets.qApp
260+
app = QtWidgets.QApplication.instance()
261261

262262
# Create figure dialog
263263
dialog = xmlplot.gui_qt4.FigureDialog(None,quitonclose=True)

pyncview/pyncview.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,10 @@ def onAnimate(self):
563563
# Make sure that the toolbar does not extend beyond the desktop
564564
# Qt 4.3 does not show the toolbar at all if that happens...
565565
pos = self.windowAnimate.pos()
566-
desktopgeometry = QtWidgets.QApplication.desktop().availableGeometry(sender)
566+
if hasattr(QtWidgets.QApplication, 'desktop'):
567+
desktopgeometry = QtWidgets.QApplication.desktop().availableGeometry(sender)
568+
else:
569+
desktopgeometry = sender.screen().availableGeometry()
567570
minx = desktopgeometry.left()
568571
maxx = desktopgeometry.right()-self.windowAnimate.frameGeometry().width()
569572
miny = desktopgeometry.top()
@@ -945,7 +948,10 @@ def hideEvent(self,event):
945948
if self.settings['WindowPosition/Maximized'].getValue():
946949
self.showMaximized()
947950
elif self.settings['WindowPosition/Width'].getValue():
948-
desktoprct = QtWidgets.QApplication.desktop().availableGeometry()
951+
if hasattr(QtWidgets.QApplication, 'desktop'):
952+
desktoprct = QtWidgets.QApplication.desktop().availableGeometry()
953+
else:
954+
desktoprct = self.screen().availableGeometry()
949955
w = min(desktoprct.width(), self.settings['WindowPosition/Width'].getValue())
950956
h = min(desktoprct.height(),self.settings['WindowPosition/Height'].getValue())
951957
x = max(0,min(desktoprct.width() -w,self.settings['WindowPosition/X'].getValue()))
@@ -1116,7 +1122,7 @@ def load(self,paths):
11161122
# Create a name for the data store based on the file name,
11171123
# but make sure it is unique.
11181124
basestorename,ext = os.path.splitext(os.path.basename(path))
1119-
basestorename = re.sub('\W','_',basestorename)
1125+
basestorename = re.sub(r'\W','_',basestorename)
11201126
if basestorename[0].isdigit(): basestorename = '_'+basestorename
11211127
storename,i = basestorename,0
11221128
while storename in curstorenames:

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ name = "pyncview"
77
dynamic = ["version"]
88
readme = "README.md"
99
dependencies = [
10-
"xmlplot>=0.9.28",
10+
"xmlplot>=0.9.30",
1111
]
1212
authors = [
1313
{name = "Jorn Bruggeman", email = "[email protected]"}

0 commit comments

Comments
 (0)