1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
| #ifndef CUSTOMITEM_H
| #define CUSTOMITEM_H
|
| #include <QStandardItemModel>
| #include <QDebug>
|
|
| class CustomItem : public QStandardItem
| {
| public:
| CustomItem();
| CustomItem(const QString &text):QStandardItem(text){
| qDebug()<<"有参构造:"<<text;
| }
|
| bool operator < (const QStandardItem &other) const {
| qDebug()<<"< custom";
| return this->text().toDouble() < other.text().toDouble();
| }
| };
|
| #endif // CUSTOMITEM_H
|
|