Commit 4062afa0 authored by Christoph Wick's avatar Christoph Wick

added support for Qt 5.2 upwards

parent b2fd972f
......@@ -8,7 +8,13 @@ QT_BEGIN_NAMESPACE
static void qRegisterMidiDeviceInfoMetaTypes()
{
qRegisterMetaType<QMidiDeviceInfo>();
// since Qt 5.5 it is supported to only add a compare operator
#if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0)
QMetaType::registerEqualsComparator<QMidiDeviceInfo>();
#else
// before Qt 5.5 a dummy < operator is added
QMetaType::registerComparators<QMidiDeviceInfo>();
#endif
QMetaType::registerDebugStreamOperator<QMidiDeviceInfo>();
}
......@@ -158,6 +164,18 @@ bool QMidiDeviceInfo::operator !=(const QMidiDeviceInfo& other) const
return !operator==(other);
}
#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0)
/*!
Unimplemented dummy method to support compare operators in Qt versions before 5.5.0.
\a other is a dummy parameter
*/
bool QMidiDeviceInfo::operator<(const QMidiDeviceInfo& other) const {
Q_UNUSED(other);
Q_UNIMPLEMENTED();
return false;
}
#endif
/*!
Returns whether this QMidiDeviceInfo object holds a valid device
definition.
......
......@@ -36,6 +36,11 @@ public:
bool operator==(const QMidiDeviceInfo& other) const;
bool operator!=(const QMidiDeviceInfo& other) const;
#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0)
// unimplemented less operator required for qt < 5.5.0
bool operator<(const QMidiDeviceInfo& other) const;
#endif
bool isNull() const;
QString deviceName() const;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment