Re: [PyQt] QDockWidget issue in Linux, but not Windows, OSX

2012-02-10 Thread JPolk
Here is a simplified example of the bug...

Again, this behaviour only happens in Linux, not WinXP or OSX...Anybody have
any idea or thoughts on this?

#=

#!/usr/bin/python

# On linux, when you undock the widget, the resulting window can't be moved
(only resized).
#

import sys
from PyQt4 import QtGui, QtCore

app = QtGui.QApplication(sys.argv)
# Window
win = QtGui.QWidget()
win.setWindowTitle(Test)
win.resize(400,300)
win.show()
# Dock
dock = QtGui.QDockWidget(win)
dock.setFeatures(QtGui.QDockWidget.DockWidgetFloatable |
QtGui.QDockWidget.DockWidgetClosable | QtGui.QDockWidget.DockWidgetMovable )
dock.setGeometry(0,0,400,300)
dock.show()
sys.exit(app.exec_())

#=


The Linux Env
Centos 5.7
Python 2.6.6
Qt 4.7.4  (qt-everywhere-opensource-src-4.7.4.tar.gz)
Sip 4.13.1
PyQt 4.9(PyQt-x11-gpl-4.9.tar.gz)

Thank you,



--
View this message in context: 
http://python.6.n6.nabble.com/QDockWidget-issue-in-Linux-but-not-Windows-OSX-tp4374122p4384646.html
Sent from the PyQt mailing list archive at Nabble.com.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] QDockWidget issue in Linux, but not Windows, OSX

2012-02-10 Thread Hans-Peter Jansen
On Friday 10 February 2012, 21:42:52 JPolk wrote:
 Here is a simplified example of the bug...

 Again, this behaviour only happens in Linux, not WinXP or
 OSX...Anybody have any idea or thoughts on this?

This is most probably due to differences in window manager behavior, 
that Qt tries (hard) to cover. It _might_ also be a bug. I don't know. 

Anyway, if you use dock widgets the usual way, they _do_ work properly 
with Linux:

#!/usr/bin/python

import sys
from PyQt4 import QtGui, QtCore

app = QtGui.QApplication(sys.argv)
# Window
win = QtGui.QMainWindow()
win.setWindowTitle(Test)
win.resize(400,300)
win.show()
# Dock
dock = QtGui.QDockWidget(win) 
dock.setAllowedAreas(QtCore.Qt.LeftDockWidgetArea)
dock.setGeometry(0,0,400,300)
win.addDockWidget(QtCore.Qt.LeftDockWidgetArea, dock)
sys.exit(app.exec_())

BTW, yours was movable, too. Just hold Alt down during move. I guess, 
with a little window flag trickery _after_ undocking, the desired 
effects could be archived, too.

Cheers,
Pete

 #
=

 #!/usr/bin/python

 # On linux, when you undock the widget, the resulting window can't be
 moved (only resized).
 #

 import sys
 from PyQt4 import QtGui, QtCore

 app = QtGui.QApplication(sys.argv)
 # Window
 win = QtGui.QWidget()
 win.setWindowTitle(Test)
 win.resize(400,300)
 win.show()
 # Dock
 dock = QtGui.QDockWidget(win)
 dock.setFeatures(QtGui.QDockWidget.DockWidgetFloatable |
 QtGui.QDockWidget.DockWidgetClosable |
 QtGui.QDockWidget.DockWidgetMovable ) dock.setGeometry(0,0,400,300)
 dock.show()
 sys.exit(app.exec_())

 #
=


 The Linux Env
 Centos 5.7
 Python 2.6.6
 Qt 4.7.4  (qt-everywhere-opensource-src-4.7.4.tar.gz)
 Sip 4.13.1
 PyQt 4.9(PyQt-x11-gpl-4.9.tar.gz)

 Thank you,



 --
 View this message in context:
 http://python.6.n6.nabble.com/QDockWidget-issue-in-Linux-but-not-Wind
ows-OSX-tp4374122p4384646.html Sent from the PyQt mailing list archive
 at Nabble.com.
 ___
 PyQt mailing listPyQt@riverbankcomputing.com
 http://www.riverbankcomputing.com/mailman/listinfo/pyqt


___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


[PyQt] spreadsheet example

2012-02-10 Thread Hans-Peter Jansen
Hi Phil,

while I'm seriously overloaded at the moment (a bunch of people are much 
harder to organize then code), I did some relaxations by converting 
another fine Qt example. As usual, I couldn't resist in pimping it up 
in some minor ways. Most prominently, I added a way to change the date 
format globally. Also, a workaround to fetch the correct cell 
background color is applied.

One thing escaped me, though: the SpreadSheetItem.clone() method. It is 
finalized with an instance pointer assignment in C++. I've experimented 
with the baseclass clone call, which resulted in a strange:
item = super(SpreadSheetItem, self).clone()
RuntimeError: underlying C/C++ object has been deleted
but since this doesn't seem to be intented in the original version, feel 
free to ignore this.

Anyway, this example shows the powers of Qt in some nice ways. Hopefully 
you can include it in the upcoming release.

Pete

python: 2.6.2
sip: 4.13.1
qt4: 4.7.1
pyqt4: 4.9


spreadsheet-20120211-003540.tar.bz2
Description: application/tbz
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt