| Classes | Functions | DevRef | Qt API Qtopia Documentation

Qtopia - The main Document Widget

Applications which view or edit a particular type or types of files are called document-oriented applications. Qtopia has framework support to simplify the implementation of such applications. The main() function is slightly different in these applications.

The top-level widget of a document-oriented application must have a FileManager fm; if ( current ) { if ( !fm.saveFile( *current, data ) ) { // error return; } delete current; } current = new DocLnk( applnk_filename ); if ( !fm.loadFile( *current, data ) ) { // error } }

Document-oriented applications will always declare the the MIME types that they support by adding a line to their .desktop file, specifying each supported type, seperated by semi-colons:

    MimeType=type/subtype;type/subtype;...

The subtype can be "*", indicating that this application can process all forms of the given type. Such an application is only invoked if no other more specific application is available.

At installation, you may also choose to execute the following:

    qtopia-addmimetype type/subtype extension

This will allow plain filenames such as those on CF or SD cards inserted into the device to be recognized as MIME-typed documents.


Copyright © 2001-2002 TrolltechTrademarks
Qtopia version 1.5.0