Reply
Thread Tools
blubbi's Avatar
Posts: 288 | Thanked: 113 times | Joined on Dec 2009 @ Germany
#11
Originally Posted by Alex Atkin UK View Post
I found 800x450 seems to be about the right size, 800x400 falls a little short.
I'll try that asap... lets see ho 450 fits.

Originally Posted by Alex Atkin UK View Post
Its annoying how QT Designer has preview options for various styles but not Hildon. It would be useful if we could add a Maemo 5 preview option, as its more important to be able to preview how it looks there than anywhere else, as it differs so much from desktop.
Right, Nokia should provide a Hildon style for QTD

Originally Posted by Alex Atkin UK View Post
I am still struggling trying to figure how to get the menu to look right. By default its only showing the first menu column and its putting the name of the colum next to the menu option text, wasting space. I will have to figure out from something else how to do it right.
What menu? Can you tell me the QTClass? Do you mean a QComboBox?

Cheers
Bjoern
 
Posts: 13 | Thanked: 2 times | Joined on Nov 2009 @ Stockholm
#12
My "Pimped" version of the Hello World with the QLabel moving with help of timer events.
In the Qt Designer I named the QLabel to "SplashLabel" and put it at the coordinates x=100,y=100.

Another tip: I used DropN900 to pick up my files from Dropbox (http://www.dropbox.com/referrals/NTE3ODY3Njk) instead of SSH-Server...

Now I'm waiting for a bluetooth dongle to connect to my car's databus (eobd alá carman) and play further....

I hope someone could find something from the code below!

/Claes

Code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from sys import argv, exit

from PyQt4 import QtCore, QtGui

from qt4_designer_output_python_file import Ui_MainWindow

class main_win(QtGui.QMainWindow):
    def __init__(self, *args, **kw):
        super(main_win, self).__init__(*args, **kw)
        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)
        self.ctimer = QtCore.QTimer()
        QtCore.QObject.connect(self.ctimer, QtCore.SIGNAL("timeout()"), \
                               self.constantUpdate)
        self.ctimer.start(25)
        self.move_count = 0

    def constantUpdate(self):
        splash = self.ui.SplashLabel
        if self.move_count < 200:
            self.move_count += 1
            splash.move(splash.x() + 1, splash.y() + 1)
        else:
            self.ctimer.stop()
            splash.hide()

if __name__ == "__main__":
    app = QtGui.QApplication(argv)
    myapp = main_win()
    myapp.show()
    exit(app.exec_())

Last edited by clob; 2010-09-21 at 22:18.
 
Posts: 161 | Thanked: 85 times | Joined on Feb 2010
#13
can someone help me with py2deb? i would like to distribute my app but this part of the build script (copied from the wiki) is not working:
Code:
 dir_name = "src"            #Name of the subfolder containing your package source files (for example, usr\share\icons\hicolor\scalable\myappicon.svg, usr\lib\myapp\somelib.py). We suggest to leave it named src in all projects and will refer to that in the wiki article on maemo.org
    #Thanks to DareTheHair from talk.maemo.org for this snippet that recursively builds the file list for root, dirs, files in os.walk(dir_name):
        real_dir = root[len(dir_name):]
        fake_file = []
        for f in files:
            fake_file.append(root + os.sep + f + "|" + f)
        if len(fake_file) > 0:
            p[real_dir] = fake_file
    print p
    r = p.generate(version,build,changelog=changeloginformation,tar=True,dsc=True,changes=True,build=False,src=True)
python interpreter says of course that root is not declared. So what I've missed? where's this root declaration? what should I do???
 
Posts: 161 | Thanked: 85 times | Joined on Feb 2010
#14
omg wtf bbq!!! the for is commented and seems part of the discussion!!

Code:
#Thanks to DareTheHair from talk.maemo.org for this snippet that recursively builds the file list for root, dirs, files in os.walk(dir_name):
should be:
Code:
#Thanks to DareTheHair from talk.maemo.org for this snippet that recursively builds the file list .

for root, dirs, files in os.walk(dir_name):
    real_dir=...
just a stupid enter missing eh?
I'll edit the wiki.
 
Posts: 161 | Thanked: 85 times | Joined on Feb 2010
#15
is not over yet:
Code:
p[real_dir] = fake_file
  File "/usr/lib/python2.5/site-packages/py2deb.py", line 90, in __setitem__
    raise Py2debException("key path '%s' malformed (don't start with '/')"%path)
py2deb.Py2debException: key path '' malformed (don't start with '/')
any suggestion?
 
Posts: 161 | Thanked: 85 times | Joined on Feb 2010
#16
yay!!

again there were typos in the wiki:
Code:
dir_name = "src"

for root, dirs, files in os.walk(dir_name):
        real_dir = root[len(dir_name):]
For who left only "src", the code should look like:
Code:
dir_name = "src"
for root, dirs, files in os.walk(dir_name):
        real_dir = root
what was going on? simply string stripping: root[len(dir_name):] means that you're doing root[3:]. you want to strip the string from the 3rd position to the end: example:
Code:
 a="src"
In [13]: len(a)
Out[13]: 3
In [14]: cacca=[1,2,3,4,5,6,7]
In [15]: cacca[len(a):]
Out[15]: [4, 5, 6, 7]
In [16]: cacca[:len(a)]
Out[16]: [1, 2, 3]
.

final remarks: this is what was meant to be:
Code:
for root, dirs, files in os.walk(dir_name):
        real_dir ="//" + root[len(dir_name):]
the double slashes are also required to fix the pathname.
so I will edit again the wiki. solving this other one.
hope I've help someone in saving time.

Last edited by erniadeldesktop; 2010-09-24 at 18:29. Reason: more fixes
 

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


 
Forum Jump


All times are GMT. The time now is 12:46.