NDEVR
API Documentation
MouseEditorWidget.h
1/*--------------------------------------------------------------------------------------------
2Copyright (c) 2019, NDEVR LLC
3tyler.parke@ndevr.org
4 __ __ ____ _____ __ __ _______
5 | \ | | | __ \ | ___|\ \ / / | __ \
6 | \ | | | | \ \ | |___ \ \ / / | |__) |
7 | . \| | | |__/ / | |___ \ V / | _ /
8 | |\ |_|_____/__|_____|___\_/____| | \ \
9 |__| \__________________________________| \__\
10
11Subject to the terms of the Enterprise+ Agreement, NDEVR hereby grants
12Licensee a limited, non-exclusive, non-transferable, royalty-free license
13(without the right to sublicense) to use the API solely for the purpose of
14Licensee's internal development efforts to develop applications for which
15the API was provided.
16
17The above copyright notice and this permission notice shall be included in all
18copies or substantial portions of the Software.
19
20THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
22PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
23FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
24OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25DEALINGS IN THE SOFTWARE.
26
27Library: Widgets
28File: MouseEditorWidget
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include "DLLInfo.h"
34#if NDEVR_VIEWPORT
35#include <NDEVR/MouseController.h>
36#include <NDEVR/Pointer.h>
37#include <QWidget>
38#include <QPixmap>
39namespace Ui
40{
41 class MouseSetupEditor;
42}
43namespace NDEVR
44{
45 class MouseController;
49 class DESIGN_WIDGETS_API MouseEditorWidget : public QWidget
50 {
51 Q_OBJECT
52 public:
57 MouseEditorWidget(QWidget* parent = nullptr);
68 void resizeEvent(QResizeEvent *resize_event) override;
69 signals:
70 void edited();
71 protected slots:
80 protected:
85 void setBackgroundImage(const StringView& image);
86 protected:
87 QPixmap m_background;
90 Ui::MouseSetupEditor* ui;
91 };
92}
93#endif
Provides a modifiable pointer that has shared ownership of a dynamically allocated object.
Definition Pointer.hpp:356
Contains logic for executing actions based on user mouse inputs.
void updateFromDialog()
Updates the mouse controller from the current dialog UI values.
String m_background_resource
The resource identifier of the current background image.
QPixmap m_background
The scaled background pixmap for the mouse diagram.
void edited()
Emitted when the user modifies any mouse binding.
void setMouseController(const DynamicPointer< MouseController > &controller)
Sets the mouse controller whose bindings this widget edits.
void resizeEvent(QResizeEvent *resize_event) override
Handles resize events to update the background image scaling.
void updateFromController()
Updates the dialog UI to reflect the current mouse controller state.
MouseEditorWidget(QWidget *parent=nullptr)
Constructs a MouseEditorWidget with an optional parent.
void setBackgroundImage(const StringView &image)
Sets the background image displayed behind the mouse diagram.
DynamicPointer< MouseController > m_mouse_controller
The mouse controller being edited.
Ui::MouseSetupEditor * ui
The auto-generated UI form for mouse setup editing.
The core String View class for the NDEVR API.
Definition StringView.h:58
The core String class for the NDEVR API.
Definition String.h:95
The primary namespace for the NDEVR SDK.