| Prev |   2     3   4   5     6   14 | Next | Last
maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   [Maemo 5] HealthCheck - Pymaemo/Qt - Learning to code (N900) (https://talk.maemo.org/showthread.php?t=44576)

noobmonkey 2010-02-17 22:11

Re: [Maemo 5] HealthCheck - Pymaemo/Qt - Learning to code (N900)
 
Quote:

Originally Posted by fatalsaint (Post 533133)
Ew. Note to noobmonkey: If you use pyuic4 to convert a ui.. don't modify that code directly. That gets ugly and messy and then you can't modify it again with QT Designer.

It's just bad mojo.

Have a separate class in your main .py file that calls the UI class and put everything into that. So much cleaner.. and then you can open/edit/save/convert your UI all day long and never have to change a lick of code.

yeah noticed that, havn't gone back into QT Designer since :) - so it's all manual now - have to admit i am learning alot more now! :)

noobmonkey 2010-02-17 22:12

Re: [Maemo 5] HealthCheck - Pymaemo/Qt - Learning to code (N900)
 
Quote:

Originally Posted by fatalsaint (Post 533117)
If you do it that way You might need self.ui.btnName.connect....

ETA: Also self.pushButton I don't think is going to work.. do you have a line similar to:
Code:

self.ui = Ui_MainWindow()

Got
ui = Ui_MainWindow()

fatalsaint 2010-02-17 22:14

Re: [Maemo 5] HealthCheck - Pymaemo/Qt - Learning to code (N900)
 
Quote:

Originally Posted by noobmonkey (Post 533142)
Got
ui = Ui_MainWindow()

If you got it to work I guess it's irrelevant now.. I would have though you needed ui.pushButton though instead of self.pushButton..

But I'm sort of flying blind here with just pieces of your code and there's likely several ways this can be accomplished. If you got it working you're good.

noobmonkey 2010-02-17 22:19

Re: [Maemo 5] HealthCheck - Pymaemo/Qt - Learning to code (N900)
 
Just messaged you - meh, not quite working!

noobmonkey 2010-02-17 22:40

Re: [Maemo 5] HealthCheck - Pymaemo/Qt - Learning to code (N900)
 
Perfect, thank you again Fatalsaint.

Have it working like a dream now!
Its interesting, because re-reading the code, it now makes sense! But i suppose i do like the trial and error!

Now i need to do a popup message to say Loading data then loaded data - as the update takes 5/6 seconds :(

A gooooogling/wiki'ing/searching i go!

fatalsaint 2010-02-17 22:44

Re: [Maemo 5] HealthCheck - Pymaemo/Qt - Learning to code (N900)
 
QMessageBox.information(self, "Loading Data", "Please wait while the data is retrieved...")








Oh.. YOU wanted to find it.. sorry :p

attila77 2010-02-17 22:57

Re: [Maemo 5] HealthCheck - Pymaemo/Qt - Learning to code (N900)
 
fatalsaint is right, never ever touch generated code. An old indian trick is to automate pyuic4 calls - before you do the import, check timestamps and do a pyuic call if the .ui is newer (I intentionally won't show you how to do this so you could discover it on your own :p ). On the long run this saves you a little bit of typing, and a lot of time when something doesn't work because you forgot pyuic (and that can happen a lot if you have a 100 .ui-s :) )

noobmonkey 2010-02-17 22:58

Re: [Maemo 5] HealthCheck - Pymaemo/Qt - Learning to code (N900)
 
Quote:

Originally Posted by fatalsaint (Post 533207)
QMessageBox.information(self, "Loading Data", "Please wait while the data is retrieved...")

Oh.. YOU wanted to find it.. sorry :p

Haha! - i did it! - and very similar code to yours!

Needed to add the mainwindow bit, as i called it from within the function :)

Would prefer the sexy yellow message that dissapears after a few seconds lol - my next hunt!

QtGui.QMessageBox.information(MainWindow, "Loading Data", "Please wait while the data is retrieved...")

noobmonkey 2010-02-17 23:01

Re: [Maemo 5] HealthCheck - Pymaemo/Qt - Learning to code (N900)
 
Quote:

Originally Posted by attila77 (Post 533239)
fatalsaint is right, never ever touch generated code. An old indian trick is to automate pyuic4 calls - before you do the import, check timestamps and do a pyuic call if the .ui is newer (I intentionally won't show you how to do this so you could discover it on your own :p ). On the long run this saves you a little bit of typing, and a lot of time when something doesn't work because you forgot pyuic (and that can happen a lot if you have a 100 .ui-s :) )

have to learn somewhere, and good point :) :)

On my next project - will learn the proper way hehe :)
(Mainly did it this way, as i didnt learn QT designer properly, and didnt realise you could build code into it, thought it was just gui only)

noobmonkey 2010-02-17 23:19

Re: [Maemo 5] HealthCheck - Pymaemo/Qt - Learning to code (N900)
 
hmmm on searching for the hildon banner i found it (didn't work.... )
But also saw General A's bug post for fmms

"No Hildon Banner cluttering up the screen. Notification using the wheel in the
menubar is sufficient."

Anyone tell me what the notification wheel is, and how to activate it? :D :D


| Prev |   2     3   4   5     6   14 | Next | Last
All times are GMT. The time now is 19:33.

vBulletin® Version 3.8.8