Skip to content
Snippets Groups Projects
Commit 0046568c authored by Emmanuel Lepage Vallee's avatar Emmanuel Lepage Vallee
Browse files

Enable Q_DECLARE_METATYPE on some "enum class" types

Refs #66615
parent 29ceb0ce
No related branches found
No related tags found
No related merge requests found
......@@ -1637,7 +1637,7 @@ QVariant Call::roleData(int role) const
return peerContactMethod()->uri();
break;
case Call::Role::Direction2:
return static_cast<int>(d_ptr->m_Direction); //TODO Qt5, use the Q_ENUM
return QVariant::fromValue(d_ptr->m_Direction);
break;
case Call::Role::Date:
return (int)startTimeStamp();
......@@ -1652,7 +1652,7 @@ QVariant Call::roleData(int role) const
return hasRecording();
break;
case Call::Role::Historystate:
return static_cast<int>(historyState());
return QVariant::fromValue(historyState());
break;
case Call::Role::Filter: {
QString normStripppedC;
......@@ -1665,7 +1665,7 @@ QVariant Call::roleData(int role) const
}
break;
case Call::Role::FuzzyDate:
return (int)d_ptr->m_HistoryConst; //TODO Qt5, use the Q_ENUM
return QVariant::fromValue(d_ptr->m_HistoryConst);
break;
case Call::Role::IsBookmark:
return false;
......@@ -1692,7 +1692,7 @@ QVariant Call::roleData(int role) const
return ct?ct->photo():QVariant();
break;
case Call::Role::CallState:
return static_cast<int>(state()); //TODO Qt5, use the Q_ENUM
return QVariant::fromValue(state());
break;
case Call::Role::Id:
return id();
......
......@@ -148,6 +148,7 @@ public:
MISSED , /*!< The call has been missed */
NONE /*!< The legacy state is not set */
};
Q_ENUMS(LegacyHistoryState)
///@enum Direction If the user have been called or have called
enum class Direction : int {
......@@ -349,6 +350,9 @@ Q_SIGNALS:
};
Q_DECLARE_METATYPE(Call*)
Q_DECLARE_METATYPE(Call::State)
Q_DECLARE_METATYPE(Call::Direction)
Q_DECLARE_METATYPE(Call::LegacyHistoryState)
QDebug LIB_EXPORT operator<<(QDebug dbg, const Call::State& c );
QDebug LIB_EXPORT operator<<(QDebug dbg, const Call::DaemonState& c );
......
......@@ -17,7 +17,7 @@
***************************************************************************/
#ifndef PIXMAPMANIPULATIONVISITOR_H
#define PIXMAPMANIPULATIONVISITOR_H
#include "../typedefs.h"
#include <typedefs.h>
//Qt
#include <QtCore/QVariant>
......
......@@ -84,5 +84,7 @@ private:
HistoryTimeCategoryModelPrivate* d_ptr;
Q_DECLARE_PRIVATE(HistoryTimeCategoryModel)
};
Q_DECLARE_METATYPE(HistoryTimeCategoryModel::HistoryConst)
Q_DECLARE_METATYPE(HistoryTimeCategoryModel*)
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment