Created
August 10, 2020 21:55
-
-
Save symroc/8d150e1ccc2918da5e9a5262f5fcd021 to your computer and use it in GitHub Desktop.
How To subclass QListWidgetItem
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef LWI_H | |
#define LWI_H | |
#include <QListWidgetItem> | |
#include <QListWidget> | |
#include <QString> | |
#include "f2t.h" | |
class lwi : public QListWidgetItem { | |
public: | |
lwi(QListWidget* parent):QListWidgetItem(parent){} | |
private: | |
bool operator<(const QListWidgetItem &other)const { | |
uint self=your_customized_function(text()); | |
uint comp=your_customized_function(other.text()); | |
return self < comp; | |
} | |
}; | |
#endif // LWI_H |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment