Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!weretis.net!feeder4.news.weretis.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed1a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.005 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'subject:file': 0.07; 'sys': 0.07; '"__main__":': 0.09; '__name__': 0.09; 'subject:How': 0.10; 'python': 0.11; 'def': 0.12; '.ui': 0.16; 'code?': 0.16; 'subject:access': 0.16; 'app': 0.19; 'import': 0.22; 'load': 0.23; 'designer': 0.30; 'message-id:@mail.gmail.com': 0.30; 'code': 0.31; 'file:': 0.31; 'skip:q 20': 0.31; 'subject:from': 0.34; 'skip:u 20': 0.35; 'received:google.com': 0.35; 'subject:?': 0.36; 'to:addr:python-list': 0.38; 'skip:& 20': 0.39; 'to:addr:python.org': 0.39; 'called': 0.40; 'how': 0.40; 'skip:u 10': 0.60; 'simple': 0.61 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=PylCjUaK7GZcPk2F7AfbWvEfmS191RpRxSK8q9WOi9c=; b=v4oapCKAfkpbHrFnPDZb4SJO+kDLpN0AF1Am/QBvDgPXjaBenfheYlfYAoi7IKOVNF ziQBQD54P5xIl+d92BWqOdL/nfaYZhghmsYw3j1AAON9pu4T9SDpiwr9HFYDmvXYZAxx pQMxN3Qj5sZbnQbhbTAVQWn42LSWRkvmJphI8oMLyZehtZRyZ5GwddCWxpJqcBGZfUv6 7qq9H5Df5FqYezHd1QzjsFmRVW6l/k2JdXZq0NGs6rC4jRLZigwhC22F88nO8GWhiDGf 88ZwutGLX74jSzJbxXJWYrhOvh0pyMN/k2B80nUTQqLUq+QvtqbLVjG8cdazp6L6zy0W hJdw== X-Received: by 10.224.115.82 with SMTP id h18mr30794521qaq.76.1416313090291; Tue, 18 Nov 2014 04:18:10 -0800 (PST) MIME-Version: 1.0 From: Juan Christian Date: Tue, 18 Nov 2014 12:18:09 +0000 Subject: How to access Qt components loaded from file? To: Python Content-Type: multipart/alternative; boundary=047d7bdca348a33d540508211654 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 58 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1416313098 news.xs4all.nl 2862 [2001:888:2000:d::a6]:48331 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:81001 --047d7bdca348a33d540508211654 Content-Type: text/plain; charset=UTF-8 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? --047d7bdca348a33d540508211654 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I have this simple code that load any Qt Designer .UI file:

<= div>
from PySide.QtCore import QFile
from PySide.QtGui import= QApplication
from PySide.QtUiTools import QUiLoader

def loadui(file_name):
loader =3D QUiLoader()
u= ifile =3D QFile(file_name)
uifile.open(QFile.ReadOnly)
ui =3D loader.load= (uifile)
uifile.close()
return ui


i= f __name__ =3D=3D "__main__":
import sys

app =3D Q= Application(sys.argv)
MainWindow =3D loadui("main.ui")
= MainWindow= .show()
= app.exec_()

Let's say I have a Q= TextEdit called txtbox. How can I access this txtbox inside my Python code?=
--047d7bdca348a33d540508211654--