Menu

Main Menu
Talk Get Daily Search

Member's Online

    User Name
    Password

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

    Reply
    Page 4 of 20 | Prev |   2     3   4   5     6   14 | Next | Last
    noobmonkey | # 31 | 2010-02-17, 22:11 | Report

    Originally Posted by fatalsaint View Post
    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!

    Edit | Forward | Quote | Quick Reply | Thanks

     
    noobmonkey | # 32 | 2010-02-17, 22:12 | Report

    Originally Posted by fatalsaint View Post
    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()

    Edit | Forward | Quote | Quick Reply | Thanks

     
    fatalsaint | # 33 | 2010-02-17, 22:14 | Report

    Originally Posted by noobmonkey View Post
    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.

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to fatalsaint For This Useful Post:
    noobmonkey

     
    noobmonkey | # 34 | 2010-02-17, 22:19 | Report

    Just messaged you - meh, not quite working!

    Edit | Forward | Quote | Quick Reply | Thanks

     
    noobmonkey | # 35 | 2010-02-17, 22:40 | Report

    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!

    Edit | Forward | Quote | Quick Reply | Thanks

     
    fatalsaint | # 36 | 2010-02-17, 22:44 | Report

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








    Oh.. YOU wanted to find it.. sorry

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following 2 Users Say Thank You to fatalsaint For This Useful Post:
    lostinmirkwood, noobmonkey

     
    attila77 | # 37 | 2010-02-17, 22:57 | Report

    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 ). 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 )

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to attila77 For This Useful Post:
    noobmonkey

     
    noobmonkey | # 38 | 2010-02-17, 22:58 | Report

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

    Oh.. YOU wanted to find it.. sorry
    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...")

    Edit | Forward | Quote | Quick Reply | Thanks

     
    noobmonkey | # 39 | 2010-02-17, 23:01 | Report

    Originally Posted by attila77 View Post
    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 ). 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)

    Edit | Forward | Quote | Quick Reply | Thanks

     
    noobmonkey | # 40 | 2010-02-17, 23:19 | Report

    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?

    Edit | Forward | Quote | Quick Reply | Thanks

     
    Page 4 of 20 | Prev |   2     3   4   5     6   14 | Next | Last
vBulletin® Version 3.8.8
Normal Logout