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"
|
2012-01-29 17:39:56 +00:00
|
|
|
#include "../lib_paysages/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);
|
|
|
|
|
|
|
|
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
|