In file included from XTreeItem.cpp:32:
XTreeItem.moc:36: error: `staticMetaObject' is not a member of `QTreeWidgetItem'
XTreeItem.moc: In member function `virtual void* XTreeItem::qt_metacast(const char*)':
XTreeItem.moc:50: error: `qt_metacast' is not a member of `QTreeWidgetItem'
XTreeItem.moc: In member function `virtual int XTreeItem::qt_metacall(QMetaObject::Call, int, void**)':
XTreeItem.moc:55: error: `qt_metacall' is not a member of `QTreeWidgetItem'
Hmmmmmm very odd errors...
H FILE
#include <QtGui>
Q_OBJECT
public:
XTreeItem(XTreeItem * parent, int type);
virtual bool operator< ( const XTreeItem & other ) const;
};
#include <QtGui>
class XTreeItem : public QTreeWidgetItem {
Q_OBJECT
public:
XTreeItem(QTreeWidget * parent, int type);
XTreeItem(XTreeItem * parent, int type);
virtual bool operator< ( const XTreeItem & other ) const;
};
To copy to clipboard, switch view to plain text mode
CPP FILE:
#include "XTreeItem.h"
XTreeItem
::XTreeItem(QTreeWidget * parent,
int type
= Type
){}
XTreeItem::XTreeItem(XTreeItem * parent, int type = Type ){
}
bool XTreeItem::operator< ( const XTreeItem & other ) const {
int iScore, iMyScore;
iScore = 0;
iMyScore = 0;
if(other.flags() == 0){
if(other.
text(0) == QString("F"))iScore
= 100;
if(other.
text(0) == QString("S"))iScore
= 90;
if(other.
text(0) == QString("T"))iScore
= 80;
if(other.
text(0) == QString("F_"))iScore
= 70;
if(other.
text(0) == QString("F__"))iScore
= 60;
if(other.
text(0) == QString("S_"))iScore
= 50;
}
if(flags() == 0){
if(text
(0) == QString("F"))iMyScore
= 100;
if(text
(0) == QString("S"))iMyScore
= 90;
if(text
(0) == QString("T"))iMyScore
= 80;
if(text
(0) == QString("F_"))iMyScore
= 70;
if(text
(0) == QString("F__"))iMyScore
= 60;
if(text
(0) == QString("S_"))iMyScore
= 50;
}
if(iMyScore < iScore){ return true; } else { return false; }
}
#include "XTreeItem.moc"
#include "XTreeItem.h"
XTreeItem::XTreeItem(QTreeWidget * parent, int type = Type ){
QTreeWidgetItem(parent, type);
}
XTreeItem::XTreeItem(XTreeItem * parent, int type = Type ){
QTreeWidgetItem(parent, type);
}
bool XTreeItem::operator< ( const XTreeItem & other ) const {
int iScore, iMyScore;
iScore = 0;
iMyScore = 0;
if(other.flags() == 0){
if(other.text(0) == QString("F"))iScore = 100;
if(other.text(0) == QString("S"))iScore = 90;
if(other.text(0) == QString("T"))iScore = 80;
if(other.text(0) == QString("F_"))iScore = 70;
if(other.text(0) == QString("F__"))iScore = 60;
if(other.text(0) == QString("S_"))iScore = 50;
}
if(flags() == 0){
if(text(0) == QString("F"))iMyScore = 100;
if(text(0) == QString("S"))iMyScore = 90;
if(text(0) == QString("T"))iMyScore = 80;
if(text(0) == QString("F_"))iMyScore = 70;
if(text(0) == QString("F__"))iMyScore = 60;
if(text(0) == QString("S_"))iMyScore = 50;
}
QTreeWidgetItem::operator< ( other );
if(iMyScore < iScore){ return true; } else { return false; }
}
#include "XTreeItem.moc"
To copy to clipboard, switch view to plain text mode
Bookmarks