Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed1.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.046 X-Spam-Evidence: '*H*': 0.91; '*S*': 0.00; 'subject:file': 0.07; 'function:': 0.09; 'subject:How': 0.10; 'def': 0.12; 'mean,': 0.16; 'subject:access': 0.16; 'thanks,': 0.17; 'working.': 0.19; 'this?': 0.23; 'this:': 0.26; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'skip:m 60': 0.31; 'slot': 0.31; 'skip:m 30': 0.32; 'run': 0.32; 'subject:from': 0.34; "can't": 0.35; 'received:google.com': 0.35; 'there': 0.35; 'right?': 0.36; 'web,': 0.36; 'possible': 0.36; 'subject:?': 0.36; 'skip:& 10': 0.38; 'to:addr:python-list': 0.38; 'skip:& 20': 0.39; 'to:addr:python.org': 0.39; '8bit%:6': 0.40; 'within': 0.65; 'continuous': 0.68; 'special': 0.74; 'locked': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:from:date:message-id:subject:to :content-type; bh=vlUvo2IX8svwSM2MEURTJr059wYg9CFDRXvCoHaNc7Y=; b=WfFjqhQ4tUJwMz+QCgbsYXdjE23z1njeHeL0/UMVTIMiW8ypLduO/0SQshRUcFakyp 7dNjs3gxLIrAp51jw5wrWU25aKgyOtqY54DvJkGhEmPjkl6hdpNEpFB3wCfke5zKkDSI HKOgcG/oYTTPxlOJRDmatcJ3cZgaSeuMO9BAWlpiV/ai71EJALDAreKm+j47NCY+spFG e2wtS0AHUHXSdjupof1U0WfI95GESYbJtb9CAII7Tyx9Ia6CRDistbjPfA9S9U6M/JSJ ah/Y2X284TbAMpUEwuqIwewGiplx8MYKAcuM2CEyrX/0fXXeka6WzMZWj9FPIC1tDefS zPyw== X-Received: by 10.229.111.201 with SMTP id t9mr45118445qcp.9.1416334513995; Tue, 18 Nov 2014 10:15:13 -0800 (PST) MIME-Version: 1.0 References: <546B3FE4.3050204@telenet.be> <546B6A4B.90107@telenet.be> From: Juan Christian Date: Tue, 18 Nov 2014 18:15:13 +0000 Subject: Re: How to access Qt components loaded from file? To: python-list@python.org Content-Type: multipart/alternative; boundary=001a11330fb497071c05082613c7 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: 1416334522 news.xs4all.nl 2963 [2001:888:2000:d::a6]:47920 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:81008 --001a11330fb497071c05082613c7 Content-Type: text/plain; charset=UTF-8 > > 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? --001a11330fb497071c05082613c7 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
You can't hav= e 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():
=C2=A0 =C2=A0 =C2=A0MainWindow.txtbox.setText(test())

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

I mean= , when I run the program I'm locked in the=C2=A0app.exec_() continuous = loop right? So I can't have a loop to get this data from the web, is th= ere any special signal/slot regarding this?
--001a11330fb497071c05082613c7--