ORE Studio 0.0.4
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
MainWindow Class Reference

Main application window providing the MDI interface and entity management. More...

#include <MainWindow.hpp>

Inherits QMainWindow.

Collaboration diagram for MainWindow:
Collaboration graph

Public Member Functions

 MainWindow (QWidget *parent=nullptr)
 Constructs the main window.
 
 ~MainWindow () override
 Destroys the main window.
 
ClientManagergetClientManager () const
 Get the client manager.
 
void setInstanceInfo (const QString &name, const QColor &color=QColor())
 Set instance identification info for multi-instance testing.
 
void updateWindowTitle ()
 Update the window title to reflect current state.
 

Protected Member Functions

void closeEvent (QCloseEvent *event) override
 Handles the close event for the main window.
 

Detailed Description

Main application window providing the MDI interface and entity management.

The MainWindow serves as the primary application window, providing:

The window uses an entity controller pattern where each data type (currency, account, trade, etc.) has its own controller that manages windows and operations specific to that entity. This keeps the MainWindow clean and makes it easy to add new entities.

Note
MainWindow creates entity controllers after successful login and destroys them on disconnect to ensure they always have a valid client connection.

Constructor & Destructor Documentation

◆ MainWindow()

MainWindow ( QWidget *  parent = nullptr)
explicit

Constructs the main window.

Parameters
parentParent widget (typically nullptr for main window)

Initializes the UI, sets up the MDI area, configures icons, and connects menu/toolbar actions. Entity controllers are created after successful login.

Member Function Documentation

◆ setInstanceInfo()

void setInstanceInfo ( const QString &  name,
const QColor &  color = QColor() 
)

Set instance identification info for multi-instance testing.

Parameters
nameInstance name (e.g., "Instance 1", "Primary")
colorOptional color for the instance banner

◆ updateWindowTitle()

void updateWindowTitle ( )

Update the window title to reflect current state.

Title format: "ORE Studio v{version} - {username}@{server} [Instance Name]" When not connected: "ORE Studio v{version} [Instance Name]"

◆ closeEvent()

void closeEvent ( QCloseEvent *  event)
overrideprotected

Handles the close event for the main window.

Ensures all detachable windows (MDI and detached) are closed before the main window closes, so the application can terminate cleanly.