Reply
Thread Tools
Posts: 25 | Thanked: 9 times | Joined on Oct 2010 @ Germany / Mannheim
#1
hi,

i'm on my first app and dont know why this error appears:

B:\Qt\test2\mainwindow.cpp:26: Fehler:no matching function for call to 'QMaemo5InformationBox::information(MainWindow* const, QString*&, QMaemo5InformationBox::<anonymous enum>)'


Code:
#include "QtMaemo5/QMaemo5InformationBox"

void MainWindow::warning(QString *text){
    QMaemo5InformationBox::information(this, text, QMaemo5InformationBox::DefaultTimeout);
}

whats wrong with that code? its coppied from QT expamples...
 
Posts: 3,074 | Thanked: 12,964 times | Joined on Mar 2010 @ Sofia,Bulgaria
#2
Are you sure argument is QString *. Try with const QString &
 
marxian's Avatar
Posts: 2,448 | Thanked: 9,523 times | Joined on Aug 2010 @ Wigan, UK
#3
Correct function signature is

Code:
void QMaemo5InformationBox::information ( QWidget * parent, const QString & message, int timeout = DefaultTimeout )
__________________
'Men of high position are allowed, by a special act of grace, to accomodate their reasoning to the answer they need. Logic is only required in those of lesser rank.' - J K Galbraith

My website

GitHub
 
Posts: 25 | Thanked: 9 times | Joined on Oct 2010 @ Germany / Mannheim
#4
like this?
Code:
void MainWindow::warning(const QString & text){
    QMaemo5InformationBox::information(this, text, QMaemo5InformationBox::DefaultTimeout);
}
got: B:\Qt\test2\mainwindow.cpp:26: Fehler:undefined reference to `QMaemo5InformationBox::information(QWidget*, QString const&, int)'

Last edited by bullrin; 2011-07-28 at 21:14.
 
marxian's Avatar
Posts: 2,448 | Thanked: 9,523 times | Joined on Aug 2010 @ Wigan, UK
#5
I imagine you need

Code:
CONFIG += maemo5
In your .pro file. Do you have this already?
__________________
'Men of high position are allowed, by a special act of grace, to accomodate their reasoning to the answer they need. Logic is only required in those of lesser rank.' - J K Galbraith

My website

GitHub
 
Posts: 25 | Thanked: 9 times | Joined on Oct 2010 @ Germany / Mannheim
#6
uhm, no didnt help
 
MohammadAG's Avatar
Posts: 2,473 | Thanked: 12,265 times | Joined on Oct 2009 @ Jerusalem, PS/IL
#7
QStrings should NOT be used as pointers.

Code:
void MainWindow::warning(QString text)
{
    QMaemo5InformationBox::information(this, text);
}
Should work.
You need QT += maemo5 in the .pro file

Edit: why do you need a method for this? Just use it directly.

Last edited by MohammadAG; 2011-07-29 at 08:51.
 
Posts: 25 | Thanked: 9 times | Joined on Oct 2010 @ Germany / Mannheim
#8
Originally Posted by MohammadAG View Post
QStrings should NOT be used as pointers.

Code:
void MainWindow::warning(QString text)
{
    QMaemo5InformationBox::information(this, text);
}
Should work.
You need QT += maemo5 in the .pro file

Edit: why do you need a method for this? Just use it directly.

Mhh i tried but got this error:
B:\Qt\test2\mainwindow.cpp:28: Fehler:undefined reference to `QMaemo5InformationBox::information(QWidget*, QString const&, int)'


this is mir pro file:
Code:
QT       += core gui

TARGET = test2
TEMPLATE = app


SOURCES += main.cpp\
        mainwindow.cpp

HEADERS  += mainwindow.h

FORMS    += mainwindow.ui

CONFIG += maemo5
CONFIG += mobility

MOBILITY = 


symbian {
    TARGET.UID3 = 0xe4b410fa
    # TARGET.CAPABILITY += 
    TARGET.EPOCSTACKSIZE = 0x14000
    TARGET.EPOCHEAPSIZE = 0x020000 0x800000
}

OTHER_FILES += \
    qtc_packaging/debian_fremantle/rules \
    qtc_packaging/debian_fremantle/README \
    qtc_packaging/debian_fremantle/copyright \
    qtc_packaging/debian_fremantle/control \
    qtc_packaging/debian_fremantle/compat \
    qtc_packaging/debian_fremantle/changelog

maemo5 {
    target.path = /opt/test2/bin
    INSTALLS += target

}

its easier to call the method warning, i think.
 
marxian's Avatar
Posts: 2,448 | Thanked: 9,523 times | Joined on Aug 2010 @ Wigan, UK
#9
As MAG says, remove

Code:
CONFIG += maemo5
and just add maemo5 to the line

Code:
QT += core gui
so you have

Code:
QT += core gui maemo5
__________________
'Men of high position are allowed, by a special act of grace, to accomodate their reasoning to the answer they need. Logic is only required in those of lesser rank.' - J K Galbraith

My website

GitHub
 
Posts: 25 | Thanked: 9 times | Joined on Oct 2010 @ Germany / Mannheim
#10
yay! that works! Thanks very much to all !
 
Reply


 
Forum Jump


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