Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #81001 > unrolled thread
| Started by | Juan Christian <juan0christian@gmail.com> |
|---|---|
| First post | 2014-11-18 12:18 +0000 |
| Last post | 2014-11-18 12:18 +0000 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
How to access Qt components loaded from file? Juan Christian <juan0christian@gmail.com> - 2014-11-18 12:18 +0000
| From | Juan Christian <juan0christian@gmail.com> |
|---|---|
| Date | 2014-11-18 12:18 +0000 |
| Subject | How to access Qt components loaded from file? |
| Message-ID | <mailman.15973.1416313098.18130.python-list@python.org> |
[Multipart message — attachments visible in raw view] — view raw
I have this simple code that load any Qt Designer .UI file:
from PySide.QtCore import QFile
from PySide.QtGui import QApplication
from PySide.QtUiTools import QUiLoader
def loadui(file_name):
loader = QUiLoader()
uifile = QFile(file_name)
uifile.open(QFile.ReadOnly)
ui = loader.load(uifile)
uifile.close()
return ui
if __name__ == "__main__":
import sys
app = QApplication(sys.argv)
MainWindow = loadui("main.ui")
MainWindow.show()
app.exec_()
Let's say I have a QTextEdit called txtbox. How can I access this txtbox
inside my Python code?
Back to top | Article view | comp.lang.python
csiph-web