[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyQt] with PyQt's input hook, is it expected that sending to stdin dismisses a modal dialog
From:       Phil Thompson <phil () riverbankcomputing ! com>
Date:       2016-02-23 19:29:40
Message-ID: 899ED7E7-F967-4F50-86A0-02E3B242A9B9 () riverbankcomputing ! com
[Download RAW message or body]


> On 23 Feb 2016, at 3:17 pm, Erik Hvatum <ice.rikh@gmail.com> wrote:
> 
> With PyQt's input hook, is it expected that sending \n to stdin dismisses a modal \
> dialog created in response to a signal?  Looking at qtcore_input_hook() in \
> qcoreapplication.sip, it's easy to see why this happens, and it seems like a \
> reasonable compromise between permitting modal dialogs and avoiding blocking the \
> Python prompt.  Still, google doesn't reveal a definitive answer, and I'd like to \
> be sure that I understand the situation. 
> On OS X:
> 
> > python3
> Python 3.5.1 (default, Dec 14 2015, 16:26:43) 
> [GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.1.76)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
> > > > from PyQt5 import Qt
> > > > import sys
> > > > app = Qt.QApplication(sys.argv)
> > > > def show_file_dlg():
> ...     Qt.QFileDialog.getSaveFileName(None, 'test',filter='tests (*.test *.tst)')
> ... 
> > > > t = Qt.QTimer()
> > > > t.setSingleShot(True)
> > > > t.timeout.connect(show_file_dlg)
> > > > t.start(1000) # wait a second, file dialog appears
> > > > # press enter in terminal, file dialog is dismissed and we get a new prompt
> > > > 
> 
> The behavior on Linux is the same.

I don't think it was specifically designed to do that - just that's what happens to \
happen.

Phil
_______________________________________________
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