[eclipse CDT+Qt4.4.0] une méthode n'est pas reconnue dans le .cpp
Bonjour,
je recopie en ce moment un programme de tableur; et j'ai une erreur que je ne comprends pas, voici le programme (extrait):
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
|
QVariant Cell::value() const
{
if (cacheDirty)
{
cacheDirty=false;
QString formulaStr=formula();
if (formulaStr.startsWith('\''))
cachedValue=formulaStr.mid(1);
else if (formulaStr.startsWith("="))
{
cachedValue=Invalid;
QString expr=formulaStr.mid(1);
expr.replace(" ","");
expr.append(QChar::Null);
int pos=0;
cachedValue = evalExpression(expr,pos); <----------
if (expr[pos] != QChar::Null)
cachedValue=Invalid;
}
else
{
bool ok;
double d=formulaStr.toDouble(&ok);
if (ok)
cachedValue=d;
else
cachedValue=formulaStr;
}
}
return cachedValue;
} |
l'erreur se situe au niveau de la flèche
l'erreur est:
Citation:
no matching function for call to `Cell::evalExpression(QString&, int&) const'
pour info voici le code de cell.h:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
#ifndef CELL_H_
#define CELL_H_
#include <QTableWidgetItem>
class Cell:public QTableWidgetItem
{
public:
Cell();
QTableWidgetItem* clone() const;
void setData (int role,const QVariant& value);
QVariant data(int role) const;
void setFormula(const QString& formula);
QString formula() const;
void setDirty();
private:
QVariant value() const;
QVariant evalExpression(const SQtring& str,int& pos) const;
QVariant evalTerm(const QString& str,int& pos)const;
QVariant evalFactor(const QString& str,int& pos)const;
mutable QVariant cachedValue;
mutable bool cacheDirty;
};
#endif /*CELL_H_*/ |
je précise que cell.h représente une cellule du tableur, elle est dérivée de QTableWidgetItem(le tableur est implémenté par le composant QTableWidget).
lolveley.