Active Topics

 


Reply
Thread Tools
marxian's Avatar
Posts: 2,448 | Thanked: 9,523 times | Joined on Aug 2010 @ Wigan, UK
#1
I'm currently developing an application using Qt and the PyQt bindings, but I'm having trouble accessing the static methods of the QMaemo5Style class in the QtGui module. I am trying to set the text color of a QTextEdit to the logical colour name SecondaryTextColor defined in the style guide, e.g:

Code:
self.textEdit.setTextColor(QMaemo5Style.standardColor("SecondaryTextColor"))
I get the response 'global name QMaemo5Style is not defined', yet I have imported the QtGui module. If anyone can help, I would greatly appreciate it.

P.S. My N900 is on PR 1.2 and I have updated to the latest PyQt 4.6 bindings.

Last edited by marxian; 2010-10-03 at 14:32.
 
Posts: 282 | Thanked: 337 times | Joined on Dec 2009 @ Austin, TX, USA
#2
With this import at the top:
Code:
from PyQt.QtCore import Qt
try this:
Code:
self.textEdit.setTextColor(Qt.QMaemo5Style.standardColor("SecondaryTextColor"))
I haven't tried that particular code, but I had a similar situation with WA_Maemo5PortraintOrientation that was resolved the same way. It might also work with
Code:
from PyQt.QtCore.Qt import QMaemo5Style
 

The Following User Says Thank You to rmerren For This Useful Post:
marxian's Avatar
Posts: 2,448 | Thanked: 9,523 times | Joined on Aug 2010 @ Wigan, UK
#3
Thanks for your suggestions. No luck, unfortunately. According to the docs, QMaemo5Style is in the QtGui module, so my code should be working. My hunch is that QMaemo5Style is not included in the PyQt bindings, but I could be wrong. I had a look at the source code of some other applications, but I haven't found a working example of QMaemo5Style being implemented.
 
fpp's Avatar
Posts: 2,853 | Thanked: 968 times | Joined on Nov 2005
#4
Ping Attila, he should know...
__________________
maemo blog
 

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


 
Forum Jump


All times are GMT. The time now is 19:32.