user interface - Python UI to enter 2 parameters -


i want create simple ui user can enter integer , string parameter. hoping use simple qinputdialog(), far can tell works 1 parameter.

inputdialog = qtgui.qinputdialog() myint, ok =  inputdialog.getint(inputdialog, 'enter params', 'int', 1) 

is there simple way like:

inputdialog = qtgui.qinputdialog() myint, mystring, ok =  inputdialog.getint(inputdialog, 'enter params', 'int', 1), inputdialog.gettext(inputdialog, 'enter params', 'text', 1) 

i started looking @ pyqt, seems such overkill basic.

any appreciated.

there's no standard qt dialog multiple fields. can either use 2 dialogs in sequence or else have user enter both values in single field, split them in code. e.g.:

inputdialog = qtgui.qinputdialog() mytext, ok  = inputdialog.gettext(inputdialog,                'enter number, space, text', 'data', '') if ok:     myint, _, mytext = mytext.partition(" ")     try:         myint = int(myint)     except valueerror:         myint = 0 

neither user experience perspective, though.


Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

VBA function to include CDATA -