Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User jjralph's Avatar
    Join Date
    Jul 2012
    Posts
    1
    Hello! I am working on a project for Symbian S60 v3 using Qt 4.7.3 and I need to intercept events such as Red Key Pressed. I have found some examples on how to do it, but when I try it myself I get the following errors:

    Code:
    mainwindow.h:5: error: avkon.hrh: No such file or directory
    mainwindow.h:6: error: w32std.h: No such file or directory
    mainwindow.h:34: error: ISO C++ forbids declaration of 'TWsEvent' with no type
    mainwindow.h:34: error: expected ',' or '...' before '&' token
    I have added the path to these files in my .PRO file:
    INCLUDEPATH += C:\\QtSDK\\Symbian\\SDKs\\Symbian1Qt473\\epoc32\\include

    This seems to have solved the problem, but then I get the following errors

    e32des16.h:691: error: #error no typedef for __TText
    e32def.h:872: error: 'Int64' does not name a type
    e32def.h:883: error: 'Uint64' does not name a type
    e32const.h:860: error: 'TInt64' does not name a type
    e32const.h:882: error: 'TUint64' does not name a type
    e32cmn.h:41: error: 'IMPORT_C' does not name a type
    e32cmn.inl:2537: error: no matching function for call to 'TBufBase8::TBufBase8(int)'

    After declaring Int64, Uint64, TInt64 and TUint64 some of the messages disappear, but I don't know how to solve the others.
    I am asking if someone knows what the problem is and how to solve it.
    Here is the code for my app:

    .PRO file:
    Code:
    # Add files and directories to ship with the application 
    # by adapting the examples below.
    # file1.source = myfile
    # dir1.source = mydir
    DEPLOYMENTFOLDERS = # file1 dir1
    
    symbian:TARGET.UID3 = 0xE09286BD
    
    # Smart Installer package's UID
    # This UID is from the protected range 
    # and therefore the package will fail to install if self-signed
    # By default qmake uses the unprotected range value if unprotected UID is defined for the application
    # and 0x2002CCCF value if protected UID is given to the application
    #symbian:DEPLOYMENT.installer_header = 0x2002CCCF
    
    # Allow network access on Symbian
    symbian:TARGET.CAPABILITY += NetworkServices
    
    # If your application uses the Qt Mobility libraries, uncomment
    # the following lines and add the respective components to the 
    # MOBILITY variable. 
    # CONFIG += mobility
    # MOBILITY +=
    
    SOURCES += main.cpp mainwindow.cpp
    HEADERS += mainwindow.h
    FORMS += mainwindow.ui
    INCLUDEPATH += C:\\QtSDK\\Symbian\\SDKs\\Symbian1Qt473\\epoc32\\include
    
    # Please do not modify the following two lines. Required for deployment.
    include(deployment.pri)
    qtcAddDeployment()
    mainwindow.h

    Code:
    #ifndef MAINWINDOW_H
    #define MAINWINDOW_H
    
    #include <QtGui/QMainWindow>
    #include "avkon.hrh"
    #include "w32std.h"
    
    namespace Ui {
        class MainWindow;
    }
    
    class MainWindow : public QMainWindow
    {
        Q_OBJECT
    public:
        enum ScreenOrientation {
            ScreenOrientationLockPortrait,
            ScreenOrientationLockLandscape,
            ScreenOrientationAuto
        };
    
        explicit MainWindow(QWidget *parent = 0);
        virtual ~MainWindow();
    
        // Note that this will only have an effect on Symbian and Fremantle.
        void setOrientation(ScreenOrientation orientation);
    
        void showExpanded();
    
    private:
        Ui::MainWindow *ui;
    
    private slots:
        void HandleWsEventL(const TWsEvent &aEvent, CCoeControl *aDestination);
    };
    
    #endif // MAINWINDOW_H
    mainwindow.cpp
    Code:
    #include "mainwindow.h"
    #include "ui_mainwindow.h"
    
    #include <QtCore/QCoreApplication>
    
    MainWindow::MainWindow(QWidget *parent)
        : QMainWindow(parent), ui(new Ui::MainWindow)
    {
        ui->setupUi(this);
    }
    
    MainWindow::~MainWindow()
    {
        delete ui;
    }
    
    void MainWindow::setOrientation(ScreenOrientation orientation)
    {
    #if defined(Q_OS_SYMBIAN)
        // If the version of Qt on the device is < 4.7.2, that attribute won't work
        if (orientation != ScreenOrientationAuto) {
            const QStringList v = QString::fromAscii(qVersion()).split(QLatin1Char('.'));
            if (v.count() == 3 && (v.at(0).toInt() << 16 | v.at(1).toInt() << 8 | v.at(2).toInt()) < 0x040702) {
                qWarning("Screen orientation locking only supported with Qt 4.7.2 and above");
                return;
            }
        }
    #endif // Q_OS_SYMBIAN
    
        Qt::WidgetAttribute attribute;
        switch (orientation) {
    #if QT_VERSION < 0x040702
        // Qt < 4.7.2 does not yet have the Qt::WA_*Orientation attributes
        case ScreenOrientationLockPortrait:
            attribute = static_cast<Qt::WidgetAttribute>(128);
            break;
        case ScreenOrientationLockLandscape:
            attribute = static_cast<Qt::WidgetAttribute>(129);
            break;
        default:
        case ScreenOrientationAuto:
            attribute = static_cast<Qt::WidgetAttribute>(130);
            break;
    #else // QT_VERSION < 0x040702
        case ScreenOrientationLockPortrait:
            attribute = Qt::WA_LockPortraitOrientation;
            break;
        case ScreenOrientationLockLandscape:
            attribute = Qt::WA_LockLandscapeOrientation;
            break;
        default:
        case ScreenOrientationAuto:
            attribute = Qt::WA_AutoOrientation;
            break;
    #endif // QT_VERSION < 0x040702
        };
        setAttribute(attribute, true);
    }
    
    void MainWindow::showExpanded()
    {
    #ifdef Q_OS_SYMBIAN
        showFullScreen();
    #elif defined(Q_WS_MAEMO_5)
        showMaximized();
    #else
        show();
    #endif
    }
    
    void MainWindow::HandleWsEventL(const TWsEvent &aEvent, CCoeControl *aDestination)
    {
        switch ()
    }
    Thank you in advance!

  2. #2
    Registered User andreagrandi's Avatar
    Join Date
    Nov 2011
    Location
    Tampere
    Posts
    12
    Please post exactly the error that you get. We cannot help you if you just say "some of the messages disappear, but I don't know how to solve the others".
    You are also missing ";" after the swicth() command.
    Best regards.
    --
    Andrea Grandi - Nokia-DXM/Tampere / Qt Ambassador
    Ubuntu Member: https://launchpad.net/~andreagrandi
    website: http://www.andreagrandi.it

Similar Threads

  1. AVKON 60
    By pramod_salt in forum Symbian C++
    Replies: 0
    Last Post: 2008-04-10, 05:41
  2. Errors in #include S60 3rd
    By jascco in forum Symbian C++
    Replies: 6
    Last Post: 2006-08-21, 07:33
  3. Error : Too many include paths! Please reduce the number of include paths or ....
    By npr.novo in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 8
    Last Post: 2006-02-06, 21:42
  4. about avkon.mbm and avkon.rsg
    By ThreeSixFiveOh in forum Bluetooth Technology
    Replies: 0
    Last Post: 2003-12-02, 17:43

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved