Michaël Lemaire
b46060f3c4
git-svn-id: https://subversion.assembla.com/svn/thunderk/paysages@500 b1fd45b6-86a6-48da-8261-f70d1f35bdcc
36 lines
658 B
C++
36 lines
658 B
C++
#ifndef _PAYSAGES_QT_TOOLS_H_
|
|
#define _PAYSAGES_QT_TOOLS_H_
|
|
|
|
#include <QColor>
|
|
#include <QDialog>
|
|
|
|
#include "../lib_paysages/shared/types.h"
|
|
#include "../lib_paysages/tools/color.h"
|
|
|
|
static inline QColor colorToQColor(Color color)
|
|
{
|
|
colorNormalize(&color);
|
|
return QColor(color.r * 255.0, color.g * 255.0, color.b * 255.0, color.a * 255.0);
|
|
}
|
|
|
|
class DialogWithPreview:public QDialog
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
DialogWithPreview(QWidget* parent);
|
|
|
|
protected:
|
|
virtual bool event(QEvent* event);
|
|
};
|
|
|
|
#ifndef NDEBUG
|
|
#include <QDebug>
|
|
static inline void logDebug(QString string)
|
|
{
|
|
qDebug() << string;
|
|
}
|
|
#else
|
|
#define logDebug(_x_) ;
|
|
#endif
|
|
|
|
#endif
|