API Documentation
Loading...
Searching...
No Matches
KeystrokeWidget.h
Go to the documentation of this file.
1#pragma once
2#include "DLLInfo.h"
3#include <NDEVR/KeyController.h>
4#include <NDEVR/String.h>
5#include <QWidget>
6class QBoxLayout;
7class QGridLayout;
8namespace NDEVR
9{
10 class QCustomLabel;
11 class Button;
12 class Toggle;
13 class QCustomScrollArea;
14 /**--------------------------------------------------------------------------------------------------
15 \brief Allows the user to assign a keystroke to an action by displaying a button with the current
16 keystroke assignment that when clicked, records a new keyboard assignment.
17 **/
19 {
20 public:
21 KeystrokeWidget(QWidget* parent = nullptr);
22 KeystrokeWidget(KeyControllerBase* controller, QWidget* parent = nullptr);
24 void setShowGrabVolumeKeys(bool show);
25 bool event(QEvent* event) override;
27 protected:
28 void setup();
29 void setup(KeyController* key_controller);
30 void setup(BasicKeyController* key_controller);
31 bool processKeyEvent(const KeyEvent& key_event, DesignObjectLookup* lookup, Camera* camera) override;
32 void cleanup();
33 protected:
35 bool m_is_init = false;
36 KeyControllerBase* m_controller = nullptr;
37 QCustomScrollArea* m_scroll_area = nullptr;
38 QBoxLayout* m_scroll_area_layout = nullptr;
39 QGridLayout* m_layout = nullptr;
40 Button* m_current_button = nullptr;
41 bool m_show_grab_volume_keys = false;
42 };
43}
#define NDEVR_WIDGETS_API
Definition DLLInfo.h:59
The core class for assigning actions to key-presses and registering them as a program-wide service.
Definition KeyController.h:71
A core widget that allows the user to click one of many button types.
Definition Button.h:66
A core class where all Design Objects including models, materials, and geometries are stored....
Definition DesignObjectLookup.h:65
Base class for KeyController, a service which provides functionality based on user key-presses.
Definition KeyController.h:51
A high-level controller that stores many sub controllers that can be used to modify behaviors on user...
Definition KeyController.h:93
A class which describes a user key press.
Definition Event.h:49
Allows the user to assign a keystroke to an action by displaying a button with the current keystroke ...
Definition KeystrokeWidget.h:19
KeystrokeWidget(QWidget *parent=nullptr)
void setup(BasicKeyController *key_controller)
bool processKeyEvent(const KeyEvent &key_event, DesignObjectLookup *lookup, Camera *camera) override
bool event(QEvent *event) override
String m_current_id
Definition KeystrokeWidget.h:34
void setShowGrabVolumeKeys(bool show)
KeystrokeWidget(KeyControllerBase *controller, QWidget *parent=nullptr)
void setup(KeyController *key_controller)
void setController(KeyControllerBase *controller)
A scroll area is used to display the contents of a child widget within a frame. If the widget exceeds...
Definition QCustomScrollArea.h:14
The core String class for the NDEVR API.
Definition String.h:69
Definition ACIColor.h:37