forked from qt-creator/qt-creator
Make some qHash and comparison operators overloads hidden friends
Restricts lookup scope more to necessary bits. Change-Id: Ia42c95aaa70534843b7f6a90bfc56d2a1202c612 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -60,22 +60,22 @@ protected:
|
||||
|
||||
struct Section
|
||||
{
|
||||
friend bool operator<(const Section &lhs, const Section &rhs)
|
||||
{
|
||||
if (lhs.priority < rhs.priority)
|
||||
return true;
|
||||
return lhs.priority > rhs.priority ? false : lhs.name < rhs.name;
|
||||
}
|
||||
|
||||
friend bool operator==(const Section &lhs, const Section &rhs)
|
||||
{
|
||||
return lhs.priority == rhs.priority && lhs.name == rhs.name;
|
||||
}
|
||||
|
||||
QString name;
|
||||
int priority;
|
||||
};
|
||||
|
||||
inline bool operator<(const Section &lhs, const Section &rhs)
|
||||
{
|
||||
if (lhs.priority < rhs.priority)
|
||||
return true;
|
||||
return lhs.priority > rhs.priority ? false : lhs.name < rhs.name;
|
||||
}
|
||||
|
||||
inline bool operator==(const Section &lhs, const Section &rhs)
|
||||
{
|
||||
return lhs.priority == rhs.priority && lhs.name == rhs.name;
|
||||
}
|
||||
|
||||
class SectionedProducts : public QStackedWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
Reference in New Issue
Block a user