Version: 9.12.0
PyViewer_ViewWindow Class Reference

Python view window. More...

#include <PyViewer_ViewWindow.h>

Inheritance diagram for PyViewer_ViewWindow:
Inheritance graph

Public Types

enum  {
  NewId , OpenId , SaveId , SaveAsId ,
  UndoId , RedoId , CutId , CopyId ,
  PasteId , DeleteId , SelectAllId , FindId ,
  ReplaceId , PreferencesId , HelpId
}
 

Public Member Functions

 PyViewer_ViewWindow (SUIT_Desktop *=0)
 Constructor. More...
 
 ~PyViewer_ViewWindow ()
 Destructor. More...
 
- Public Member Functions inherited from SUIT_ViewWindow
 SUIT_ViewWindow (SUIT_Desktop *)
 
virtual ~SUIT_ViewWindow ()
 
virtual void setViewManager (SUIT_ViewManager *)
 
SUIT_ViewManagergetViewManager () const
 
bool event (QEvent *)
 
virtual QImage dumpView ()
 
bool dumpViewToFormat (const QString &fileName, const QString &format)
 
bool onAccelAction (int)
 
bool closable () const
 
bool setClosable (const bool)
 
virtual QString getVisualParameters ()
 
virtual void setVisualParameters (const QString &parameters)
 
void setDestructiveClose (const bool)
 
int getId () const
 
QtxActionToolMgrtoolMgr () const
 
virtual void setDropDownButtons (bool)
 Set buttons mode to drop-down (on = true) or ligned (on = false) More...
 
bool dropDownButtons () const
 Get current buttons mode. More...
 
virtual void enableAutoRotation (const bool)
 
virtual bool isAutoRotationEnabled () const
 
virtual SUIT_CameraProperties cameraProperties ()
 

Protected Member Functions

virtual void closeEvent (QCloseEvent *)
 Manage window close request. More...
 
- Protected Member Functions inherited from SUIT_ViewWindow
void closeEvent (QCloseEvent *)
 
virtual void contextMenuEvent (QContextMenuEvent *)
 
virtual QString filter () const
 
virtual bool action (const int)
 
virtual bool dumpViewToFormat (const QImage &, const QString &fileName, const QString &format)
 
virtual QActionsynchronizeAction ()
 

Private Slots

void onNew ()
 
void onOpen ()
 
bool onSave ()
 
bool onSaveAs ()
 
void onPreferences ()
 
void onHelp ()
 

Private Member Functions

void loadFile (const QString &)
 Open file. More...
 
bool saveFile (const QString &)
 Saves file. More...
 
void setCurrentFile (const QString &)
 Associate filePath with the current document. More...
 
bool whetherSave ()
 Check whether the file is modified. If it has the modifications then ask the user to save it. More...
 
QString defaultName () const
 

Private Attributes

PyEditor_Widget * myEditor
 
QString myURL
 

Additional Inherited Members

- Public Slots inherited from SUIT_ViewWindow
virtual void onDumpView ()
 
void setVisible (bool)
 
- Signals inherited from SUIT_ViewWindow
void tryClosing (SUIT_ViewWindow *)
 
void closing (SUIT_ViewWindow *)
 
void mousePressed (SUIT_ViewWindow *, QMouseEvent *)
 
void mouseReleased (SUIT_ViewWindow *, QMouseEvent *)
 
void mouseDoubleClicked (SUIT_ViewWindow *, QMouseEvent *)
 
void mouseMoving (SUIT_ViewWindow *, QMouseEvent *)
 
void wheeling (SUIT_ViewWindow *, QWheelEvent *)
 
void keyPressed (SUIT_ViewWindow *, QKeyEvent *)
 
void keyReleased (SUIT_ViewWindow *, QKeyEvent *)
 
void contextMenuRequested (QContextMenuEvent *e)
 
void viewModified (SUIT_ViewWindow *)
 
void vpStartRotate (int, int, qint64)
 
void vpRotate (int, int, qint64)
 
void vpEndRotate (int, int, qint64)
 
- Protected Slots inherited from SUIT_ViewWindow
void updateSyncViews ()
 
void onSynchronizeView (bool)
 
virtual void synchronize (SUIT_ViewWindow *)
 
void emitViewModified ()
 
- Static Protected Member Functions inherited from SUIT_ViewWindow
static void synchronizeView (SUIT_ViewWindow *viewWindow, int id)
 
- Protected Attributes inherited from SUIT_ViewWindow
SUIT_DesktopmyDesktop
 
SUIT_ViewManagermyManager
 

Detailed Description

Python view window.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
NewId 
OpenId 
SaveId 
SaveAsId 
UndoId 
RedoId 
CutId 
CopyId 
PasteId 
DeleteId 
SelectAllId 
FindId 
ReplaceId 
PreferencesId 
HelpId 

Constructor & Destructor Documentation

◆ PyViewer_ViewWindow()

◆ ~PyViewer_ViewWindow()

PyViewer_ViewWindow::~PyViewer_ViewWindow ( )

Destructor.

Member Function Documentation

◆ closeEvent()

void PyViewer_ViewWindow::closeEvent ( QCloseEvent *  event)
protectedvirtual

Manage window close request.

Parameters
eventclose event

References whetherSave().

◆ defaultName()

QString PyViewer_ViewWindow::defaultName ( ) const
private

Get default name for Python file

Returns
default name

◆ loadFile()

void PyViewer_ViewWindow::loadFile ( const QString &  filePath)
private

Open file.

Parameters
filePathfile path

References myEditor, and setCurrentFile().

◆ onHelp

void PyViewer_ViewWindow::onHelp ( )
privateslot

Slot, called when user clicks "Help" button in "Preferences" dialog box.

References SUIT_Session::activeApplication(), SUIT_Application::onHelpContextModule(), and SUIT_Session::session().

◆ onNew

void PyViewer_ViewWindow::onNew ( )
privateslot

SLOT: Create new document

References myEditor, setCurrentFile(), and whetherSave().

◆ onOpen

void PyViewer_ViewWindow::onOpen ( )
privateslot

SLOT: Open existing Python file

References SUIT_ViewWindow::filter(), loadFile(), and whetherSave().

◆ onPreferences

void PyViewer_ViewWindow::onPreferences ( )
privateslot

SLOT: Open preferences dialog

References myEditor, and onHelp().

◆ onSave

bool PyViewer_ViewWindow::onSave ( )
privateslot

SLOT: Save current document

References myURL, onSaveAs(), and saveFile().

◆ onSaveAs

bool PyViewer_ViewWindow::onSaveAs ( )
privateslot

SLOT: Save current document under a new name

References defaultName(), SUIT_ViewWindow::filter(), myURL, and saveFile().

◆ saveFile()

bool PyViewer_ViewWindow::saveFile ( const QString &  filePath)
private

Saves file.

Parameters
theFilePathfile path

References myEditor, and setCurrentFile().

◆ setCurrentFile()

void PyViewer_ViewWindow::setCurrentFile ( const QString &  filePath)
private

Associate filePath with the current document.

Parameters
filePathdocument's file path

References myEditor, and myURL.

◆ whetherSave()

bool PyViewer_ViewWindow::whetherSave ( )
private

Check whether the file is modified. If it has the modifications then ask the user to save it.

Returns
true if the document is saved.

References myEditor, and onSave().

Member Data Documentation

◆ myEditor

PyEditor_Widget* PyViewer_ViewWindow::myEditor
private

◆ myURL

QString PyViewer_ViewWindow::myURL
private

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