API Documentation
Loading...
Searching...
No Matches
GenericOptionsWidgets.h
Go to the documentation of this file.
1#pragma once
2#include "DLLInfo.h"
3#include <NDEVR/GenericOption.h>
4#include <QWidget>
5class QGridLayout;
6namespace NDEVR
7{
8 class FileChooserDialog;
9 class Button;
10 /**--------------------------------------------------------------------------------------------------
11 \brief Automatically creates a widget based on a GenericOption.
12 **/
14 {
15 Q_OBJECT
16 public:
17 GenericOptionsWidget(const GenericOption& option, QWidget* parent = nullptr);
18 GenericOptionsWidget(QWidget* parent = nullptr);
22 const GenericOption& option() const
23 {
24 return m_option;
25 }
27 {
28 return m_option;
29 }
30 void setOption(const GenericOption& option);
31 signals:
32 void edited();
34 protected:
39 {
40 }
42 void init();
43 protected:
44 FileChooserDialog* m_chooser_dialog = nullptr;
45 QWidget* m_widget = nullptr;
46 Button* m_browse_button = nullptr;
47 Button* m_reset_button = nullptr;
49 };
50 /**--------------------------------------------------------------------------------------------------
51 \brief Creates a clean formatted dialog for any number of GenericOptions within a GenericOptionGroup
52 Each option is labelled.
53 **/
55 {
56 Q_OBJECT
57 public:
58 GenericOptionsGroup(const GenericOptionGroup& option, QWidget* parent = nullptr);
59 GenericOptionsGroup(QWidget* parent = nullptr);
62 signals:
63 void edited();
65 protected:
66 void init();
67 protected:
68 QGridLayout* m_layout;
70 };
71}
#define NDEVR_WIDGETS_API
Definition DLLInfo.h:59
A core widget that allows the user to click one of many button types.
Definition Button.h:66
A dialog designed to allow the user to navigate a filesytem and select or create one or more files or...
Definition FileChooserDialog.h:79
Stores a groups of GenericOptions that can be used to group them.
Definition GenericOptions.h:151
Creates a clean formatted dialog for any number of GenericOptions within a GenericOptionGroup Each op...
Definition GenericOptionsWidgets.h:55
GenericOptionsGroup(QWidget *parent=nullptr)
QGridLayout * m_layout
Definition GenericOptionsWidgets.h:68
GenericOptionsGroup(const GenericOptionGroup &option, QWidget *parent=nullptr)
const GenericOptionGroup & group()
GenericOptionGroup m_group
Definition GenericOptionsWidgets.h:69
void setOptionGroup(const GenericOptionGroup &option)
Automatically creates a widget based on a GenericOption.
Definition GenericOptionsWidgets.h:14
void refreshVectorWidget()
Definition GenericOptionsWidgets.h:38
GenericOption & option()
Definition GenericOptionsWidgets.h:26
GenericOption m_option
Definition GenericOptionsWidgets.h:48
GenericOptionsWidget(const GenericOption &option, QWidget *parent=nullptr)
const GenericOption & option() const
Definition GenericOptionsWidgets.h:22
GenericOptionsWidget(QWidget *parent=nullptr)
void setOption(const GenericOption &option)
Definition ACIColor.h:37
Stores a generic option of any type as well as some information about how the user might interact wit...
Definition GenericOptions.h:57