Hi friends
My code is here:
Code:
1. #include "mainwindow.h"
2.#include <QtGui/QApplication>
3.
4. #ifdef Q_OS_SYMBIAN
5. // Need these includes to lock orientation in Symbian
6. #include <eikenv.h>
7. #include <eikappui.h>
8. #include <aknenv.h>
9. #include <aknappui.h>
10.#else
11. #warning :Q_OS_SYMBIAN not defined
12.#endif
13.
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
MainWindow mainWindow;
mainWindow.setOrientation(MainWindow::ScreenOrientationAuto);
mainWindow.showExpanded();
QString temp;
#ifdef Q_OS_SYMBIAN
TInt i=9;
QVariant iVar =i ;
if ( iVar.canConvert<QString>())
{
temp = "The type TInt converted successfully to string\nTInt i==" ;
tem += i.toString() ;
mainWindow.Text ( temp );
}
#elif defined(Q_OS_SYMBIAN)
TInt i=9;
QVariant iVar =i ;
if ( iVar.canConvert<QString>())
{
temp = "No Q_WS_S60 defined.\n"+
"The type TInt converted successfully to string\nTInt i==" ;
tem += i.toString() ;
mainWindow.Text ( temp );
}
#elif defined(Q_WS_MAEMO_5)
TInt i=9;
QVariant iVar =i ;
if ( iVar.canConvert<QString>())
{
temp = "No Q_WS_S60 and Q_OS_SYMBIAN defined.\n"+
"The type TInt converted successfully to string\nTInt i==" ;
tem += i.toString() ;
mainWindow.Text ( temp );
}
#else
temp = "No Q_WS_S60 and Q_OS_SYMBIAN and Q_WS_MAEMO_5 defined";
mainWindow.Text (temp);
#endif
return app.exec();
}
I get the #warning :Q_OS_SYMBIAN not defined at line 11 and none of instructions inside the macro blocks in the main function execute.
I used a simple Text() function to write a string on the phone display.
Regards