Thanks Aaron, I got it working, I was calling "self" as parent widget but I forgot to inherit my class from a qwidget...
Nicolas On Thu, Jun 23, 2011 at 5:22 PM, Aaron Richiger <[email protected]> wrote: > ** > Hello! > I just coded some lines to show you the basic functionality of > QInputDialog. I've never used it, so probably, there are even better > solutions, but i hope this helps you already getting started! > > ############################################## > > from PySide import QtGui, QtCore > import sys, time > > # Not using the static functions, like this, you have more possibilities > # in customizing design and behaviour. > > app = QtGui.QApplication(sys.argv) > d = QtGui.QInputDialog() > d.setTextValue('Hello world') # Set the text for the line edit if this is > wanted > d.exec_() # Starts executing the dialog > print d.textValue() # After finishing the dialog, the > input is printed > time.sleep(0.5) # Wait short time to see difference > to second dialog > > # Create the second dialog by using the static functions > # The first argument can be None, because no parent widget exists in this > example, but > # could also be your mainwindow > (text, ok) = QtGui.QInputDialog.getText(None, 'My Title', 'My label text') > print text > print ok > > app.exec_() > > ############################################### > > > > On 23.06.2011 22:47, Nicolas Rannou wrote: > > Hi all, > > I'm beginning with PySide and Python and I'm experiencing some > difficulties. > > I'm on Ubuntu 11.04 > I'm using PySide 1.0.1 (latest available on this platform) > I'm using PySide tools 0.2.8 (rcc, uic, lupdate) (latest available on this > platform) > > I want to use QInputDialog.getText() but I cannot get it working: > > QInputDialog.getText(self) > returns: > not enough arguments > > so I tried: > > QInputDialog.getText(self, "Hello", "The world") > returns: > wrong args type: str instead of qstring > > And it looks like QStrings are not supported anymore.... > > > Thanks a lot, > > Nicolas > > > > _______________________________________________ > PySide mailing > [email protected]http://lists.pyside.org/listinfo/pyside > > > > -- > Aaron Richiger > Rosentalstr. 11 > 8400 Winterthur > > 079 613 71 78 > > > _______________________________________________ > PySide mailing list > [email protected] > http://lists.pyside.org/listinfo/pyside > >
_______________________________________________ PySide mailing list [email protected] http://lists.pyside.org/listinfo/pyside
