| Home · All Classes · Annotated · Functions |
The QtopiaApplication class implements the system services available to all Qtopia applications. More...
#include <QtopiaApplication>
Inherits QApplication.
The QtopiaApplication class implements the system services available to all Qtopia applications.
By using QtopiaApplication instead of QApplication, a standard Qt application becomes a Qtopia application. It automatically follows style changes, quits and raises, and in the case of document-oriented applications, changes the currently displayed document in response to the environment.
To create a document-oriented application use showMainDocumentWidget(); to create a non-document-oriented application use showMainWidget(). The keepRunning() function indicates whether the application will continue running after it has processed the last QCop message. This can be changed using setKeepRunning().
A variety of signals are emitted when certain events occur, for example:
The following signals are emitted:
When synching begins or ends the application should save and reload any data files involved in synching. Most of these signals will intially be received and unfiltered through the appMessage() signal.
This class also provides a set of useful static functions as follows:
| Constant | Value | Description |
|---|---|---|
| QtopiaApplication::Normal | 0 | the widget sometimes needs text input. |
| QtopiaApplication::AlwaysOff | 1 | the widget never needs text input. |
| QtopiaApplication::AlwaysOn | 2 | the widget always needs text input. |
| QtopiaApplication::Number | 3 | the widget needs numeric input. |
| QtopiaApplication::PhoneNumber | 4 | the widget needs phone-style numeric input. |
| QtopiaApplication::Words | 5 | the widget needs word input. |
| QtopiaApplication::Text | 6 | the widget needs non-word input. |
| QtopiaApplication::Named | 7 | the widget needs special input, defined by param. Each input method may support a different range of special input types, but will default to Text if they do not know the type. |
By default, QLineEdit and QTextEdit have the Words hint unless they have a QIntValidator, in which case they have the Number hint. This is appropriate for most cases, including the input of names (new names being added to the user's dictionary). All other widgets default to Normal mode.
See also inputMethodHint() and setInputMethodHint().
Defines the user interface mode when the "keep running" state is set with QtopiaApplication::setKeepRunning().
| Constant | Value | Description |
|---|---|---|
| QtopiaApplication::ShowUI | 0 | Continue running and show the user interface. |
| QtopiaApplication::HideUI | 1 | Continue running without displaying the user interface. |
| Constant | Value | Description |
|---|---|---|
| QtopiaApplication::Disable | 0 | disables any screensaver activity |
| QtopiaApplication::DisableLightOff | 50 | the backlight will never be turned off (dimming remains active). |
| QtopiaApplication::DisableReturnToHomeScreen | 100 | the device will not go back to the homescreen (phone edition only). |
| QtopiaApplication::DisableSuspend | 900 | the device will not suspend (PDA edition only) |
| QtopiaApplication::Enable | 1000 | the screensaver will make use of any power saving tool that is available. |
Less severe ScreenSaverHints always imply more severe hints (e.g DisableLightOff implies DisableSuspend). The exact implications are determined by the integer value that each hint is assigned to (enumeration value). A low valued hint will always imply a high valued hint.
See also setTemporaryScreenSaverMode().
| Constant | Value | Description |
|---|---|---|
| QtopiaApplication::LeftOnly | 0 | the stylus only generates LeftButton events (the default). |
| QtopiaApplication::RightOnHold | 1 | the stylus generates RightButton events if the user uses the press-and-hold gesture. |
See also setStylusOperation() and stylusOperation().
Constructs a QtopiaApplication just as you would construct a QApplication, passing argc, argv, and t.
For applications, t should be the default, GuiClient. Only the Qtopia server passes GuiServer.
Destroys the QtopiaApplication.
This signal is emitted when a message is received on the application's QPE/Application/appname QCop channel.
The slot to which you connect this signal uses msg and data in the following way:
void MyWidget::receive( const QString& msg, const QByteArray& data )
{
QDataStream stream( data, QIODevice::ReadOnly );
if ( msg == "someMessage(int,int,int)" ) {
int a,b,c;
stream >> a >> b >> c;
...
} else if ( msg == "otherMessage(QString)" ) {
...
}
}
Note: Messages received here may be processed by QtopiaApplication and emitted as signals, such as flush() and reload().
This signal is emitted whenever a category is added, removed or edited.
This signal is emitted when the clock style is changed. If ampm is true, the clock style is a 12-hour AM/PM clock, otherwise, it is a 24-hour clock.
Warning: When using the QTimeString functions all strings obtained by QTimeString should be updated to reflect the changes.
See also dateFormatChanged().
This signal is emitted whenever one or more QContent is stored, removed or edited. ids contains the list of Id's of the content that is being modified. type contains the type of change.
This signal is emitted whenever the date format is changed.
Warning: When using QTimeString functions, all QTimeString strings should be updated to reflect the changes.
See also clockChanged().
Enters the main event loop and waits until exit() is called.
See also QApplication::exec().
Shows and calls exec() on dialog. An heuristic approach is taken to determine the size and maximization of the dialog.
nomax forces it to not be maximized.
Grabs the physical keyboard keys, e.g. the application's launching keys. Instead of launching applications when these keys are pressed the signals emitted are sent to this application instead. Some games programs take over the launch keys in this way to make interaction easier.
Under Qtopia Phone Edition this function does nothing. It is not possible to grab the keyboard under Qtopia Phone Edition.
See also ungrabKeyboard().
Explicitly hide the current input method.
The current input method is still indicated in the taskbar, but no longer takes up screen space, and can no longer be interacted with.
See also showInputMethod().
Returns the currently set hint to the system as to whether widget w has any use for text input methods.
See also setInputMethodHint() and InputMethodHint.
Returns the currently set hint parameter for widget w.
See also setInputMethodHint() and InputMethodHint.
Returns true if the dialog diag is set to have MenuLike behaviour when executed, otherwise returns false.
See also setMenuLike().
Returns true if the application will quit after processing the current list of qcop messages, otherwise returns false.
See also setKeepRunning().
Loads the translation file specified by qms. qms can be the name of a library or application.
This is an overloaded member function, provided for convenience.
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
It is the same as calling loadTranslations(QString) for each entry of qms.
Filters Qt event e to implement Qtopia-specific functionality.
Reimplemented from QApplication.
Rotates Qtopia by r degrees.
Hints to the system that widget w has use for text input methods as specified by mode. If mode is Named, then param specifies the name.
See also inputMethodHint() and InputMethodHint.
This is an overloaded member function, provided for convenience.
Hints to the system that widget w has use for the text input method specified by named. Such methods are input-method-specific and are defined by the files in [qt_prefix]/etc/im/ for each input method.
For example, the phone key input method includes support for the names input methods:
The effect in the phone key input method is to modify the binding of phone keys to characters (such as making "@" easier to input), and to add additional words to the recognition word lists, such as: www.
If the current input method doesn't understand the hint, it will be ignored.
See also inputMethodHint() and InputMethodHint.
If an application is started via a QCop message, the application will process the QCop message and then quit. If the application calls this function while processing a QCop message, after processing its outstanding QCop messages the application will continue running and by defualt display the user interface.
To continue running without displaying the user interface use QtopiaApplication::HideUI as the mode.
See also keepRunning().
b equal to true sets the dialog diag to have MenuLike behaviour when executed, otherwise sets dialog to have default dialog behaviour.
MenuLike dialogs typically have a single list of options, and should accept the dialog when the select key is pressed on the appropriate item, and when a mouse/stylus is used to click on an item. Key focus should be accepted by only one widget.
By marking a dialog as MenuLike Qtopia will map the Back key to reject the dialog and will not map any key to accept the dialog - that must be user-defined.
The default dialog behaviour is to include a cancel menu option in the context menu to reject the dialog and to map the Back key to accept the dialog.
See also isMenuLike().
Causes widget w to receive mouse events according to the stylus mode.
See also stylusOperation() and StylusMode.
This method temporarily overrides the current global screen saver with the ScreenSaverHint hint, allowing applications to control screensaver activation during their execution.
See also ScreenSaverHint.
Shows dialog. An heuristic approach is taken to determine the size and maximization of the dialog.
nomax forces it to not be maximized.
Explicitly show the current input method.
Input methods are indicated in the taskbar by a small icon. If the input method is activated (shown) then it takes up some proportion of the bottom of the screen, to allow the user to interact (input characters) with it.
See also hideInputMethod().
Sets widget mw as the mainWidget() and shows it. For small windows, consider passing true for nomaximize rather than the default false.
This calls designates the application as a document-oriented application.
The mw widget must have this slot: setDocument(const QString&).
See also showMainWidget().
Sets widget mw as the mainWidget() and shows it. For small windows, consider passing true for nomaximize rather than the default false.
See also showMainDocumentWidget().
Returns the current StylusMode for widget w.
See also setStylusOperation() and StylusMode.
This signal is emitted when the time changes outside the normal passage of time, that is, if the time is set backwards or forwards.
If the application offers the TimeMonitor service, it will get the QCop message that causes this signal even if it is not running, thus allowing it to update any alarms or other time-related records.
Reverses the effect of grabKeyboard(). This is called automatically on program exit.
This signal is emitted whenever the mute state is changed. If muted is true, then sound output has been muted.
This signal is emitted if the week start day is changed. If startOnMonday is true then the first day of the week is Monday otherwise the first day of the week is Sunday.
| Copyright © 2006 Trolltech | Trademarks | Qtopia 4.1.7 |