color: QDebug implementation
Makes debugging color values easier.
This commit is contained in:
@@ -181,3 +181,9 @@ QColor Color::toQColor() const
|
||||
|
||||
return c;
|
||||
}
|
||||
|
||||
QDebug operator<<(QDebug debug, const Color &r)
|
||||
{
|
||||
debug.nospace() << "[R: " << r.red() << ", G: " << r.green() << ", B: " << r.blue() << ", A: " << r.alpha() << "]";
|
||||
return debug.space();
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define COLOR_H
|
||||
|
||||
#include <QColor>
|
||||
#include <QDebug>
|
||||
|
||||
#include "common/define.h"
|
||||
#include "render/pixelformat.h"
|
||||
@@ -68,4 +69,8 @@ private:
|
||||
|
||||
};
|
||||
|
||||
QDebug operator<<(QDebug debug, const Color& r);
|
||||
|
||||
Q_DECLARE_METATYPE(Color)
|
||||
|
||||
#endif // COLOR_H
|
||||
|
||||
Reference in New Issue
Block a user