Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!eternal-september.org!feeder.eternal-september.org!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed3a.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.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'configure': 0.05; 'subject:file': 0.07; 'sys': 0.07; '"__main__":': 0.09; '__name__': 0.09; 'deploy': 0.09; 'fix.': 0.09; 'image,': 0.09; 'indeed,': 0.09; 'working:': 0.09; 'runs': 0.10; 'subject:How': 0.10; 'def': 0.12; 'gui': 0.12; "(i'm": 0.16; '(when': 0.16; 'buttons,': 0.16; 'interval,': 0.16; 'interval.': 0.16; 'normal,': 0.16; 'stuff.': 0.16; 'subject:access': 0.16; 'timeout': 0.16; 'thanks,': 0.17; 'wrote:': 0.18; 'wed,': 0.18; 'bit': 0.19; 'app': 0.19; 'working.': 0.19; 'import': 0.22; '(in': 0.22; '+0000': 0.22; 'email addr:gmail.com>': 0.22; 'minutes.': 0.22; "shouldn't": 0.24; 'tue': 0.24; 'decide': 0.24; 'fairly': 0.24; '>': 0.26; 'nearly': 0.26; 'order.': 0.26; 'defined': 0.27; 'to:2**1': 0.27; 'function': 0.29; 'testing': 0.29; 'chris': 0.29; 'am,': 0.29; "doesn't": 0.30; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'url:mailman': 0.30; 'getting': 0.31; 'that.': 0.31; 'operations.': 0.31; 'skip:q 20': 0.31; 'slot': 0.31; "user's": 0.31; 'skip:m 30': 0.32; 'interface': 0.32; 'url:python': 0.33; 'proceed': 0.33; 'sense': 0.34; 'maybe': 0.34; 'subject:from': 0.34; 'basic': 0.35; 'info': 0.35; 'something': 0.35; 'case,': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'right?': 0.36; 'url:listinfo': 0.36; 'doing': 0.36; 'subject:?': 0.36; 'url:org': 0.36; 'should': 0.36; 'two': 0.37; 'being': 0.38; 'christian': 0.38; 'configured': 0.38; 'nov': 0.38; 'skip:m 40': 0.38; 'to:addr:python-list': 0.38; 'little': 0.38; 'skip:& 20': 0.39; 'skip:. 10': 0.39; 'to:addr:python.org': 0.39; 'either': 0.39; 'called': 0.40; 'url:mail': 0.40; 'how': 0.40; 'signal': 0.60; 'new': 0.61; 'balance': 0.61; 'traffic': 0.61; 'simple': 0.61; "you're": 0.61; 'complete': 0.62; 'address': 0.63; 'skip:n 10': 0.64; 'pick': 0.64; 'fire': 0.65; 'talking': 0.65; 'within': 0.65; 'periodically': 0.68; '5:15': 0.84; 'etc,': 0.84; 'locked': 0.84; 'mistaken': 0.84; 'working,': 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=LtjbBqgay2LQR5w1tQG5zDMjHwa77PVQAHQVheFwy1E=; b=z26BonL678zQbnJjcf6OzfZ3uKxT085RQ39yTnlq4t/wXWXRTJ0haTX+Ebsd70KnKh VoyEQvQt6Q/3RcPsNxgipPriMkxeXmI7VrP+JYDHLKMNh7B+0etNPPuBWj9A6V5S79CD A1F79tfUyONOB0R+TcdrwJ4GesuE656Dd53BzckZmU5GnoPbr55M9aJ6wOlEhGVV+RW0 qyuV8LLZrmiGCtfI0BNtSP7CSmXtRFxcqQzOOW2bg8eQfsAtATWIQ8VA8OhisNCcI9Ob ysfUKUEHMWhd7kKfo/lOtOSL8mD+okEhEkM2SetUXjpep7rdH5po+k6/F+ma41dqokeN 9Lrw== X-Received: by 10.229.249.68 with SMTP id mj4mr5734013qcb.23.1416452029621; Wed, 19 Nov 2014 18:53:49 -0800 (PST) MIME-Version: 1.0 References: <546B3FE4.3050204@telenet.be> <546B6A4B.90107@telenet.be> <20141119125612.1f834ad5@rg.highlandtechnology.com> From: Juan Christian Date: Thu, 20 Nov 2014 02:53:49 +0000 Subject: Re: How to access Qt components loaded from file? To: Rob Gaddi , python-list@python.org Content-Type: multipart/alternative; boundary=001a1133525c1130240508417049 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: 204 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1416452037 news.xs4all.nl 2889 [2001:888:2000:d::a6]:58275 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:81050 --001a1133525c1130240508417049 Content-Type: text/plain; charset=UTF-8 Thanks, it's working using QTimer. The thing is that whenever the program is going to do something, in my case, draw a new QGroupBox with some components inside and put it in the Form (I'm using VBoxLayout in the main form) the program freezes, and I'm using very simple components just for testing.This shouldn't be normal, right? Am I doing something wrong? On Wed Nov 19 2014 at 7:00:43 PM Rob Gaddi wrote: > On Wed, 19 Nov 2014 20:47:31 +0000 > Juan Christian wrote: > > > Let's say that I want to call the site in a 5min interval. I'm currently > > getting the info this way just for testing and to know that the 'core > > engine' is working, and indeed, it's working: > > > > if __name__ == "__main__": > > import sys > > > > app = QApplication(sys.argv) > > MainWindow = loadui("main.ui") > > > > def output_slot(): > > MainWindow.txtbox.setText(call_site()) > > > > MainWindow.btn.clicked.connect(output_slot) > > > > MainWindow.show() > > app.exec_() > > > > How can I proceed if I want the txtbox to automatically do the > > 'setText(call_site())' in a X defined interval? The final app will have > not > > only a txtbox, but a complete interface with buttons, avatar image, some > > txtboxes, and all that stuff. If I know how to "call the site" in a > defined > > interval, I can get all the info that I need and set them one by one. > > > > If I'm not mistaken my app is locked in the app.exec_() loop, so I need > to > > have a trigger configured that will be called in a defined interval, then > > inside this trigger I configure the "set_avatar", "set_text", > > "set_btn_link", etc, is that right? > > > > On Tue Nov 18 2014 at 9:37:21 PM Chris Angelico > wrote: > > > > > On Wed, Nov 19, 2014 at 5:15 AM, Juan Christian > > > wrote: > > > > > > > > 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? > > > > > > > > > > "Constantly" doesn't make much sense when you're talking about network > > > operations. There are two basic approaches: either you re-fetch > > > periodically and update the GUI (in which case you have to decide how > > > frequently), or you re-fetch on some trigger (when it's changed, or > > > when the user's about to need it, or something). Either way, you have > > > to balance network traffic versus promptness of update, and it's > > > nearly impossible to pick perfectly. But if you don't mind it being a > > > little clunky, you should be able to pick something fairly simple and > > > deploy it, and then maybe refine it a bit afterward. > > > > > > ChrisA > > > -- > > > https://mail.python.org/mailman/listinfo/python-list > > > > > > You'd use a QTimer to do that. Once you .start(5*60*1000) the > timer, it'll fire a timeout signal every 5 minutes. You connect that > timeout to the slots you want to execute if you don't care about order, > or to a single slot function that runs the things that you want to do in > some defined order. > > -- > Rob Gaddi, Highland Technology -- www.highlandtechnology.com > Email address domain is currently out of order. See above to fix. > -- > https://mail.python.org/mailman/listinfo/python-list > --001a1133525c1130240508417049 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Thanks, it's working using QTimer. The thing is that whenever the progr= am is going to do something, in my case, draw a new=C2=A0QGroupBox with som= e components inside and put it in the Form (I'm using VBoxLayout in the= main form) the program freezes, and I'm using very simple components j= ust for testing.This shouldn't be normal, right?

