Qt app in N800
-
Hi,
I made a simple app to display weather station web page (see "here":http://developer.qt.nokia.com/forums/viewthread/3483/), simple and easy. I installed OS2008 SDK and I can run the application in N800 (5.2008.43-7), but I have one problem: I cannot get the application to go full screen!
If I run the application from command line, the terminal shows these error/warning messages:
@Invalid Hildon Command: 7
Invalid Hildon Command: 6@The first pair of those appears right after the app has been started and opens the web page (after URL query), then new pair of messages for each Full Screen button press.
First I just copied the binary from development PC to the N800 and run it from the command line. I thought this quick-and-dirty method is wrong, and made a proper debian package following qt-maemo-example advice (pretty straightforward job).
But installng the app and running it from the menu did not help, it still does not go full screen...
Mu must be missing something obvious? How can I get the my application go full screen?
-Paavo
Yes I know N8x0 is a bit outdated... But it runs Qt (4.5.3) which is enough for many purposes.
-
Talking to myself...
I propably need something like this: @void fullScreenKeyPressed()
{
if(!isFullScreen)
{
view.showFullScreen();
isFullScreen=TRUE;
}
else
{
view.showNormal();
isFullScreen=FALSE;
}
}@ Is there a signal I can connect this slot to?Or do I need to use keyPressEvent() handler?
If so, how can I do that, when my very simple app is just the main() function now?
What is the N800 Full Screen key? The closes I could find is Qt::Key_SplitScreen (0x010000ed),
I could not find Key_FullScreen from "this":http://doc.qt.nokia.com/4.7/qt.html#Key-enum-Paavo
-
Continuing the monologue...
Instead of @QWebView view;@ I have @MyBrowser browser;@ and these: mybrowser.h @#ifndef MYBROWSER_H
#define MYBROWSER_H#include <QtGui>
#include <QWebView>#define N800_FULL_SCREEN_KEY 0x01000035
class MyBrowser : public QWebView
{
Q_OBJECTpublic:
MyBrowser(QWidget *parent = 0);
// ~MyBrowser();protected:
void keyPressEvent(QKeyEvent *event);private:
bool isFullScreen;
};#endif // MYBROWSER_H@ and mybrowser.cpp @#include "mybrowser.h"
MyBrowser::MyBrowser(QWidget parent) : QWebView(parent)
{
isFullScreen = FALSE; / initialise */
}// MyBrowser::~MyBrowser() {}
void MyBrowser::keyPressEvent(QKeyEvent *event)
{
// qDebug(QString("Key 0x%1").arg(event->key(), 8, 16, QChar('0')).toAscii().data());switch (event->key()) { case Qt::Key_Escape: back(); /* go to the previous page */ break; case N800_FULL_SCREEN_KEY: if(isFullScreen) { showNormal(); isFullScreen = FALSE; } else { showFullScreen(); isFullScreen = TRUE; } break; default: /* let base class handle the rest */ QWebView::keyPressEvent(event); }
}@ and it works the way I want. N800 full-screen key is the same as F6 in normal PC keyboard. Since N800 does not have backspace hard-key, I use escape to go back to the previous page.
-Paavo
-
You may want to check out the "macuco":http://maemo.org/packages/view/macuco/'s source code .
There is a package for the n800 on extras.