[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: [PyQt] PyQt QFileDialog works in Linux, not on Mac
From: John Ladasky <jladasky () itu ! edu>
Date: 2017-07-18 23:30:24
Message-ID: CAOC21_Zn6Cs--odBV18rxL6EVEUOVwdjssAhPWToo9Q_vq25Eg () mail ! gmail ! com
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
Hello everyone,
I wrote a PyQt5 application that used to work on both Linux (Ubuntu 16.04
and 17.04), and on Mac (OS X 10.9). Our IT department recently upgraded
our Mac laptops to Sierra (OS X 10.12.5). This appears to have broken my
program on the Mac. I have reduced the problem to a minimal example.
Attempting to set the Accept Mode on the QFileDialog makes it fail to
render. Here is the code:
import sys
from PyQt5.QtWidgets import QApplication, QWidget, QFileDialog
class MainWindow(QWidget):
def __init__(self):
super().__init__()
self.show()
dialog = QFileDialog(self)
dialog.setAcceptMode(QFileDialog.AcceptSave) # <-- Problem is here
dialog.show()
app = QApplication(sys.argv)
w = MainWindow()
sys.exit(app.exec_())
Of course, the QFileDialog is useless if I can't actually use it... If
anyone has any suggestions or recommendations, I would greatly appreciate
them. Thanks!
--
*John J. Ladasky Jr., Ph.D.*
*Research Scientist*
*International Technological University*
*2711 N. First St, San Jose, CA 95134 USA*
[Attachment #5 (text/html)]
<div dir="ltr">Hello everyone,<div><br></div><div>I wrote a PyQt5 application that \
used to work on both Linux (Ubuntu 16.04 and 17.04), and on Mac (OS X 10.9). Our IT \
department recently upgraded our Mac laptops to Sierra (OS X 10.12.5). This appears \
to have broken my program on the Mac. I have reduced the problem to a minimal \
example. Attempting to set the Accept Mode on the QFileDialog makes it fail to \
render. Here is the code:</div><div><br></div><blockquote style="margin:0px 0px 0px \
40px;border:none;padding:0px"><div><div>import sys</div></div><div><div>from \
PyQt5.QtWidgets import QApplication, QWidget, \
QFileDialog</div></div><div><div><br></div></div><div><div>class \
MainWindow(QWidget):</div></div><div><div> </div></div><div><div> def \
__init__(self):</div></div><div><div> \
super().__init__()</div></div><div><div> self.show() \
</div></div><div><div> dialog = QFileDialog(self)</div></div><div><div> \
dialog.setAcceptMode(QFileDialog.AcceptSave) # <-- Problem is \
here</div></div><div><div> \
dialog.show()</div></div><div><div><br></div></div><div><div>app = \
QApplication(sys.argv)</div></div><div><div>w = \
MainWindow()</div></div><div><div>sys.exit(app.exec_())</div></div></blockquote><div><div><br></div><div>Of \
course, the QFileDialog is useless if I can't actually use it... If anyone has \
any suggestions or recommendations, I would greatly appreciate them. \
Thanks!</div><div><br></div>-- <br><div class="gmail_signature"><div \
dir="ltr"><b>John J. Ladasky Jr., Ph.D.</b><div><b>Research \
Scientist</b></div><div><b>International Technological \
University</b></div><div><b>2711 N. First St, San Jose, CA 95134 \
USA</b></div></div></div> </div></div>
[Attachment #6 (text/plain)]
_______________________________________________
PyQt mailing list PyQt@riverbankcomputing.com
https://www.riverbankcomputing.com/mailman/listinfo/pyqt
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic