[Qt-interest] Solved

Pedro Santos nonspam2048 at yahoo.de
Fri May 7 19:20:53 CEST 2010


Ok I've solved my problem. For all who have the same difficulties here my solution:

I changed the follow things in my code:

in the header file:

virtual bool operator<(const PriceTableItem &other)const;

to

virtual bool operator<(const QTableWidgetItem &other)const;


in the cpp file:

bool PriceTableItem::operator==(const PriceTableItem &other)const
{
     return _price.toDouble() == other._price.toDouble();
}

to

bool PriceTableItem::operator<(const QTableWidgetItem &other)const
{

     return _price.toDouble() < ((PriceTableItem&)other)._price.toDouble();
}

Now it works :)



More information about the Qt-interest-old mailing list