maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   Strange compilation errors when I use Maemo5 specific Qt classes .. ! (https://talk.maemo.org/showthread.php?t=57212)

ahmadka 2010-06-26 19:43

Strange compilation errors when I use Maemo5 specific Qt classes .. !
 
Hey guys .. I recently tried to use some Maemo5 specific classes (e.g. QMaemo5ListPickSelector, etc ..), and I'm getting some strange compile time errors ..

Here is a small code I was trying out:

Code:

QMaemo5ValueButton *x = new QMaemo5ValueButton("Hello");
    QStandardItemModel model (10,2);
    int i,j,k;
    for(j=0;j<=1;j++)
    {
        k=0;
        for(i=0;i<=9;i++)
        {
            QStandardItem *item = new QStandardItem(QString("%0").arg(k));
            k+=5;
            model.setItem(i,j,item);
        }
    }
    x->setValueLayout(QMaemo5ValueButton::ValueBesideText);
    QMaemo5ListPickSelector *sel = new QMaemo5ListPickSelector();
    sel->setModel(&model);

    x->setPickSelector(sel);

    QHBoxLayout *hbox = new QHBoxLayout();
    hbox->addWidget(x);

    QVBoxLayout *vbox = new QVBoxLayout();
    vbox->addLayout(hbox);
    vbox->addWidget(canvas);

    scrollArea->setLayout(vbox);

    setCentralWidget(scrollArea);

And this is the error I get:

http://img28.imageshack.us/img28/7491/errorsln.png

And this is the same error in more detail:

http://img526.imageshack.us/img526/5134/errors2.png

I have installed the complete Nokia Qt SDK, and that is what is being used here as well ... The Maemo5 specific libraries are only 'seen' when I select 'Maemo' as the output device ..

Anyone know how can I fix these errors .. ?

I had a hard time configuring Qt Creator the first time round as well, and I really dont want to have to all kinds of un/re-installs all over again :(

w00t 2010-06-26 19:47

Re: Strange compilation errors when I use Maemo5 specific Qt classes .. !
 
I have a feeling about this. Can you zip your project up and make it available somewhere so I can take a look?

cpulvermacher 2010-06-26 19:52

Re: Strange compilation errors when I use Maemo5 specific Qt classes .. !
 
I'm not familiar with QtCreator; but I did get similar errors on a project because I forgot including the QtMaemo5 header and adding QT += maemo5 to the project file.

ahmadka 2010-06-26 20:03

Re: Strange compilation errors when I use Maemo5 specific Qt classes .. !
 
Quote:

Originally Posted by w00t (Post 730555)
I have a feeling about this. Can you zip your project up and make it available somewhere so I can take a look?

Just sent the files to you ..

Quote:

Originally Posted by cpulvermacher (Post 730561)
I'm not familiar with QtCreator; but I did get similar errors on a project because I forgot including the QtMaemo5 header and adding QT += maemo5 to the project file.

Just tried both your ideas .. didn't help :(

w00t 2010-06-26 20:09

Re: Strange compilation errors when I use Maemo5 specific Qt classes .. !
 
Right. Thanks.

Your problem is that you added the QMaemo5ValueButton header to your project. This isn't the right way to use Qt components - you should only add your own header/cpp files to the .pro.

I presume you did this because you couldn't figure out how to use QMaemo5ValueButton?

Open DrawingTest2.pro
Remove:
../../../../../NokiaQtSDK/Maemo/4.6.2/sysroots/fremantle-arm-sysroot-1014-slim/usr/include/QtMaemo5/qmaemo5valuebutton.h
and change:
qpushbuttonx.h \
to
qpushbuttonx.h

Then, go to the top of the file, and change:
QT += core gui
to:
QT += core gui maemo5

This is because the QMaemo5 classes are in a different Qt 'module', so you need to tell the build system that your project uses classes from the maemo5 module.

Hope this helps. If you need more help, just ask. :)

ahmadka 2010-06-26 20:16

Re: Strange compilation errors when I use Maemo5 specific Qt classes .. !
 
^^ wow thanks man, that fixed the issue in a heartbeat .. now I know who to come to when I need more help :P

Thanks again ! :)


All times are GMT. The time now is 18:06.

vBulletin® Version 3.8.8