Closed giumas closed 9 years ago
Are you sure that this is the case? Here is a test program:
from PySide import QtGui
import sys
app = QtGui.QApplication(sys.argv)
widget = QtGui.QWidget()
widget.show()
print(widget.isMaximized(), type(widget.isMaximized()))
sys.exit(app.exec_())
When I run it, I get the following output:
False <class 'bool'>
However, when you save settings using QSettings
, indeed the values are saved as strings. I don't think this is a bug. I think that settings are saved in flat text files in Linux, or in the Windows registry, so there is no notion of a type besides strings (bool, int, etc).
Thank you for taking care of my question. I was working on Win7, and I was using the same approach coded here: https://gist.github.com/bootchk/5330231
but I believe that the part about isMaximized()
has some portability issue.
If I change that part to: if q_settings.value("fullScreen", self.isFullScreen()) == 'true':
, it works as expected on Windows. Is this portable?
I think that's portable. I use a similar approach on Windows and Linux.
Btw, I don't think this is the actual PySide repo. It is just a mirror someone set up. If you encounter bugs in the future, I think there is a more "official" location. It doesn't look like PySide is very actively maintained though :/
Great! Thank you a lot
Using PySide 1.2.2, when I try to save the app settings, I noticed that the function in object returns 'true' and 'false' rather than True and False. Is this a bug?