Author Topic: Pyqt Won't Display Text  (Read 5853 times)

snowfarthing

  • Newbie
  • *
  • Posts: 32
    • View Profile
Pyqt Won't Display Text
« on: June 22, 2006, 10:24:38 am »
I've tried a couple of "Hello, world" programs on my Zaurus.  Both of them almost work, and I'm thrilled! except that "Hello, world!" doesn't show up on either of them.

Here's one of the programs (the simpler of the two):

Code: [Select]
import sys
from qt import *

myapp = QApplication(sys.argv)

mylabel = QLabel("Hello, world!", None)
mylabel.resize(120, 30)

myapp.setMainWidget(mylabel)
mylabel.show()
myapp.exec_loop()
I've tried both of these programs on my Linux desktop, and the text shows up just fine there.  I suspect it might have something with font settings, but I'm just barely learning Qt, and don't know enough about it to know for sure.

What is the cause of this difficulty, and how can I fix it?
Zaurus SL5500 running OpenZaurus 3.5.4 with no network access.  :(   May dual-boot to other things someday...

freizugheit

  • Sr. Member
  • ****
  • Posts: 409
    • View Profile
    • http://
Pyqt Won't Display Text
« Reply #1 on: June 23, 2006, 03:25:40 am »
It works on my SL-5600.

Maybe it was due to the Python compiler.

Try to use this version of Python for Python programming on Zaurus.

snowfarthing

  • Newbie
  • *
  • Posts: 32
    • View Profile
Pyqt Won't Display Text
« Reply #2 on: June 23, 2006, 09:39:37 am »
Unfortunately, that won't work for me:  I'm using OpenZaurus 3.5.4.  I feel so stupid forgetting to mention that!    (To keep that from happening again, I decided I should use a signature.)
Zaurus SL5500 running OpenZaurus 3.5.4 with no network access.  :(   May dual-boot to other things someday...

snowfarthing

  • Newbie
  • *
  • Posts: 32
    • View Profile
Pyqt Won't Display Text
« Reply #3 on: July 29, 2006, 04:34:25 pm »
I've had the opportunity to test a couple of other programs.  Apparently it's a font issue of some sort (since, if I use a listbox, the lists are available but invisible and very tiny); since I have no idea what's wrong with it, I'll probably report it as a bug as soon as I could figure out where I should report it!
Zaurus SL5500 running OpenZaurus 3.5.4 with no network access.  :(   May dual-boot to other things someday...

Mickeyl

  • Hero Member
  • *****
  • Posts: 1495
    • View Profile
    • http://www.Vanille.de
Pyqt Won't Display Text
« Reply #4 on: July 30, 2006, 04:53:41 am »
Sounds like the default font is not found. Try to use a QPEApplication instead -- this will set the correct default font.
Cheers,

Michael 'Mickey' Lauer | Embedded Linux Freelancer | www.Vanille-Media.de
Consider donating, if you like the software I contribute to.

milokp

  • Newbie
  • *
  • Posts: 1
    • View Profile
Pyqt Won't Display Text
« Reply #5 on: September 05, 2006, 09:09:53 pm »
Quote
I've tried a couple of "Hello, world" programs on my Zaurus.  Both of them almost work, and I'm thrilled! except that "Hello, world!" doesn't show up on either of them.

[div align=\"right\"][a href=\"index.php?act=findpost&pid=132395\"][{POST_SNAPBACK}][/a][/div]

To remidy this in the past (though it seems the most recent versions with OZ on my Collie don't need it) I've had to

Code: [Select]
Zaurus=True

from qt import *
if(Zaurus):
    from qtpe import *

in my code.