Namespaces

Variants
Actions

Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

Revision as of 20:26, 30 October 2013 by kiran10182 (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Porting Qt Quick Components to Symbian^1

From Wiki
Jump to: navigation, search
Article Metadata
Compatibility
Platform(s): Symbian^1 and later, Qt 4.7 and later
Symbian
Article
Keywords: Qt Quick Components, Porting, Symbian^1, Symbian 5th
Created: Sebastiano galazzo (23 Apr 2012)
Last edited: kiran10182 (30 Oct 2013)

Contents

Introduction

The aim of this project is not to reinvent the wheel. Everything started when, decided to port my app developed for Symbian^3 with QtQuick Components to Symbian^1, I realized that I had to modify much code lines, most of which where of common components.
The project begins with one component, QueryDialog and will be updated each time will be added new components, as needed.
Components will be developed both in QML and Qt/C++ with the target to provide the same interface to minimize the effort.
Please check the QtQuick_Components_S1 project.

Setup

  • Download the project from here and include inside your project directory.
  • Open your .pro file and add the following lines:
include(./QtQuick_Component_S1/qtquickcomponents1.pri)

QueryDialog

main.cpp

...
#include <QtDeclarative>
#include "QtQuick_Components_S1/QueryDialog.h"
...
Q_DECL_EXPORT int main(int argc, char *argv[])
{
QScopedPointer<QApplication> app(createApplication(argc, argv));
...
qmlRegisterType<QueryDialog>("QtQuickS1", 1, 0, "QueryDialog");
...
}

QML

import QtQuickS1 1.0
 
Rectangle {
id: mainPage
 
QueryDialog {
id: bannedDialog
icon: "BlacklistManager64.png"
titleText: qsTr("Daily availability reached!")
message: qsTr("You cannot set more than one contact on free version.\nSwitch to Full Version to unlock all limits ?\n\n")
acceptButtonText: qsTr("Yes")
rejectButtonText: qsTr("No")
 
onAccepted: {
.....
}
 
onRejected: {
.....
}
}
}

At time of writing have been implemented the following properties:

  • message
  • titleText
  • icon
  • acceptButton
  • rejectButton

The code snippet

class QueryDialog : public QObject
{
Q_OBJECT
Q_PROPERTY(QString message READ text WRITE setText)
Q_PROPERTY(QString titleText READ titleText WRITE setTitleText)
Q_PROPERTY(QString icon READ icon WRITE setIcon)
Q_PROPERTY(QString acceptButtonText READ acceptButtonText WRITE setAcceptButtonText)
Q_PROPERTY(QString rejectButtonText READ rejectButtonText WRITE setRejectButtonText)
.....

Work In Progress

  • CheckBox
  • ListItem
This page was last modified on 30 October 2013, at 20:26.
160 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×