Some odd QLineEdit behavior... I want a QLineEdit to display the file path to an SQLite3 database.
txtdb is a QLineEdit
This changes the text perfectly:
txtdb.setText("foo")
txtdb.setText("foo")
To copy to clipboard, switch view to plain text mode
This prints the filename as a string as expected:
def getdb():
return QtGui.
QFileDialog.
getOpenFileName(None,
"Select your database file",
"",
"SQLite 3 Databases (*.sq3)")
print getdb()
def getdb():
return QtGui.QFileDialog.getOpenFileName(None, "Select your database file", "", "SQLite 3 Databases (*.sq3)")
print getdb()
To copy to clipboard, switch view to plain text mode
Put them together...
txtdb.setText(getdb())
txtdb.setText(getdb())
To copy to clipboard, switch view to plain text mode
..and the text just does not change! Even
a=getdb()
txtdb.setText(a)
a=getdb()
txtdb.setText(a)
To copy to clipboard, switch view to plain text mode
is a total fail!
Anyone got any ideas how to fix this?
Rich
Bookmarks