Active Topics

 


Reply
Thread Tools
Posts: 219 | Thanked: 94 times | Joined on Nov 2009 @ Helsinki, Finland
#151
Something went wrong with my installation. When I try to run pyuic4, it gives me an error message that qtcore4.dll can't be found. When I check pyqtconfig.py under PyQt4 installation dir it seems to have configs like 'qt_dir': 'C:\\Qt\\4.6.2'.. I have this dir, but it seems to contain only python and ruby related .api files (maybe related to Eric).

Should the PyQt use Qt provided by Nokia SDK or Qt libs installed with PyQt?
__________________
Ham > Turkey
 
mikec's Avatar
Posts: 1,366 | Thanked: 1,185 times | Joined on Jan 2006
#152
you should only need to install the pyqt from riverbank computing
__________________
N900_Email_Options Wiki Page
 

The Following User Says Thank You to mikec For This Useful Post:
Posts: 219 | Thanked: 94 times | Joined on Nov 2009 @ Helsinki, Finland
#153
Originally Posted by mikec View Post
you should only need to install the pyqt from riverbank computing
Actually managed to get it working, but pyuic4 succeeds only when run from the dir where it's located.
__________________
Ham > Turkey
 
ccarter's Avatar
Posts: 39 | Thanked: 16 times | Joined on Aug 2010 @ USA & UK
#154
Thanks much to the OP 'MikeC' ? for this great guide.

Im currently trying to get to grips with all sorts of tech. stuf [not tech. fluent] so SDK and XML is all new to me. Yes, this is a big challenge.

Thanks to resources like this and the community as a whole people like me can learn and implement thier creative ideas into the world.

I hope this is a feature of the MeeGo community when it arrives, maemo.org is a good place to be.
 
Posts: 478 | Thanked: 101 times | Joined on Feb 2010
#155
Sorry for the dumb question but why can't I view the code of a form in designer, it says there is an error with uic?

I assume as shown in the demo we use pyuic to translate this into python and then alter the code in notepad ore something? How can I then run the code on my windows machine do I have to install scratchbox or sdk? it's huge?!?! is there no ways to run in the designer?
 
Posts: 3,428 | Thanked: 2,856 times | Joined on Jul 2008
#156
Originally Posted by Spotfist View Post
Sorry for the dumb question but why can't I view the code of a form in designer, it says there is an error with uic?

I assume as shown in the demo we use pyuic to translate this into python and then alter the code in notepad ore something? How can I then run the code on my windows machine do I have to install scratchbox or sdk? it's huge?!?! is there no ways to run in the designer?
You're missing something... you'll do all your layout (and possibly signal connection if you want) in the QT Designer which will make the .ui file. You'll use pyuic4 to translate the .ui file to a .py file.

Now you need a seperate (main) .py file that will import in your UI and display it to the screen. To run it on Windows, Linux, Mac, whatever you can just run it through python:

Code:
python mainprog.py
Which will display your UI.

Or, if you use the -x switch (like in the OP tutorial), there is no need for the second .py file as pyuic4 will generate a py that calls your UI for you. You just need to run your .py file from there.

QT Designer is built to work with C++, not python. There is no way (that I'm aware) to run or load the .py files back into QT Designer, only the .UI files. That is why I recommend the first way above, keep your UI .py file separate from your main program and never edit it directly. That way you make changes to your UI in Designer, save it, and convert it using pyuic4 overwriting your old ui.py file whenever you want to change it and not worry about losing all your code inside the main program.

As an example you would have

Code:
my_fancy_program_ui.py #generated from my_fancy_program.ui with pyuic4
my_fancy_program.py #contains code to load my_fancy_program_ui.py
__________________
If I've helped you or you use any of my packages feel free to help me out.
-----------------------------------------------------------------------------------
Maintaining:
pyRadio - Pandora Radio on your N900, N810 or N800!

Last edited by fatalsaint; 2010-09-14 at 16:58.
 

The Following 2 Users Say Thank You to fatalsaint For This Useful Post:
Posts: 478 | Thanked: 101 times | Joined on Feb 2010
#157
Sweet! Thanks, that answers my questions I was a bit confused about the "unable to compile" error but now I know it's for C++ I can see why.

One last question, is scratchbox/SDK then just for graphical purposes? I want to write a game or ap that requires a ui so I assume that if I run it in python it will look similar to what is show in QT designer and the sdk is to view it as it would be on the n900?
 
Posts: 3,319 | Thanked: 5,610 times | Joined on Aug 2008 @ Finland
#158
Correct, the only reason for using scratchbox in case of a PyQt/PySide app is to see how the app actually looks. Though at that point it's probably less fuss to run what you want to see on the device itself and not bother with scratchbox
__________________
Blogging about mobile linux - The Penguin Moves!
Maintainer of PyQt (see introduction and docs), AppWatch, QuickBrownFox, etc
 

The Following 2 Users Say Thank You to attila77 For This Useful Post:
Posts: 3,428 | Thanked: 2,856 times | Joined on Jul 2008
#159
Agree with attila77. Scratchbox is really quite useless when developing in PyQt/PySide.

You can run the app directly on your Windows or Linux system just to make sure it works (no segfaults, syntax errors, etc). It won't look exactly like on Maemo but it'll be close.

Once you have it running properly you just copy your .py files over the N900 (either via SCP or Mass Storage Mode, whatever.) and then run your program right on the N900.

That is actually easier than dealing with Scratchbox.
__________________
If I've helped you or you use any of my packages feel free to help me out.
-----------------------------------------------------------------------------------
Maintaining:
pyRadio - Pandora Radio on your N900, N810 or N800!
 

The Following User Says Thank You to fatalsaint For This Useful Post:
Posts: 478 | Thanked: 101 times | Joined on Feb 2010
#160
Well I know what Im doing at work tomorrow! thanks guys. Im sure I'll be asking more questions tomorrow though lol!
 

The Following User Says Thank You to Spotfist For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 18:11.