NDEVR
API Documentation
GenericOptionsWidgets.h
1#pragma once
2#include "DLLInfo.h"
3#include <NDEVR/GenericOption.h>
4#include <QWidget>
5class QGridLayout;
6namespace NDEVR
7{
9 class Button;
13 class NDEVR_WIDGETS_API GenericOptionsWidget : public QWidget
14 {
15 Q_OBJECT
16 public:
22 GenericOptionsWidget(const GenericOption& option, QWidget* parent = nullptr);
27 GenericOptionsWidget(QWidget* parent = nullptr);
38 const GenericOption& option() const
39 {
40 return m_option;
41 }
42
47 {
48 return m_option;
49 }
50
55 signals:
56 void edited();
58 protected:
67 {
68 }
69
74 void init();
75 protected:
77 QWidget* m_widget = nullptr;
81 };
82
86 class NDEVR_WIDGETS_API GenericOptionsGroup : public QWidget
87 {
88 Q_OBJECT
89 public:
96 GenericOptionsGroup(const GenericOptionGroup& option, bool vertical_layout = false, QWidget* parent = nullptr);
101 GenericOptionsGroup(QWidget* parent = nullptr);
116 void setVerticalLayout(bool vertical_layout);
117 signals:
118 void edited();
120 protected:
122 void init();
123 protected:
124 QGridLayout* m_layout;
126 bool m_vertical_layout = false;
127 };
128}
A core widget that allows the user to click one of many button types.
Definition Button.h:68
A dialog designed to allow the user to navigate a filesytem and select or create one or more files or...
Stores a groups of GenericOptions that can be used to group them.
GenericOptionsGroup(QWidget *parent=nullptr)
Constructs an empty GenericOptionsGroup.
GenericOptionsGroup(const GenericOptionGroup &option, bool vertical_layout=false, QWidget *parent=nullptr)
Constructs a GenericOptionsGroup from a GenericOptionGroup.
const GenericOptionGroup & group()
Returns the current GenericOptionGroup.
void edited()
Emitted when any option in the group has been edited.
QGridLayout * m_layout
The grid layout containing option widgets.
void setOptionGroup(const GenericOptionGroup &option)
Sets the option group and rebuilds the widget.
GenericOptionGroup m_group
The option group being displayed.
bool m_vertical_layout
Whether options are laid out vertically.
void init()
Initializes the grid layout and creates child widgets for each option.
void editingFinished()
Emitted when the user finishes editing any option.
void setVerticalLayout(bool vertical_layout)
Sets whether options should be laid out vertically.
void editingFinished()
Emitted when the user finishes editing.
GenericOption m_option
The GenericOption this widget represents.
QWidget * m_widget
The main editing widget for the option.
void edited()
Emitted when the option value has been edited.
void refreshVectorWidget()
Refreshes the vector widget for vector-type options (placeholder).
void refreshLineEditWidget()
Refreshes the line edit widget for string or numeric options.
void refreshToggleWidget()
Refreshes the toggle (checkbox) widget for boolean options.
void refreshFileChooser()
Refreshes the file chooser portion of the widget, if applicable.
Button * m_browse_button
Browse button for file-type options.
Button * m_reset_button
Button to reset the option to its default value.
GenericOption & option()
Returns the GenericOption associated with this widget.
GenericOptionsWidget(QWidget *parent=nullptr)
Constructs an empty GenericOptionsWidget.
void refreshColorWidget()
Refreshes the color picker widget for color options.
void init()
Initializes the widget layout and child widgets based on the option type.
void setOption(const GenericOption &option)
Sets the option and rebuilds the widget accordingly.
void refreshMultilineWidget()
Refreshes the multiline text edit widget.
const GenericOption & option() const
Returns the GenericOption associated with this widget (const).
void refreshComboWidget()
Refreshes the combo box widget for enumerated options.
void refreshWidget()
Refreshes the widget to reflect the current option state.
GenericOptionsWidget(const GenericOption &option, QWidget *parent=nullptr)
Constructs a GenericOptionsWidget from a GenericOption.
void refreshResetToDefault()
Refreshes the reset-to-default button state.
FileChooserDialog * m_chooser_dialog
File chooser dialog for file-type options.
The primary namespace for the NDEVR SDK.
Stores a generic option of any type as well as some information about how the user might interact wit...