forked from qt-creator/qt-creator
QmlProfiler: Move qHash and operator== for QmlEventType
It makes more sense to have them in the same location as the actual type. Change-Id: Ia27970173d14cfe361d4fc007cb461f788350b21 Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
This commit is contained in:
@@ -28,6 +28,7 @@
|
||||
#include "qmlprofiler_global.h"
|
||||
|
||||
#include <QString>
|
||||
#include <QHash>
|
||||
|
||||
namespace QmlProfiler {
|
||||
|
||||
@@ -75,6 +76,14 @@ inline bool operator!=(const QmlEventLocation &location1, const QmlEventLocation
|
||||
return !(location1 == location2);
|
||||
}
|
||||
|
||||
inline uint qHash(const QmlEventLocation &location)
|
||||
{
|
||||
return qHash(location.filename())
|
||||
^ ((location.line() & 0xfff) // 12 bits of line number
|
||||
| ((location.column() << 16) & 0xff0000)); // 8 bits of column
|
||||
|
||||
}
|
||||
|
||||
QDataStream &operator>>(QDataStream &stream, QmlEventLocation &location);
|
||||
QDataStream &operator<<(QDataStream &stream, const QmlEventLocation &location);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user