As I've written in another thread, I have subclassed
{
public:
QInt64Item(qint64 data=0);
bool operator< ( const QInt64Item& other ) const;
protected:
qint64 m_data;
};
class QInt64Item : public QTableWidgetItem
{
public:
QInt64Item(qint64 data=0);
QVariant data(int role) const;
bool operator< ( const QInt64Item& other ) const;
protected:
qint64 m_data;
};
To copy to clipboard, switch view to plain text mode
and sorting the data (clicking on the header of the table) works (=sorted as expected) as long as
QInt64Item::data(Qt::DisplayRole)
QInt64Item::data(Qt::DisplayRole)
To copy to clipboard, switch view to plain text mode
returns the qint64 variable m_data, and not QString::number(m_data).
This puzzles me. What sort is acctually beeing run when clicking in the table header?
My comparison function
bool QInt64Item::operator< ( const QInt64Item& other ) const
{
return m_data < other.m_data;
}
bool QInt64Item::operator< ( const QInt64Item& other ) const
{
return m_data < other.m_data;
}
To copy to clipboard, switch view to plain text mode
can't possible be used for this. 
So how does this acctually work?
Bookmarks