widgets/coloredit.h

Wed, 19 Apr 2023 22:51:56 +0300

author
Teemu Piippo <teemu.s.piippo@gmail.com>
date
Wed, 19 Apr 2023 22:51:56 +0300
changeset 381
80bea7a6e84f
parent 348
98776f54a8d0
permissions
-rw-r--r--

Made library_role_e an enum class

#pragma once
#include <QPushButton>
#include <QLineEdit>

/**
 * @brief A button that can be used to select a color
 */
class ColorEdit : public QWidget
{
	Q_OBJECT
	Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
	QLineEdit* lineEdit;
	QPushButton* button;
public:
	ColorEdit(const QColor& color = {}, QWidget* parent = nullptr);
	ColorEdit(QWidget* parent = nullptr);
	QColor color() const;
	Q_SLOT void setColor(const QColor& color);
	Q_SIGNAL void colorChanged(const QColor& color);
};

mercurial