1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-05 18:16:23 +03:00
occt/samples/qt/Common/src/ApplicationCommon.h
dbp 861a7b03e1 0024479: Ray Tracing mode does not work in Qt IE sample
Implementation of  Ray Tracing mode in standard Qt sample
Fix compile warnings in Qt samples.
Fix tabs in Common-string.ts.
Update Code style.

0024415: Update QT samples
Code which was based on QT3 was removed. Some bugs and warnings has been also fixed.
Porting from QT4 to QT5 sample files.
2014-01-22 19:09:00 +04:00

88 lines
2.9 KiB
C++
Executable File

#ifndef APPLICATIONCOMMON_H
#define APPLICATIONCOMMON_H
#include "DocumentCommon.h"
#include <QMainWindow>
#include <QAction>
#include <QToolBar>
#include <QMenu>
#include <QMdiArea>
#include <QList>
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