From renaudtalon at fusefx.com Mon Feb 1 20:14:52 2016 From: renaudtalon at fusefx.com (Renaud Talon) Date: Mon, 1 Feb 2016 11:14:52 -0800 Subject: [PySide] PySide 1.2.3 and up VS 2013 instead of 2010 ? Message-ID: <56AFAEAC.2050802@fusefx.com> Hi, does anyone know why 1.2.3 and 1.2.4 wheels (and possible future release) are compiled using VS2013 instead of VS2010 like it use to be. On windows we get the following error message when importing the Pyside module: "The program can't start because MSVCR120.dll is missing from your computer. Try reinstalling the program to fix this problem." We can install the proper visual studio re-dist to fix the issue but shouldn't PySide be compiled using VS2010 (like it use to be before 1.2.3) since the official Python Binaries for windows are compiled using 2010 as-well ? The issue is prevents us from upgrading to anything above 1.2.2 right now. Thanks, Renaud From frank at ohufx.com Sun Feb 14 06:39:39 2016 From: frank at ohufx.com (Frank Rueter | OHUfx) Date: Sun, 14 Feb 2016 18:39:39 +1300 Subject: [PySide] capturing a simple "gesture" e.g. for scaling Message-ID: <56C0131B.3020709@ohufx.com> Hi all, I am keen to figure out how I can create a mode that will output the result of a simple gesture, such as a horizonal or vertical drag. This is not for phones/tablets, but rather for "invisible sliders", where the user can press a hotkey to go into a certain "mode", then click/drag to perform a certain action (such as scaling or drawing a line on the screen). First I was thinking about an invisible widget that opens in full screen and grabs the mouse event, but that seemed rather brute force and ugly. Then I saw the docs for QGestureEvent but the examples I found are sparse and all in C++. I'd be happy to explore those more but I'm not sure if I'm even on the right track here. Can somebody point me in the right direction please? Cheers, frank -- ohufxLogo 50x50 *vfx compositing | *workflow customisation and consulting * * -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ohufxLogo_50x50.png Type: image/png Size: 2666 bytes Desc: not available URL: From frank at ohufx.com Sun Feb 14 08:51:18 2016 From: frank at ohufx.com (Frank Rueter | OHUfx) Date: Sun, 14 Feb 2016 20:51:18 +1300 Subject: [PySide] capturing a simple "gesture" e.g. for scaling In-Reply-To: <56C0131B.3020709@ohufx.com> References: <56C0131B.3020709@ohufx.com> Message-ID: <56C031F6.20101@ohufx.com> So this kinda works, but I can't set the widget to be fully transparent without losing the mouseMoveEvent. Any ideas? from PySide import QtGui from PySide import QtCore class ModalScaleWidget(QtGui.QWidget): scaling = QtCore.Signal(float) def __init__(self, parent=None): super(ModalScaleWidget, self).__init__(parent) self.setWindowOpacity(0.1) self.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint) self.setCursor(QtCore.Qt.SizeBDiagCursor) def mouseMoveEvent(self, event): '''Emit signal with the distance to the position of the first click''' point = event.pos() - self.posOnClick self.scaling.emit(point.manhattanLength()) def mousePressEvent(self, event): '''Store the initial position when the user clicks''' self.posOnClick = event.pos() def mouseReleaseEvent(self, event): '''Close widget when mouse is released''' self.close() def keyPressEvent(self, event): '''Close widget when escape key is pressed''' if event.key() == QtCore.Qt.Key_Escape: self.close() super(ModalScaleWidget, self).keyPressEvent(event) def test(distance): print distance if __name__ == '__main__': import sys app = QtGui.QApplication(sys.argv) w = ModalScaleWidget() w.scaling.connect(test) w.showFullScreen() w.show() w.raise_() sys.exit(app.exec_()) On 14/02/16 6:39 pm, Frank Rueter | OHUfx wrote: > Hi all, > > I am keen to figure out how I can create a mode that will output the > result of a simple gesture, such as a horizonal or vertical drag. > This is not for phones/tablets, but rather for "invisible sliders", > where the user can press a hotkey to go into a certain "mode", then > click/drag to perform a certain action (such as scaling or drawing a > line on the screen). > > First I was thinking about an invisible widget that opens in full > screen and grabs the mouse event, but that seemed rather brute force > and ugly. Then I saw the docs for QGestureEvent but the examples I > found are sparse and all in C++. I'd be happy to explore those more > but I'm not sure if I'm even on the right track here. > > Can somebody point me in the right direction please? > > Cheers, > frank > > > > > -- > ohufxLogo 50x50 *vfx compositing > | *workflow customisation > and consulting * * > > > > _______________________________________________ > PySide mailing list > PySide at qt-project.org > http://lists.qt-project.org/mailman/listinfo/pyside -- ohufxLogo 50x50 *vfx compositing | *workflow customisation and consulting * * -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/png Size: 2666 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ohufxLogo_50x50.png Type: image/png Size: 2666 bytes Desc: not available URL: From dc.loco at gmail.com Sun Feb 14 22:54:22 2016 From: dc.loco at gmail.com (Kevin Cole) Date: Sun, 14 Feb 2016 16:54:22 -0500 Subject: [PySide] Is there a tutorial on good debugging techniques for PySide? Message-ID: Hi, I have two applications created using PySide. Both have many of the same widgets (menus and side bars) with a single QGroupBox that is different between the two. So, after refactoring, there is now a lot of shared code between the two that has been extracted into its own module. Sadly, I'm in a rare situation of not being able to share the code at this point. Now, one program still runs fine. The other does not. It just hangs, never displaying the UI, and ignoring keyboard interrupts in the console... unless I insert pdb.set_trace() and try to trace the error down. Calling set_trace() and typing "c" at the pdb prompt causes the second program to work just fine. Replacing the set_trace() with either sleep() or input() brought back the hanging behavior. In summary: ui = UI(initValues) ui.show() fails, but: ui.UI(initValues) pdb.set_trace() # or ipdb.set_trace() ui.show() works (after typing "c" at the interactive pdb prompt). Any suggestions? Thanks! From schampailler at skynet.be Mon Feb 15 20:56:06 2016 From: schampailler at skynet.be (Stefan Champailler) Date: Mon, 15 Feb 2016 20:56:06 +0100 Subject: [PySide] Is there a tutorial on good debugging techniques for PySide? In-Reply-To: References: Message-ID: <20160215205606.05634b8a@debian> Alas poor Kevin, You most probably felt into the memory leaks/garbage collections issue. Since Qt is C++ and PySide is python, there's a mismatch in the memory models (C++ is managed memory, python is garbage collected). You have to think about that when developping. PySide is quite OK to work with, but you have to have this aspect in mind... For my part, I've tried detecting memory leaks and GC conflicts with a debug/valgrind-ready python/qt/pyside but it didn't help much. The easiest is to double check your code for memory problematic code... That's the bad side of PySide (and PyQt as well I think) Stefan On Sun, 14 Feb 2016 16:54:22 -0500 Kevin Cole wrote: > Hi, > > I have two applications created using PySide. Both have many of the > same widgets (menus and side bars) with a single QGroupBox that is > different between the two. So, after refactoring, there is now a lot > of shared code between the two that has been extracted into its own > module. Sadly, I'm in a rare situation of not being able to share the > code at this point. > > Now, one program still runs fine. The other does not. It just hangs, > never displaying the UI, and ignoring keyboard interrupts in the > console... unless I insert pdb.set_trace() and try to trace the error > down. Calling set_trace() and typing "c" at the pdb prompt causes the > second program to work just fine. Replacing the set_trace() with > either sleep() or input() brought back the hanging behavior. > > In summary: > > ui = UI(initValues) > ui.show() > > fails, but: > > ui.UI(initValues) > pdb.set_trace() # or ipdb.set_trace() > ui.show() > > works (after typing "c" at the interactive pdb prompt). > > Any suggestions? Thanks! > _______________________________________________ > PySide mailing list > PySide at qt-project.org > http://lists.qt-project.org/mailman/listinfo/pyside -- Timeo Danaos et dona ferentes Twitter : @Arakowa1 From bhood2 at comcast.net Mon Feb 15 21:08:41 2016 From: bhood2 at comcast.net (Bob Hood) Date: Mon, 15 Feb 2016 13:08:41 -0700 Subject: [PySide] Is there a tutorial on good debugging techniques for PySide? In-Reply-To: <20160215205606.05634b8a@debian> References: <20160215205606.05634b8a@debian> Message-ID: <56C23049.4000009@comcast.net> On 2/15/2016 12:56 PM, Stefan Champailler wrote: > Alas poor Kevin, > > You most probably felt into the memory leaks/garbage collections issue. > > Since Qt is C++ and PySide is python, there's a mismatch in the memory models (C++ is managed memory, python is garbage collected)... Just to be clear, Qt has a managed memory model (as long as you remain inside the Qt ecosystem), C++ does not. You as a developer are just as responsible for managing memory usage (e.g., heap) in C++ as you are in C. From dc.loco at gmail.com Tue Feb 16 17:26:55 2016 From: dc.loco at gmail.com (Kevin Cole) Date: Tue, 16 Feb 2016 11:26:55 -0500 Subject: [PySide] Is there a tutorial on good debugging techniques for PySide? In-Reply-To: <20160215205606.05634b8a@debian> References: <20160215205606.05634b8a@debian> Message-ID: On Mon, Feb 15, 2016 at 2:56 PM, Stefan Champailler wrote: > Alas poor Kevin, > > You most probably felt into the memory leaks/garbage collections issue. > > Since Qt is C++ and PySide is python, there's a mismatch in the memory models (C++ is managed memory, python is garbage collected). You have to think about that when developping. PySide is quite OK to work with, but you have to have this aspect in mind... > > For my part, I've tried detecting memory leaks and GC conflicts with a debug/valgrind-ready python/qt/pyside but it didn't help much. The easiest is to double check your code for memory problematic code... That's the bad side of PySide (and PyQt as well I think) > > Stefan Thanks! This did, indeed, appear to be the case, and I merely "got lucky" -- or unlucky -- when one of the two programs worked. In both programs, I was instantiating and showing a new dialog at the end of a method. In one case, the method returned but the dialog stayed alive: the behavior I had intended. However, based on what I've been reading, this was purely by accident, since I was also closing the dialog that instantiated the second dialog. In the second program, garbage collector decided to collect. At least, that is my understanding based on what you and others have steered me towards. From dc.loco at gmail.com Tue Feb 16 18:03:21 2016 From: dc.loco at gmail.com (Kevin Cole) Date: Tue, 16 Feb 2016 12:03:21 -0500 Subject: [PySide] PySide and py2app on a Mac OS X system. Message-ID: I've been developing my PySide stuff on a Linux box, and happily starting it from the command line. Things have been working fairly well for months, barring a recent change that caused a dialog to be closed too soon -- now corrected. However, when I moved to the Mac, and bundled stuff up as a .app/ directory tree using py2app, I had a minor glitch which has now become even more annoying: I have docked my icon for starting my app. When clicked, it opens the first dialog which as a button that should open a second dialog. On Linux, it does. On the Mac, one must go to the dock bar and click the icon a second time to get the second dialog to show. (There's a dot on the dock icon indicating the code is "already running" when clicked the second time.) It has now become more annoying, because of my recent understanding (or misunderstanding) of garbage collection problems. Instead of merely closing the original dialog, I issue a .hide(). Well, it does not appear to hide. Worse yet, moving to the dock bar no longer causes the dock bar to un-hide so that I can click the icon a second time to launch the second dialog. Instead, I have to click on some other app, then move to the now-unhiding dock bar, then click the icon a second time. What am I doing wrong? (Probably a lot, but what are the most obvious candidates for fixing the immediate problem?) Thanks. From filippo.santovito at telematicoaccise.it Tue Feb 23 17:36:51 2016 From: filippo.santovito at telematicoaccise.it (Filippo Santovito) Date: Tue, 23 Feb 2016 17:36:51 +0100 Subject: [PySide] miniluv released Message-ID: Hi, I've just released 'miniluv', a 2-way MVVM databinding library for PySide. The code is at https://github.com/fsantovito/miniluv I hope you'll give it a try. -- Filippo Santovito -------------- next part -------------- An HTML attachment was scrubbed... URL: From schampailler at skynet.be Tue Feb 23 18:30:21 2016 From: schampailler at skynet.be (Stefan Champailler) Date: Tue, 23 Feb 2016 18:30:21 +0100 Subject: [PySide] miniluv released In-Reply-To: References: Message-ID: <20160223183021.7ca55a8f@debian> Looks quite neat ! Stefan On Tue, 23 Feb 2016 17:36:51 +0100 Filippo Santovito wrote: > Hi, > > I've just released 'miniluv', a 2-way MVVM databinding library for PySide. > The code is at https://github.com/fsantovito/miniluv > > I hope you'll give it a try. > > -- > Filippo Santovito -- Timeo Danaos et dona ferentes Twitter : @Arakowa1