Am = I doing something wrong?

On Wed Nov 19 = 2014 at 7:00:43 PM Rob Gaddi <rgaddi@technologyhighland.invalid> wrot= e:
On Wed, 19 Nov 2014 20:47:31 +0000
Juan Christian <juan0christian@gmail.com> wrote:

> Let's say that I want to call the site in a 5min interval. I'm= currently
> getting the info this way just for testing and to know that the 'c= ore
> engine' is working, and indeed, it's working:
>
> if __name__ =3D=3D "__main__":
> import sys
>
> app =3D QApplication(sys.argv)
> MainWindow =3D loadui("main.ui")
>
> def output_slot():
> MainWindow.txtbox.setText(call_site())
>
> MainWindow.btn.clicked.connect(output_slot)
>
> MainWindow.show()
> app.exec_()
>
> How can I proceed if I want the txtbox to automatically do the
> 'setText(call_site())' in a X defined interval? The final app = will have not
> only a txtbox, but a complete interface with buttons, avatar image, so= me
> txtboxes, and all that stuff. If I know how to "call the site&quo= t; in a defined
> interval, I can get all the info that I need and set them one by one.<= br> >
> If I'm not mistaken my app is locked in the app.exec_() loop, so I= need to
> have a trigger configured that will be called in a defined interval, t= hen
> inside this trigger I configure the "set_avatar", "set_= text",
> "set_btn_link", etc, is that right?
>
> On Tue Nov 18 2014 at 9:37:21 PM Chris Angelico <rosuav@gmail.com> wrote:
>
> > On Wed, Nov 19, 2014 at 5:15 AM, Juan Christian
> > <juan0christian@gmail.com> wrote:
> > >
> > > 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 thi= s data within the
> > > GUI?
> > >
> >
> > "Constantly" doesn't make much sense when you'r= e talking about network
> > operations. There are two basic approaches: either you re-fetch > > periodically and update the GUI (in which case you have to decide= how
> > frequently), or you re-fetch on some trigger (when it's chang= ed, or
> > when the user's about to need it, or something). Either way, = you have
> > to balance network traffic versus promptness of update, and it= 9;s
> > nearly impossible to pick perfectly. But if you don't mind it= being a
> > little clunky, you should be able to pick something fairly simple= and
> > deploy it, and then maybe refine it a bit afterward.
> >
> > ChrisA
> > --
> > https://mail.python.org/mailman/listinfo/python-li= st
> >
>
You'd use a QTimer to do that.=C2=A0 Once you .start(5*60*1000) the
timer, it'll fire a timeout signal every 5 minutes.=C2=A0 You connect t= hat
timeout to the slots you want to execute if you don't care about order,=
or to a single slot function that runs the things that you want to do in some defined order.

--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order.=C2=A0 See above to fix.
--
https://mail.python.org/mailman/listinfo/python-list
--001a1133525c1130240508417049--