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?

Date 2014-11-18 13:47 +0100
From Vincent Vande Vyvre <vincent.vande.vyvre@telenet.be>
Subject Re: How to access Qt components loaded from file?
References <CAAp0bGvE_4gONgiAOjW7K2XNY7cUJz5xPB7o9rGdGS=BXCwHCQ@mail.gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.15974.1416314895.18130.python-list@python.org> (permalink)

Show all headers | 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