notes/notesui/notesapplication/src/main.cpp
changeset 18 c198609911f9
child 23 fd30d51f876b
equal deleted inserted replaced
0:f979ecb2b13e 18:c198609911f9
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: Contains main, the entry point for notes application.
       
    15 *
       
    16 */
       
    17 
       
    18 // System includes
       
    19 #include <qdebug.h>
       
    20 #include <QScopedPointer>
       
    21 #include <QTranslator>
       
    22 #include <hbapplication.h>
       
    23 #include <hbmainwindow.h>
       
    24 
       
    25 // User includes
       
    26 #include "notesappcontroller.h"
       
    27 
       
    28 /*!
       
    29 	The main() function.
       
    30 
       
    31 	Responsible for constructing the NotesAppController object and showing the
       
    32 	main window.
       
    33  */
       
    34 int main(int argc, char *argv[])
       
    35 {
       
    36 	qDebug() << "notes: main -->";
       
    37 
       
    38 	// Create and initialize an HbApplication instance
       
    39 	HbApplication app(argc, argv);
       
    40 
       
    41 	// Main window for providing the scene context
       
    42 	HbMainWindow window;
       
    43 	window.setRenderHints(
       
    44 			QPainter::Antialiasing | QPainter::SmoothPixmapTransform);
       
    45 	window.setViewportUpdateMode(QGraphicsView::MinimalViewportUpdate);
       
    46 
       
    47 	// Load the translation file.
       
    48 	QTranslator notesViewsTranslator;
       
    49 	notesViewsTranslator.load("notes",":/translations");
       
    50 	app.installTranslator(&notesViewsTranslator);
       
    51 
       
    52 	// Construct the application controller.
       
    53 	QScopedPointer<NotesAppController> controller(new NotesAppController);
       
    54 	Q_UNUSED(controller)
       
    55 
       
    56 	// Show the main window.
       
    57 	window.show();
       
    58 
       
    59 	qDebug() << "notes: main <--";
       
    60 
       
    61 	// Start the event loop for the application
       
    62 	return app.exec();
       
    63 }
       
    64 
       
    65 // End of file	--Don't remove this.