Tuesday, January 20, 2009

30secs FAQ

1) Screen Resolution not correct on 3.1 Device. Your application runs out of bounds when created from Template.

Check the settings for the default window. There is nothing wrong in your setup. The Templates are not stable yet. So some manipulation is required.

2) Unable to close QT application.
Just press Red key on your phone and the application would be closed.

3) Unable to find custom slot created in my class, when using Signal/Slot dialog box. How do I use the custom slot in such a scenario?
Probably you need to work a way around this. Edit "MyApplication.cpp"(Name of Application in this case is MyApplication. Add your signal slot call in constructor of your MyApplication Class function. And there you go :)
for Eg:
GUIWidget.h
class GUIWidget : public QWidget
{
public slots:
void plusClicked();
:
:
};

GUIWidget.cpp
GUIWidget::GUIWidget(QWidget *parent)
: QWidget(parent)
{
ui.setupUi(this);
QObject::connect(ui.pushButton1, SIGNAL(clicked()), this, SLOT(plusClicked()));
}
NOTE: "pushButton1" is the button created using GUI toolbox(QT C++ Widget Box).

4) New Signal/slot information is not reflected (after new interaction is added using Signal/Slot dialog Box) to the class is not reflected in ui_MyApplication.h, when seen in Carbide.
Just close the MyApplication.ui (after addition of new Signal/Slot information in Signal/Slot Dialog Box )and open ui_MyApplication.h. It should now work for you. You can verify the changes simultaneously by opening the ui_MyApplication.h file in some other editor.

5) How to Change UID of the application

Edit .pro file of the application.

6) How do I add new src paths and files

Edit the .pro file of the application.

7) How do I add icon to PushButton?
QPixmap pixmap("c:\\ncim_logo.png");
QIcon icon("c:\\ncim_logo.png");
pushButton = new QPushButton("PushButton");
pushButton->setIcon(pixmap);
or
pushButton->setIcon(icon);

NOTE: The png file should be placed at following location /epoc32/winscw/c/Data

8) How to open a large image file?
Open load using QPixmap and edit .pro as follows.
symbian: {
TARGET.EPOCHEAPSIZE = 0x20000 0x1000000
}
A better approach would be to use Image Reader class than using QPixmap as the images load faster than QPixmap.
NOTE: Avoid using large files as the mobile has limited resources and this way of manipulating epoc heap size is not recommended.


8) How to access Private Path?
Use QCoreApplication::applicationDirPath

Keep watching this post for further updates.

Monday, January 19, 2009

Tracing Errors occuring during QT (temple) installation on s60 ( On WinXP)

Here are some of the errors and their resolution(fixes)

a) Gmake Not Found

If you are facing an error similar to this
_________________

:
:
Running syncqt...
Creating qmake...
mwccsym2 -gccinc -stackcommit 1024000 -stackreserve 1024000 -w all -w nonotused
-w nonotinlined -w noimplicit -w nopadding -w noemptydecl -w nounusedexpr -c -o
project.o -O -I. -Igenerators -Igenerators\unix -Igenerators\win32 -Igenerators\
mac -Igenerators\symbian -IC:\Qt\4.4.2-pyramid\include -IC:\Qt\4.4.2-pyramid\inc
lude\QtCore -IC:\Qt\4.4.2-pyramid\include -IC:\Qt\4.4.2-pyramid\include\QtCore -
IC:\Qt\4.4.2-pyramid\src\corelib\global -IC:\Qt\4.4.2-pyramid\mkspecs\win32-mwc
-DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_LITE_COMPONENT -DQT_NO_PCRE -DQT_NO
DLL -DQT_NO_STL -DQT_NO_COMPRESS -DHAVE_QCONFIG_CPP -DQT_BUILD_QMAKE -DQT_NO_THR
EAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DATASTREAM -DQT_NO_LIBRARY -IC:
\Qt\4.4.2-pyramid\include\QtScript -DQMAKE_OPENSOURCE_EDITION project.cpp
process_begin: CreateProcess((null), mwccsym2 -gccinc -stackcommit 1024000 -stac
kreserve 1024000 -w all -w nonotused -w nonotinlined -w noimplicit -w nopadding
-w noemptydecl -w nounusedexpr -c -o project.o -O -I. -Igenerators -Igenerators\
unix -Igenerators\win32 -Igenerators\mac -Igenerators\symbian -IC:\Qt\4.4.2-pyra
mid\include -IC:\Qt\4.4.2-pyramid\include\QtCore -IC:\Qt\4.4.2-pyramid\include -
IC:\Qt\4.4.2-pyramid\include\QtCore -IC:\Qt\4.4.2-pyramid\src\corelib\global -IC
:\Qt\4.4.2-pyramid\mkspecs\win32-mwc -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQ
T_LITE_COMPONENT -DQT_NO_PCRE -DQT_NODLL -DQT_NO_STL -DQT_NO_COMPRESS -DHAVE_QCO
NFIG_CPP -DQT_BUILD_QMAKE -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -D
QT_NO_DATASTREAM -DQT_NO_LIBRARY -IC:\Qt\4.4.2-pyramid\include\QtScript -DQMAKE_
OPENSOURCE_EDITION project.cpp, ...) failed.
make (e=2): The system cannot find the file specified.
C:\Symbian\9.2\S60_3rd_FP1\epoc32\tools\make.exe: *** [project.o] Error 2
Creating makefiles in src...
Generating Makefiles...
execute: File or path is not found (C:\Qt\4.4.2-pyramid\bin\qmake)
Qmake failed, return code -1


C:\Qt\4.4.2-pyramid>


__________________________

Check whether you have set the "\Qt\4.4.4-temple\bin" directory correctly in your path. If still you face the problem, intiate the batch file (Configure environment for WINSCW command line) that comes alongwith Carbide Installation.
That should fix the errors if any you might face.

b) Sdk Not Found in carbide when creating QT application from template
Check have you extracted the "qtlibs-4.4.4-temple.exe" given in the instructions. It can be found over here "\QT\Qt4.4.4_temple\". This package contains all the binaries and libraries and headers required to integrate QT as part of sdk.

c) Emulator Option not shown
This will happen, if you forgot to build QT for emulator.
You should do
bldmake bldfiles
abld build winscw udeb
after extracting qtlibs-4.4.4-temple.exe

d) Installation not getting signed
If you sign an application with your developer certificate and you try to install this sometimes it won't work (atleast in my case it doesn't work)
Yet to find a solution for this. :(