Seamly2D
Code documentation
MApplication Class Reference

#include <mapplication.h>

Inheritance diagram for MApplication:
Collaboration diagram for MApplication:

Public Slots

void ProcessCMD ()
 

Public Member Functions

 MApplication (int &argc, char **argv)
 
virtual ~MApplication () Q_DECL_OVERRIDE
 
virtual bool notify (QObject *receiver, QEvent *event) Q_DECL_OVERRIDE
 notify Reimplemented from QApplication::notify(). More...
 
bool IsTestMode () const
 
virtual bool IsAppInGUIMode () const Q_DECL_OVERRIDE
 IsAppInGUIMode little hack that allow to have access to application state from VAbstractApplication class. More...
 
TMainWindow * MainWindow ()
 
QList< TMainWindow * > MainWindows ()
 
TMainWindow * NewMainWindow ()
 
void InitOptions ()
 
virtual const VTranslateVars * TrVars () Q_DECL_OVERRIDE
 
virtual void OpenSettings () Q_DECL_OVERRIDE
 
VSeamlyMeSettings * SeamlyMeSettings ()
 
void ShowDataBase ()
 
void retranslateGroups ()
 
void RetranslateTables ()
 
void ParseCommandLine (const SocketConnection &connection, const QStringList &arguments)
 
- Public Member Functions inherited from VAbstractApplication
 VAbstractApplication (int &argc, char **argv)
 
virtual ~VAbstractApplication () Q_DECL_OVERRIDE
 
QString translationsPath (const QString &locale=QString()) const
 translationsPath return path to the root directory that contains QM files. More...
 
void loadTranslations (const QString &locale)
 
Unit patternUnit () const
 
const Unit * patternUnitP () const
 
void setPatternUnit (const Unit &patternUnit)
 
MeasurementsType patternType () const
 
void setPatternType (const MeasurementsType &patternType)
 
VCommonSettings * Settings ()
 getSettings hide settings constructor. More...
 
template<typename T >
QString LocaleToString (const T &value)
 
QGraphicsScene * getCurrentScene () const
 
void setCurrentScene (QGraphicsScene **value)
 
VMainGraphicsView * getSceneView () const
 
void setSceneView (VMainGraphicsView *value)
 
double toPixel (double val) const
 
double fromPixel (double pix) const
 
void setCurrentDocument (VAbstractPattern *doc)
 
VAbstractPattern * getCurrentDocument () const
 
void setCurrentData (VContainer *data)
 
VContainer * getCurrentData () const
 
bool getOpeningPattern () const
 
void setOpeningPattern ()
 
QWidget * getMainWindow () const
 
void setMainWindow (QWidget *value)
 
QUndoStack * getUndoStack () const
 
QString getFilePath () const
 
void setFilePath (const QString &value)
 

Protected Member Functions

virtual void InitTrVars () Q_DECL_OVERRIDE
 
virtual bool event (QEvent *e) Q_DECL_OVERRIDE
 

Private Slots

void NewLocalSocketConnection ()
 

Private Member Functions

void Clean ()
 

Private Attributes

QList< QPointer< TMainWindow > > mainWindows
 
QLocalServer * localServer
 
VTranslateVars * trVars
 
QPointer< MeasurementDatabaseDialog > dataBase
 
bool testMode
 

Additional Inherited Members

- Protected Attributes inherited from VAbstractApplication
QUndoStack * undoStack
 
QWidget * mainWindow
 mainWindow pointer to main window. Usefull if need create modal dialog. Without pointer to main window modality doesn't work. More...
 
VCommonSettings * settings
 settings pointer to settings. Help hide constructor creation settings. Make make code more readable. More...
 
QPointer< QTranslator > qtTranslator
 
QPointer< QTranslator > qtxmlTranslator
 
QPointer< QTranslator > qtBaseTranslator
 
QPointer< QTranslator > appTranslator
 
QPointer< QTranslator > pmsTranslator
 

Detailed Description

Definition at line 72 of file mapplication.h.

Constructor & Destructor Documentation

◆ MApplication()

MApplication::MApplication ( int &  argc,
char **  argv 
)

◆ ~MApplication()

MApplication::~MApplication ( )
virtual

Definition at line 270 of file mapplication.cpp.

References dataBase, mainWindows, and trVars.

Member Function Documentation

◆ Clean()

void MApplication::Clean ( )
private

Definition at line 768 of file mapplication.cpp.

References mainWindows.

Referenced by event(), MainWindow(), and MainWindows().

◆ event()

bool MApplication::event ( QEvent *  e)
protectedvirtual

Definition at line 447 of file mapplication.cpp.

