NDEVR
API Documentation
QCustomColorDialog.h
1#pragma once
2#include "DLLInfo.h"
3#include <NDEVR/Buffer.h>
4#include <NDEVR/RGBColor.h>
5#include <QWidget>
6class QDialogButtonBox;
7namespace NDEVR
8{
9 class QColorPickingEventFilter;
10 class QCustomColorDialogPrivate;
11 class QCustomLabel;
16 class NDEVR_WIDGETS_API QCustomColorDialog : public QWidget
17 {
18 Q_OBJECT
19 public:
24 explicit QCustomColorDialog(QWidget* parent = nullptr);
30 explicit QCustomColorDialog(const RGBColor& initial, QWidget* parent = nullptr);
37 explicit QCustomColorDialog(bool is_small, bool show_line_edit_pickers, QWidget* parent = nullptr);
46 void setCurrentColor(const RGBColor& color);
51 void setShowAlpha(bool show_alpha);
66 void setHorizontal(bool horizontal);
67 //using QDialog::open;
73 void open(QObject* receiver, const char* member);
78 void setVisible(bool visible) override;
86 void setMargin(int x, int y, int xx, int yy);
87 //static RGBColor getColor(const RGBColor& initial = Qt::white, QWidget* parent = nullptr, const QString& title = QString(), QColorDialog::ColorDialogOptions options = QColorDialog::ColorDialogOptions());
92 static int customCount();
97 bool showAlpha() const;
103 static RGBColor customColor(int index);
109 static void setCustomColor(int index, RGBColor color);
115 static RGBColor standardColor(int index);
121 static void setStandardColor(int index, RGBColor color);
132 static Buffer<RGBColor> Colors(int count);
133 Q_SIGNALS:
138 void currentColorEdited(const RGBColor& color);
143 void colorSelected(const RGBColor& color);
148 protected:
153 void changeEvent(QEvent* event) override;
154 //void done(int result) override;
155 private:
156 QCustomColorDialogPrivate* d;
157 };
158}
The equivelent of std::vector but with a bit more control.
Definition Buffer.hpp:58
void currentColorEdited(const RGBColor &color)
Emitted when the current color is changed by the user during editing.
void colorSelected(const RGBColor &color)
Emitted when a color is selected (confirmed) by the user.
RGBColor currentColor() const
Returns the color currently being edited in the dialog.
QCustomColorDialog(const RGBColor &initial, QWidget *parent=nullptr)
Constructs a QCustomColorDialog with an initial color and the given parent widget.
QCustomColorDialog(QWidget *parent=nullptr)
Constructs a QCustomColorDialog with the given parent widget.
QCustomColorDialog(bool is_small, bool show_line_edit_pickers, QWidget *parent=nullptr)
Constructs a QCustomColorDialog with size and line edit picker options.
void finishedSignal()
Emitted when the dialog is finished (accepted or rejected).
static void setStandardColor(int index, RGBColor color)
Sets the standard color at the given index.
static Buffer< RGBColor > CustomColors()
Returns a buffer containing all custom colors.
void changeEvent(QEvent *event) override
Handles change events such as language or palette changes.
void setVisible(bool visible) override
Overrides QWidget::setVisible to handle showing and hiding the dialog.
void open(QObject *receiver, const char *member)
Opens the dialog and connects its finished signal to the specified receiver and member slot.
RGBColor selectedColor() const
Returns the color that was last selected (confirmed) by the user.
void setCurrentColor(const RGBColor &color)
Sets the currently displayed color in the dialog.
~QCustomColorDialog()
Destroys the color dialog.
static Buffer< RGBColor > Colors(int count)
Generates a buffer of evenly distributed colors.
static RGBColor customColor(int index)
Returns the custom color at the given index.
bool showAlpha() const
Returns whether the alpha channel controls are currently visible.
void setHorizontal(bool horizontal)
Sets the layout orientation of the dialog.
static RGBColor standardColor(int index)
Returns the standard color at the given index.
static int customCount()
Returns the number of custom colors supported by the dialog.
void setMargin(int x, int y, int xx, int yy)
Sets the content margins of the dialog layout.
void setShowAlpha(bool show_alpha)
Sets whether the alpha channel slider and input are visible.
static void setCustomColor(int index, RGBColor color)
Sets the custom color at the given index.
Displays translated text.
Represents a color in the RGB space with optional alpha transparency.
Definition RGBColor.h:57
The primary namespace for the NDEVR SDK.