def __init__(self):
QMainWindow.__init__(self)
- self.setAttribute(Qt.WA_Maemo5StackedWindow)
+ # quick&dirty workaround for non-maemo systems
+ try:
+ self.setAttribute(Qt.WA_Maemo5StackedWindow)
+ except:
+ pass
# _s is used to keep a reference to the Search object, so it does
# not get destroyed when it falls out of scope (the QML view is
# destroyed as soon as the Search object is destroyed!)
def open_qml(self, dtime=datetime.now()):
p = Parser(self.get_html(dtime))
- self.qml_model = QMLModel(p.overview)
+ self.qml_model = QMLModel(p.overview, p.details)
self.view = QDeclarativeView(self.parent)
self.view.setWindowTitle('Search results')
self.view.setWindowFlags(Qt.Window)
- self.view.setAttribute(Qt.WA_Maemo5StackedWindow)
+ # quick & dirty workaround
+ try:
+ self.view.setAttribute(Qt.WA_Maemo5StackedWindow)
+ except:
+ pass
self.view.setResizeMode(QDeclarativeView.SizeRootObjectToView)
self.view.setSource('ui/Overview.qml')
self.view.rootObject().setProperty('model', self.qml_model)