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.

No comments:

Post a Comment