Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #81002

Re: How to access Qt components loaded from file?

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!newsfeed4a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <vincent.vande.vyvre@telenet.be>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.003
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; 'from:name:vincent vande vyvre': 0.16; 'received:195.130': 0.16; 'received:195.130.137': 0.16; 'received:telenet-ops.be': 0.16; 'subject:access': 0.16; '\xe9crit': 0.16; 'app': 0.19; 'import': 0.22; 'load': 0.23; 'header:User-Agent:1': 0.23; 'header:In-Reply- To:1': 0.27; 'designer': 0.30; 'code': 0.31; 'file:': 0.31; 'skip:q 20': 0.31; 'subject:from': 0.34; 'skip:u 20': 0.35; 'subject:?': 0.36; 'christian': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'called': 0.40; 'how': 0.40; 'skip:u 10': 0.60; 'simple': 0.61; 'charset:windows-1252': 0.65; 'header :Reply-To:1': 0.67; 'reply-to:no real name:2**0': 0.71
Date Tue, 18 Nov 2014 13:47:32 +0100
From Vincent Vande Vyvre <vincent.vande.vyvre@telenet.be>
User-Agent Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.2.0
MIME-Version 1.0
To python-list@python.org
Subject Re: How to access Qt components loaded from file?
References <CAAp0bGvE_4gONgiAOjW7K2XNY7cUJz5xPB7o9rGdGS=BXCwHCQ@mail.gmail.com>
In-Reply-To <CAAp0bGvE_4gONgiAOjW7K2XNY7cUJz5xPB7o9rGdGS=BXCwHCQ@mail.gmail.com>
Content-Type text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding 8bit
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
Reply-To vincent.vandevyvre@oqapy.eu
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.15974.1416314895.18130.python-list@python.org> (permalink)
Lines 30
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1416314895 news.xs4all.nl 2977 [2001:888:2000:d::a6]:51856
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:81002

Show key headers only | View raw


Le 18/11/2014 13:18, Juan Christian a écrit :
> 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?
>
>
How about MainWindow.txtbox  ?

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: How to access Qt components loaded from file? Vincent Vande Vyvre <vincent.vande.vyvre@telenet.be> - 2014-11-18 13:47 +0100

csiph-web