References Clean(), TMainWindow::LoadFile(), and MainWindow().

Referenced by notify().

◆ InitOptions()

◆ InitTrVars()

void MApplication::InitTrVars ( )
protectedvirtual

Implements VAbstractApplication.

Definition at line 434 of file mapplication.cpp.

References VTranslateVars::Retranslate(), and trVars.

◆ IsAppInGUIMode()

bool MApplication::IsAppInGUIMode ( ) const
virtual

IsAppInGUIMode little hack that allow to have access to application state from VAbstractApplication class.

Implements VAbstractApplication.

Definition at line 367 of file mapplication.cpp.

References IsTestMode().

◆ IsTestMode()

bool MApplication::IsTestMode ( ) const

Definition at line 358 of file mapplication.cpp.

References testMode.

Referenced by IsAppInGUIMode().

◆ MainWindow()

TMainWindow * MApplication::MainWindow ( )

Definition at line 373 of file mapplication.cpp.

References Clean(), mainWindows, and NewMainWindow().

Referenced by event(), NewLocalSocketConnection(), and ParseCommandLine().

◆ MainWindows()

QList< TMainWindow * > MApplication::MainWindows ( )

Definition at line 384 of file mapplication.cpp.

References Clean(), and mainWindows.

Referenced by RetranslateTables().

◆ NewLocalSocketConnection

void MApplication::NewLocalSocketConnection ( )
privateslot

Definition at line 748 of file mapplication.cpp.

References localServer, MainWindow(), ParseCommandLine(), and Server.

Referenced by ParseCommandLine().

◆ NewMainWindow()

TMainWindow * MApplication::NewMainWindow ( )

Definition at line 730 of file mapplication.cpp.

References mainWindows, and qApp.

Referenced by MainWindow(), and ParseCommandLine().

◆ notify()

bool MApplication::notify ( QObject *  receiver,
QEvent *  event 
)
virtual

notify Reimplemented from QApplication::notify().

Parameters
receiverreceiver.
eventevent.
Returns
value that is returned from the receiver's event handler.

Definition at line 293 of file mapplication.cpp.

References VExceptionObjectError::DetailedInformation(), VExceptionObjectError::ErrorMessage(), event(), V_EX_DATAERR, V_EX_SOFTWARE, and VException::what().

◆ OpenSettings()

void MApplication::OpenSettings ( )
virtual

Implements VAbstractApplication.

Definition at line 487 of file mapplication.cpp.

References VAbstractApplication::settings.

Referenced by InitOptions().

◆ ParseCommandLine()

◆ ProcessCMD

void MApplication::ProcessCMD ( )
slot

Definition at line 742 of file mapplication.cpp.

References Client, and ParseCommandLine().

◆ retranslateGroups()

void MApplication::retranslateGroups ( )

Definition at line 517 of file mapplication.cpp.

References dataBase.

◆ RetranslateTables()

void MApplication::RetranslateTables ( )

Definition at line 526 of file mapplication.cpp.

References MainWindows().

◆ SeamlyMeSettings()

VSeamlyMeSettings * MApplication::SeamlyMeSettings ( )

Definition at line 494 of file mapplication.cpp.

References SCASSERT, and VAbstractApplication::settings.

Referenced by InitOptions(), and ParseCommandLine().

◆ ShowDataBase()

void MApplication::ShowDataBase ( )

Definition at line 501 of file mapplication.cpp.

References dataBase.

◆ TrVars()

const VTranslateVars * MApplication::TrVars ( )
virtual

Implements VAbstractApplication.

Definition at line 428 of file mapplication.cpp.

References trVars.

Member Data Documentation

◆ dataBase

QPointer<MeasurementDatabaseDialog> MApplication::dataBase
private

Definition at line 116 of file mapplication.h.

Referenced by retranslateGroups(), ShowDataBase(), and ~MApplication().

◆ localServer

QLocalServer* MApplication::localServer
private

Definition at line 114 of file mapplication.h.

Referenced by NewLocalSocketConnection(), and ParseCommandLine().

◆ mainWindows

QList<QPointer<TMainWindow> > MApplication::mainWindows
private

Definition at line 113 of file mapplication.h.

Referenced by Clean(), MainWindow(), MainWindows(), NewMainWindow(), and ~MApplication().

◆ testMode

bool MApplication::testMode
private

Definition at line 117 of file mapplication.h.

Referenced by IsTestMode(), and ParseCommandLine().

◆ trVars

VTranslateVars* MApplication::trVars
private

Definition at line 115 of file mapplication.h.

Referenced by InitTrVars(), TrVars(), and ~MApplication().


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