NDEVR
API Documentation
PopupInfo.h
1#pragma once
2#include "DLLInfo.h"
3#include <QRect>
4#include <functional>
5#include <qnamespace.h>
6#include <QPointer>
7class QWidget;
8namespace NDEVR
9{
15 struct PopupInfo
16 {
21 {}
22
26 PopupInfo(const QRect& rect)
27 : rect(rect)
28 {}
29
33 NDEVR_WIDGETS_API PopupInfo(QWidget* widget);
34 QRect rect;
35 std::function<void()> finished_callback;
36 std::function<void(PopupInfo)> settings_callback;
37 QPointer<QWidget> widget;
38 QPointer<QWidget> parent_widget;
39 Qt::WindowModality modality = Qt::WindowModality::NonModal;
40 bool fullscreen = false;
41 bool request_margins = false;
42 bool closable = false;
43 bool hideable = false;
44 bool allow_title_autohide = false;
45 bool windowable = false;
46 bool request_dock = false;
47 bool is_popup_menu = false;
49 bool delete_on_hide = false;
50 int animation_speed = -1;
51
52 };
53}
The primary namespace for the NDEVR SDK.
PopupInfo(const QRect &rect)
Constructs a PopupInfo with a specified animation origin rectangle.
Definition PopupInfo.h:26
QPointer< QWidget > parent_widget
The parent widget for the popup.
Definition PopupInfo.h:38
std::function< void()> finished_callback
Optional callback invoked when the popup is closed.
Definition PopupInfo.h:35
bool allow_title_autohide
Whether the title bar can auto-hide when not hovered.
Definition PopupInfo.h:44
bool is_popup_menu
Whether this popup behaves as a popup menu (auto-closes on focus loss).
Definition PopupInfo.h:47
bool closable
Whether the popup can be closed by the user.
Definition PopupInfo.h:42
QPointer< QWidget > widget
The widget to display inside the popup.
Definition PopupInfo.h:37
bool make_call_widget_dialog
Whether to wrap the widget in a call-widget-style dialog.
Definition PopupInfo.h:48
bool windowable
Whether the popup can be detached into a standalone window.
Definition PopupInfo.h:45
int animation_speed
The animation speed in milliseconds, or -1 for the default.
Definition PopupInfo.h:50
QRect rect
The screen rectangle used as the animation origin for the popup.
Definition PopupInfo.h:34
PopupInfo(QWidget *widget)
Constructs a PopupInfo using a widget as the animation origin.
bool fullscreen
Whether the popup should be displayed fullscreen.
Definition PopupInfo.h:40
PopupInfo()
Default constructor with all flags set to their defaults.
Definition PopupInfo.h:20
bool hideable
Whether the popup can be hidden (minimized) by the user.
Definition PopupInfo.h:43
std::function< void(PopupInfo)> settings_callback
If set, requests a settings button on the dialog.
Definition PopupInfo.h:36
bool request_dock
Whether the popup requests to be docked in the main window.
Definition PopupInfo.h:46
bool request_margins
Whether to add margins around the popup content.
Definition PopupInfo.h:41
Qt::WindowModality modality
The window modality for the popup dialog.
Definition PopupInfo.h:39
bool delete_on_hide
Whether to delete the popup widget when it is hidden.
Definition PopupInfo.h:49