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


Groups > comp.lang.python > #81008

Re: How to access Qt components loaded from file?

References <CAAp0bGvE_4gONgiAOjW7K2XNY7cUJz5xPB7o9rGdGS=BXCwHCQ@mail.gmail.com> <546B3FE4.3050204@telenet.be> <CAAp0bGuiJaU6jeK5uzwyhfax1tm5PBesxwByt-En5mU2v0+8Zg@mail.gmail.com> <CAAp0bGu5z-jPm4cgm1u1CfwQPpDqy9G1A3ciwmaaSJcCrBeSPA@mail.gmail.com> <546B6A4B.90107@telenet.be>
From Juan Christian <juan0christian@gmail.com>
Date 2014-11-18 18:15 +0000
Subject Re: How to access Qt components loaded from file?
Newsgroups comp.lang.python
Message-ID <mailman.15980.1416334522.18130.python-list@python.org> (permalink)

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

>
> You can't have a slot like this:
>
> MainWindow.btn.clicked.connect(MainWindow.txtbox.setText(test()))
>
> because that's mean: "connect to the return of
> MainWindow.txtbox.setText(test())" and it's not possible at this stage
> of your program.
>
> Use instead a function:
>
> MainWindow.btn.clicked.connect(my_slot) # No parenthesis !
>
> def my_slot():
>      MainWindow.txtbox.setText(test())
>

Thanks, it's working. What would be a "professional" approach if I want to
constantly call a URL to get it's content and access this data within the
GUI?

I mean, when I run the program I'm locked in the app.exec_() continuous
loop right? So I can't have a loop to get this data from the web, is there
any special signal/slot regarding this?

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


Thread

Re: How to access Qt components loaded from file? Juan Christian <juan0christian@gmail.com> - 2014-11-18 18:15 +0000

csiph-web