YODAU 1.0
YEAR OF THE DEPEND ADULT UNDERGARMENT
Loading...
Searching...
No Matches
main_window Class Referencefinal

Application main window with board and settings panel. More...

#include <frontend/include/main_window.hpp>

Inheritance diagram for main_window:
Collaboration diagram for main_window:

Public Member Functions

 main_window (QWidget *parent=nullptr)
 Construct the main window and create all core UI components.

Private Attributes

boardmain_zone
 Central board widget showing streams (owned).
settings_panelsettings
 Settings side panel (owned).
QDockWidget * settings_dock
 Dock widget hosting settings on desktop platforms.

Detailed Description

Application main window with board and settings panel.

The window is responsible for assembling the frontend object graph:

Lifetime rules:

  • UI widgets are children of the window and are deleted with it.
  • The backend stream manager is allocated on heap and explicitly deleted when the window is destroyed.
  • The controller is a QObject child and follows Qt parent ownership.
Note
The class is final and not intended for subclassing.

Definition at line 48 of file main_window.hpp.

Constructor & Destructor Documentation

◆ main_window()

main_window::main_window ( QWidget * parent = nullptr)
explicit

Construct the main window and create all core UI components.

Desktop:

  • board is set as central widget;
  • settings panel is placed into a right-side dock with a toolbar toggle.

Android:

  • board and settings are packed into a QStackedWidget;
  • the stack becomes the central widget.

In all cases:

Parameters
parentOptional parent widget.

Definition at line 18 of file main_window.cpp.

19 : BaseMainWindow(parent)
20 , main_zone(new board(this))
21 , settings(new settings_panel(this))
22#if defined(KC_ANDROID) || defined(Q_OS_ANDROID)
23 , zones_stack(new QStackedWidget(this))
24#else
25 , settings_dock(new QDockWidget(str_label("settings"), this))
26#endif
27{
28#if defined(KC_ANDROID) || defined(Q_OS_ANDROID)
29 zones_stack->addWidget(main_zone);
30 zones_stack->addWidget(settings);
31 zones_stack->setCurrentWidget(main_zone);
32 setCentralWidget(zones_stack);
33#else
34 setCentralWidget(main_zone);
35
36 settings_dock->setWidget(settings);
37 settings_dock->setAllowedAreas(
38 Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea
39 );
40 settings_dock->setFeatures(
41 QDockWidget::DockWidgetClosable | QDockWidget::DockWidgetMovable
42 );
43 addDockWidget(Qt::RightDockWidgetArea, settings_dock);
44 const auto settings_action = settings_dock->toggleViewAction();
45 settings_action->setText(str_label("settings"));
46
47 const auto top_toolbar = addToolBar(str_label("top"));
48 top_toolbar->addAction(settings_action);
49#endif
50 auto* mgr = new yodau::backend::stream_manager();
51 connect(this, &QObject::destroyed, this, [mgr]() { delete mgr; });
52
53 auto* ctrl = new controller(mgr, settings, main_zone, this);
54
55 connect(
58 );
59 connect(
62 );
63 connect(
66 );
67 connect(
70 );
71 connect(
74 );
75 ctrl->handle_detect_local_sources();
76}
void handle_add_url(const QString &url, const QString &name)
Handler for adding a network URL stream from UI.
void handle_show_stream_changed(const QString &name, bool show)
Handler for stream visibility toggles in UI.
void handle_detect_local_sources()
Handler for detecting available local sources.
void handle_add_local(const QString &source, const QString &name)
Handler for adding a local capture device from UI.
void handle_add_file(const QString &path, const QString &name, bool loop)
Handler for adding a file stream from UI.
QDockWidget * settings_dock
Dock widget hosting settings on desktop platforms.
board * main_zone
Central board widget showing streams (owned).
settings_panel * settings
Settings side panel (owned).
void show_stream_changed(const QString &name, bool show)
Emitted when a stream's "show in grid" state changes.
void add_file_stream(const QString &path, const QString &name, bool loop)
User requested adding a file stream.
void add_local_stream(const QString &source, const QString &name)
User requested adding a local capture stream.
void detect_local_sources_requested()
User requested re-detection of local sources.
void add_url_stream(const QString &url, const QString &name)
User requested adding a URL stream.
QMainWindow BaseMainWindow
#define str_label(text)
Create a user-visible localized label.
Definition str_label.hpp:29

References settings_panel::detect_local_sources_requested(), controller::handle_detect_local_sources(), main_zone, controller::per_stream_lines, settings, settings_dock, and settings_panel::settings_panel().

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ main_zone

board* main_window::main_zone
private

Central board widget showing streams (owned).

Definition at line 73 of file main_window.hpp.

Referenced by main_window().

◆ settings

settings_panel* main_window::settings
private

Settings side panel (owned).

Definition at line 76 of file main_window.hpp.

Referenced by main_window().

◆ settings_dock

QDockWidget* main_window::settings_dock
private

Dock widget hosting settings on desktop platforms.

Definition at line 89 of file main_window.hpp.

Referenced by main_window().


The documentation for this class was generated from the following files: