clock/clockui/clockapplication/src/main.cpp
changeset 58 ef813d54df51
parent 50 579cc610882e
equal deleted inserted replaced
50:579cc610882e 58:ef813d54df51
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 // System includes
    18 // System includes
    19 #include <QtGui>
    19 #include <QtGui>
    20 #include <QScopedPointer>
       
    21 #include <HbTranslator>
    20 #include <HbTranslator>
    22 #include <HbApplication>
       
    23 #include <HbMainWindow>
    21 #include <HbMainWindow>
    24 
    22 
    25 // User includes
    23 // User includes
    26 #include "clockappcontroller.h"
    24 #include "clockapplication.h"
       
    25 #include "OstTraceDefinitions.h"
       
    26 #ifdef OST_TRACE_COMPILER_IN_USE
       
    27 #include "mainTraces.h"
       
    28 #endif
       
    29 
    27 
    30 
    28 /*!
    31 /*!
    29 	The main entry point of the clock application.
    32 	The main entry point of the clock application.
    30 
    33 
    31 	Constructs the view manager object.
    34 	Constructs the view manager object.
    32  */
    35  */
    33 int main(int argc, char *argv[])
    36 int main(int argc, char *argv[])
    34 {
    37 {
    35 	// Initialization
    38 	OstTraceFunctionEntry0( _MAIN_ENTRY );
    36 	HbApplication app(argc, argv);
    39 	// Create and initialize an ClockApplication instance
    37 
    40 	QScopedPointer<ClockApplication> application(
       
    41 				new ClockApplication(argc, argv));
       
    42 	
    38 	// Main window widget.
    43 	// Main window widget.
    39 	// Includes decorator such as signal strength and battery life indicator.
    44 	// Includes decorator such as signal strength and battery life indicator.
    40 	HbMainWindow window;
    45 	HbMainWindow window;
    41 	window.setRenderHints(
    46 	window.setRenderHints(
    42 			QPainter::HighQualityAntialiasing | QPainter::SmoothPixmapTransform);
    47 			QPainter::HighQualityAntialiasing | QPainter::SmoothPixmapTransform);
    45 	// Load the translation file.
    50 	// Load the translation file.
    46 	HbTranslator translator("clock");
    51 	HbTranslator translator("clock");
    47 	translator.loadCommon();
    52 	translator.loadCommon();
    48 	
    53 	
    49 	// Construct the application controller.
    54 	// Construct the application controller.
    50 	QScopedPointer<ClockAppController> controller(new ClockAppController);
    55 	application->createController();
    51 	Q_UNUSED(controller)
       
    52 
    56 
    53 	// Show widget
    57 	// Show widget
    54 	window.show();
    58 	window.show();
    55 
    59 
    56 	// Enter event loop
    60 	// Start the event loop for the application
    57 	return app.exec();
    61 	return application->execution();
    58 }
    62 }
    59 
    63 
    60 // End of file	--Don't remove this.
    64 // End of file	--Don't remove this.