2012-01-07 16:53:23 +00:00
|
|
|
#ifndef _PAYSAGES_QT_TOOLS_H_
|
|
|
|
#define _PAYSAGES_QT_TOOLS_H_
|
|
|
|
|
|
|
|
#include <QColor>
|
2012-06-02 14:17:01 +00:00
|
|
|
#include <QDialog>
|
2012-01-07 16:53:23 +00:00
|
|
|
|
|
|
|
#include "../lib_paysages/shared/types.h"
|
2013-01-19 22:42:50 +00:00
|
|
|
#include "../lib_paysages/tools/color.h"
|
2012-01-07 16:53:23 +00:00
|
|
|
|
|
|
|
static inline QColor colorToQColor(Color color)
|
|
|
|
{
|
2012-01-17 20:54:14 +00:00
|
|
|
colorNormalize(&color);
|
2012-01-07 16:53:23 +00:00
|
|
|
return QColor(color.r * 255.0, color.g * 255.0, color.b * 255.0, color.a * 255.0);
|
|
|
|
}
|
|
|
|
|
2012-06-02 14:17:01 +00:00
|
|
|
class DialogWithPreview:public QDialog
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
DialogWithPreview(QWidget* parent);
|
2013-01-19 22:42:50 +00:00
|
|
|
|
2012-06-02 14:17:01 +00:00
|
|
|
protected:
|
|
|
|
virtual bool event(QEvent* event);
|
|
|
|
};
|
|
|
|
|
2012-06-02 09:46:24 +00:00
|
|
|
#ifndef NDEBUG
|
|
|
|
#include <QDebug>
|
|
|
|
static inline void logDebug(QString string)
|
|
|
|
{
|
|
|
|
qDebug() << string;
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
#define logDebug(_x_) ;
|
|
|
|
#endif
|
|
|
|
|
2012-01-24 13:16:20 +00:00
|
|
|
#endif
|