tags:

views:

20

answers:

2

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:

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:

alt text

And this is the same error in more detail:

alt text

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 :(

+1  A: 

Incomplete type signifies that the class (in this case struct) declaration has not been included properly, in this case of QMaemo5ValueButtonPrivate.

This is possibly due to circular includes.

ufotds
+1  A: 

It looks like you haven't included the required headers. You also need add maemo to your qmake project file.

#include <Maemo5ValueButton>

and

QT += maemo5

For more information check out the following example: http://doc.qt.nokia.com/qt-maemo-4.6/maemo5-listpickselector.html

Masse
Have already tried both these things .. Didn't help .. The interesting thing to note is that the errors are only related with QMaemo5ValueButton .. There are no similar errors for QMaemo5ListPickSelector ..
Ahmad
In that case make a new project that just uses this class to see if the error persist. If not, you have to try and work your way down and try to create the simplest self contained program that reproduces it. Or comment out parts of your code and omit some includes etc until the error goes away to locate it. Make sure you fully understand the intricacies of includes. Use include guards, include as much as possible in cpp files instead of in .h files etc. Check those questions: http://stackoverflow.com/questions/691079/is-there-a-standard-include-convention-for-c
ufotds
http://stackoverflow.com/questions/2762568/c-c-include-file-order-best-practices
ufotds