| Home · All Namespaces · All Classes |
#include <mainwindow.h>


Public Member Functions | |
| ~MainWindow () | |
| virtual void | keyPressEvent (QKeyEvent *event) |
| REIMPLEMENTATION | |
| virtual void | closeEvent (QCloseEvent *event) |
Static Public Member Functions | |
| static MainWindow * | instance (bool create=false) |
| static QGLContext * | glContext () |
Main window for the Home application. Contains a MHome widget.
Definition at line 34 of file mainwindow.h.
| MainWindow::~MainWindow | ( | ) |
Destroys the MainWindow.
Definition at line 81 of file mainwindow.cpp.
{
mainWindowInstance = NULL;
openGLContext = NULL;
delete home;
}
| void MainWindow::closeEvent | ( | QCloseEvent * | event | ) | [virtual] |
Definition at line 167 of file mainwindow.cpp.
{
// Don't allow closing the main window
event->ignore();
}
| QGLContext * MainWindow::glContext | ( | ) | [static] |
Returns the OpenGL context.
Definition at line 98 of file mainwindow.cpp.
{
return openGLContext;
}
| MainWindow * MainWindow::instance | ( | bool | create = false |
) | [static] |
Returns an instance to MainWindow, creating it if requested. The ownership of the created MainWindow is transferred to the caller.
| create | true if a MainWindow should be created if it doesn't exist, false otherwise |
Definition at line 88 of file mainwindow.cpp.
{
if (mainWindowInstance == NULL && create) {
// The static instance variable is set in the constructor
new MainWindow;
}
return mainWindowInstance;
}
| void MainWindow::keyPressEvent | ( | QKeyEvent * | event | ) | [virtual] |
REIMPLEMENTATION
Definition at line 142 of file mainwindow.cpp.
{
int key = event->key();
if (key < Qt::Key_Escape && !event->modifiers().testFlag(Qt::ControlModifier)) {
// Special keys and CTRL-anything should do nothing
QString keyPresses = event->text();
if (!keyPresses.isEmpty()) {
// Append keypresses to the presses to be sent
keyPressesToBeSent.append(keyPresses);
if (keyPressesBeingSent.isEmpty()) {
// Select the service to send the keypresses to
if (isCallUILaunchingKey(key)) {
setupExternalService(CALL_UI_DBUS_SERVICE, CALL_UI_DBUS_PATH, CALL_UI_DBUS_INTERFACE, CALL_UI_DBUS_METHOD);
} else {
setupExternalService(CONTENT_SEARCH_DBUS_SERVICE, CONTENT_SEARCH_DBUS_PATH, CONTENT_SEARCH_DBUS_INTERFACE, CONTENT_SEARCH_DBUS_METHOD);
}
// Call the external service
sendKeyPresses();
}
}
}
}
| Copyright © 2010 Nokia Corporation | Generated on Thu Nov 4 2010 18:20:42 Doxygen 1.7.1 |
MeeGo Touch |