1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-26 10:19:45 +03:00
occt/samples/qt/Common/src/ApplicationCommon.h
nds 55a40de890 0028934: Coding - Eliminate compiler warnings in OCCT samples
- covering Qt warnings for compilation under MSVC 2013 and greater
- avoid warning about 'M_PI'(and others) redefinition warning of math.h: includes of QtWidgets should follow after other includes.
2018-04-09 10:18:38 +03:00

90 lines
2.9 KiB
C++
Executable File

#ifndef APPLICATIONCOMMON_H
#define APPLICATIONCOMMON_H
#include "DocumentCommon.h"
#include <Standard_WarningsDisable.hxx>
#include <QMainWindow>
#include <QAction>
#include <QToolBar>
#include <QMenu>
#include <QMdiArea>
#include <QList>
#include <Standard_WarningsRestore.hxx>
class COMMONSAMPLE_EXPORT ApplicationCommonWindow: public QMainWindow
{
Q_OBJECT
public:
enum { FileNewId, FilePrefUseVBOId, FileCloseId, FilePreferencesId, FileQuitId, ViewToolId, ViewStatusId, HelpAboutId };
enum { ToolWireframeId, ToolShadingId, ToolColorId, ToolMaterialId, ToolTransparencyId, ToolDeleteId };
ApplicationCommonWindow();
~ApplicationCommonWindow();
static QMdiArea* getWorkspace();
static ApplicationCommonWindow* getApplication();
static QString getResourceDir();
virtual void updateFileActions();
QList<QAction*>* getToolActions();
QList<QAction*>* getMaterialActions();
protected:
virtual DocumentCommon* createNewDocument();
int& getNbDocument();
public slots:
DocumentCommon* onNewDoc();
void onCloseWindow();
void onUseVBO();
virtual void onCloseDocument( DocumentCommon* theDoc );
virtual void onSelectionChanged();
virtual void onAbout();
void onViewToolBar();
void onViewStatusBar();
void onToolAction();
void onCreateNewView();
void onWindowActivated ( QWidget * w );
void windowsMenuAboutToShow();
void windowsMenuActivated( bool checked/*int id*/ );
void onSetMaterial( int theMaterial );
protected:
virtual void resizeEvent( QResizeEvent* );
bool isDocument();
QMenu* getFilePopup();
QAction* getFileSeparator();
QToolBar* getCasCadeBar();
private:
void createStandardOperations();
void createCasCadeOperations();
void createWindowPopup();
private:
int myNbDocuments;
bool myIsDocuments;
QList<QAction*> myStdActions;
QList<QAction*> myToolActions;
QList<QAction*> myMaterialActions;
//QList<DocumentCommon*> myDocuments;
QToolBar* myStdToolBar;
QToolBar* myCasCadeBar;
QMenu* myFilePopup;
QMenu* myWindowPopup;
QAction* myFileSeparator;
protected:
QList<DocumentCommon*> myDocuments;
};
#endif