open_iA 2024.9
Loading...
Searching...
No Matches
MainWindow Class Reference

Application main window; implementation of iAMainWindow interface. More...

#include <mainwindow.h>

Inheritance diagram for MainWindow:
[legend]
Collaboration diagram for MainWindow:
[legend]

Public Slots

void loadLayout ()
 
void slicerSettings ()
 

Signals

void closing ()
 
void fullScreenToggled ()
 
- Signals inherited from iAMainWindow
void childChanged ()
 Triggered whenever the active child window has changed.
 
void childCreated (iAMdiChild *)
 Triggered whenever a new iAMdiChild instance is created.
 
void styleChanged ()
 Triggered whenever the user has changed the style of the program (bright/dark/...) via the preferences.
 

Public Member Functions

 MainWindow (QString const &appName, QString const &version, QString const &buildInformation, QString const &splashImage, QSplashScreen &splashScreen)
 
 ~MainWindow () override
 
template<typename T >
T * activeChild ()
 Get the active child window of type T.
 
QMdiSubWindow * activeChild () override
 Return the QMdiSubWindow for the current child.
 
iAMdiChildactiveMdiChild () override
 Provides access to the currently active mdi child, if such is available.
 
void addActionIcon (QAction *action, QString const &iconName) override
 add an icon to an action (and keep the action for that icon up-to-date if the style changes
 
void addRecentFile (const QString &fileName)
 add a file to the list of recently loaded/saved files
 
QMdiSubWindow * addSubWindow (QWidget *child) override
 add a new widget as sub window in the mdi area, and return the respective mdi subwindow.
 
bool brightMode () const
 whether the current qss theme is bright mode (true) or dark mode (false)
 
template<typename T >
QList< T * > childList (QMdiArea::WindowOrder order=QMdiArea::CreationOrder)
 Get the list of current child windows of type T.
 
void closeAllSubWindows () override
 Close all child windows (with a question whether sure if a child has modified data)
 
void closeMdiChild (iAMdiChild *child) override
 Close a child window.
 
iAMdiChildcreateMdiChild (bool unsavedChanges) override
 Create a new child window.
 
iAPreferences const & defaultPreferences () const override
 retrieve the default preferences.
 
QMenu * editMenu () override
 Get the File menu (can be used by modules to append entries to it).
 
QMenu * fileMenu () override
 Get the File menu (can be used by modules to append entries to it).
 
QMenu * filtersMenu () override
 Get the Filters menu (can be used by modules to append entries to it).
 
QMenu * helpMenu () override
 Get the Help menu (can be used by modules to append entries to it).
 
void loadFile (QString const &fileName, std::shared_ptr< iAChildSource > childSrc, std::shared_ptr< iAFileIO > io=nullptr) override
 see iAMainWindow::loadFile
 
void loadFiles (QStringList fileNames, std::shared_ptr< iAChildSource > childSrc)
 Opens multiple files in an existing or new window.
 
void makeActionChildDependent (QAction *action) override
 retrieve default renderer settings.
 
QList< iAMdiChild * > mdiChildList () override
 Get the list of current MdiChild windows.
 
QList< QString > mdiWindowTitles ()
 Get list of the titles of currently open MdiChild windows.
 
iAModuleDispatchermoduleDispatcher () const override
 retrieve the module dispatcher
 
QString const & path () const override
 Retrieve current directory path (the "working folder")
 
void setPath (QString const &p) override
 Set current directory path (the "working folder")
 
QMenu * toolsMenu () override
 Get the Tools menu (can be used by modules to append entries to it).
 
void updateInteractionModeControls (int mode)
 
void updateMagicLens2DCheckState (bool enabled)
 
- Public Member Functions inherited from iAMainWindow

Static Public Member Functions

static int runGUI (int argc, char *argv[], QString const &appName, QString const &version, QString const &buildInformation, QString const &splashPath, QString const &iconPath)
 
- Static Public Member Functions inherited from iAMainWindow
static iAMainWindowget ()
 Access to the main window (more or less singleton);.
 

Additional Inherited Members

- Static Protected Attributes inherited from iAMainWindow
static iAMainWindowm_mainWnd = nullptr
 the one main window
 

Detailed Description

Application main window; implementation of iAMainWindow interface.

Constructor & Destructor Documentation

◆ MainWindow()

MainWindow::MainWindow ( QString const & appName,
QString const & version,
QString const & buildInformation,
QString const & splashImage,
QSplashScreen & splashScreen )

◆ ~MainWindow()

MainWindow::~MainWindow ( )
override

Member Function Documentation

◆ activeChild() [1/2]

template<typename T >
T * MainWindow::activeChild ( )
virtual

Get the active child window of type T.

Implements iAMainWindow.

◆ activeChild() [2/2]

QMdiSubWindow * MainWindow::activeChild ( )
overridevirtual

Return the QMdiSubWindow for the current child.

Implements iAMainWindow.

◆ activeMdiChild()

iAMdiChild * MainWindow::activeMdiChild ( )
overridevirtual

Provides access to the currently active mdi child, if such is available.

Returns
pointer to the currently active mdi child, or nullptr if no child is currently open

Implements iAMainWindow.

◆ addActionIcon()

void MainWindow::addActionIcon ( QAction * action,
QString const & iconName )
overridevirtual

add an icon to an action (and keep the action for that icon up-to-date if the style changes

Implements iAMainWindow.

◆ addRecentFile()

void MainWindow::addRecentFile ( const QString & fileName)

add a file to the list of recently loaded/saved files

◆ addSubWindow()

QMdiSubWindow * MainWindow::addSubWindow ( QWidget * child)
overridevirtual

add a new widget as sub window in the mdi area, and return the respective mdi subwindow.

Implements iAMainWindow.

◆ brightMode()

bool MainWindow::brightMode ( ) const

whether the current qss theme is bright mode (true) or dark mode (false)

◆ childList()

template<typename T >
QList< T * > MainWindow::childList ( QMdiArea::WindowOrder order = QMdiArea::CreationOrder)

Get the list of current child windows of type T.

◆ closeAllSubWindows()

void MainWindow::closeAllSubWindows ( )
overridevirtual

Close all child windows (with a question whether sure if a child has modified data)

Implements iAMainWindow.

◆ closeMdiChild()

void MainWindow::closeMdiChild ( iAMdiChild * child)
overridevirtual

Close a child window.

Implements iAMainWindow.

◆ closing

void MainWindow::closing ( )
signal

◆ createMdiChild()

iAMdiChild * MainWindow::createMdiChild ( bool unsavedChanges)
overridevirtual

Create a new child window.

Implements iAMainWindow.

◆ defaultPreferences()

iAPreferences const & MainWindow::defaultPreferences ( ) const
overridevirtual

retrieve the default preferences.

Implements iAMainWindow.

◆ editMenu()

QMenu * MainWindow::editMenu ( )
overridevirtual

Get the File menu (can be used by modules to append entries to it).

Implements iAMainWindow.

◆ fileMenu()

QMenu * MainWindow::fileMenu ( )
overridevirtual

Get the File menu (can be used by modules to append entries to it).

Implements iAMainWindow.

◆ filtersMenu()

QMenu * MainWindow::filtersMenu ( )
overridevirtual

Get the Filters menu (can be used by modules to append entries to it).

Implements iAMainWindow.

◆ fullScreenToggled

void MainWindow::fullScreenToggled ( )
signal

◆ helpMenu()

QMenu * MainWindow::helpMenu ( )
overridevirtual

Get the Help menu (can be used by modules to append entries to it).

Implements iAMainWindow.

◆ loadFile()

void MainWindow::loadFile ( QString const & fileName,
std::shared_ptr< iAChildSource > childSrc,
std::shared_ptr< iAFileIO > io = nullptr )
overridevirtual

see iAMainWindow::loadFile

Parameters
iodetermine a specific IO to use for loading the file

Implements iAMainWindow.

◆ loadFiles()

void MainWindow::loadFiles ( QStringList fileNames,
std::shared_ptr< iAChildSource > childSrc )

Opens multiple files in an existing or new window.

Parameters
fileNamesthe list of the file names of the files to load
childSrca source for a child window to load the files into. If nullptr, a new window is created for each file

◆ loadLayout

void MainWindow::loadLayout ( )
slot

◆ makeActionChildDependent()

void MainWindow::makeActionChildDependent ( QAction * action)
overridevirtual

retrieve default renderer settings.

mark a QAction (typically added to filters or tools menu by a module) as depending on an MDI child window being open and active

Implements iAMainWindow.

◆ mdiChildList()

QList< iAMdiChild * > MainWindow::mdiChildList ( )
overridevirtual

Get the list of current MdiChild windows.

Implements iAMainWindow.

◆ mdiWindowTitles()

QList< QString > MainWindow::mdiWindowTitles ( )

Get list of the titles of currently open MdiChild windows.

◆ moduleDispatcher()

iAModuleDispatcher & MainWindow::moduleDispatcher ( ) const
overridevirtual

retrieve the module dispatcher

Implements iAMainWindow.

◆ path()

QString const & MainWindow::path ( ) const
overridevirtual

Retrieve current directory path (the "working folder")

Implements iAMainWindow.

◆ runGUI()

int MainWindow::runGUI ( int argc,
char * argv[],
QString const & appName,
QString const & version,
QString const & buildInformation,
QString const & splashPath,
QString const & iconPath )
static

◆ setPath()

void MainWindow::setPath ( QString const & p)
overridevirtual

Set current directory path (the "working folder")

Implements iAMainWindow.

◆ slicerSettings

void MainWindow::slicerSettings ( )
slot

◆ toolsMenu()

QMenu * MainWindow::toolsMenu ( )
overridevirtual

Get the Tools menu (can be used by modules to append entries to it).

Implements iAMainWindow.

◆ updateInteractionModeControls()

void MainWindow::updateInteractionModeControls ( int mode)

◆ updateMagicLens2DCheckState()

void MainWindow::updateMagicLens2DCheckState ( bool enabled)

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