Public Slots | Signals | Public Member Functions | List of all members
pqPythonFileIO Class Reference

Handles loading (resp. More...

#include <pqPythonFileIO.h>

Inherits QObject.

Public Slots

void setModified (bool modified)
 Change the buffer status to modified. More...
 
bool save ()
 Saves the underlying file. More...
 
bool saveAs ()
 Saves the current file under a new file and opens it in the editor. More...
 
bool saveAsMacro ()
 Saves the current file under the macro directory. More...
 
bool saveAsScript ()
 Saves the current file under the script directory. More...
 

Signals

void bufferErased ()
 Signals that the QTextEdit buffer has been erased. More...
 
void fileOpened (const QString &)
 Signals that a file has been opened. More...
 
void fileSaved (const QString &)
 Signals that the file has been saved. More...
 
void contentChanged ()
 Emitted when the content of the buffer has changed. More...
 

Public Member Functions

 pqPythonFileIO ()=delete
 Default constructor is not valid for this class. More...
 
 pqPythonFileIO (QWidget *parent, QTextEdit &text)
 Construct a pqPythonFileIO. More...
 
 ~pqPythonFileIO () override
 Destroy this object. More...
 
bool saveOnClose ()
 Saves and close the underlying file. More...
 
bool openFile (const QString &filename, vtkTypeUInt32 location=0x10)
 Opens and load the given file. More...
 
void setDefaultSaveDirectory (const QString &dir)
 Sets the default save directory. More...
 
const QString & getFilename () const
 Returns the filename the editor acts on. More...
 
vtkTypeUInt32 getLocation () const
 Returns the location of the file that the editor acts on. More...
 
bool isDirty () const
 Returns true if the buffer content has been saved on the disk. More...
 

Detailed Description

Handles loading (resp.

saving) from (resp. to) the disk to (resp. from) a QTextEdit widget.

Definition at line 28 of file pqPythonFileIO.h.

Constructor & Destructor Documentation

◆ pqPythonFileIO() [1/2]

pqPythonFileIO::pqPythonFileIO ( )
delete

Default constructor is not valid for this class.

◆ pqPythonFileIO() [2/2]

pqPythonFileIO::pqPythonFileIO ( QWidget *  parent,
QTextEdit &  text 
)

Construct a pqPythonFileIO.

Parameters
[in]parentthe parent for the Qt hierarchy
[in]textthe QTextEdit this object acts on

◆ ~pqPythonFileIO()

pqPythonFileIO::~pqPythonFileIO ( )
override

Destroy this object.

Effectively clears the swap created by this class

Member Function Documentation

◆ saveOnClose()

bool pqPythonFileIO::saveOnClose ( )

Saves and close the underlying file.

Returns
true if the saving process was successful, false if the user discarded the saves or if something wrong happened during file I/O

◆ openFile()

bool pqPythonFileIO::openFile ( const QString &  filename,
vtkTypeUInt32  location = 0x10 
)

Opens and load the given file.

Parameters
[in]filenamethe file to be opened
[in]locationthe location of the file
Returns
false if the file is invalid

◆ setDefaultSaveDirectory()

void pqPythonFileIO::setDefaultSaveDirectory ( const QString &  dir)
inline

Sets the default save directory.

Definition at line 70 of file pqPythonFileIO.h.

◆ getFilename()

const QString& pqPythonFileIO::getFilename ( ) const
inline

Returns the filename the editor acts on.

Definition at line 75 of file pqPythonFileIO.h.

◆ getLocation()

vtkTypeUInt32 pqPythonFileIO::getLocation ( ) const
inline

Returns the location of the file that the editor acts on.

Definition at line 80 of file pqPythonFileIO.h.

◆ isDirty()

bool pqPythonFileIO::isDirty ( ) const

Returns true if the buffer content has been saved on the disk.

◆ bufferErased

void pqPythonFileIO::bufferErased ( )
signal

Signals that the QTextEdit buffer has been erased.

◆ fileOpened

void pqPythonFileIO::fileOpened ( const QString &  )
signal

Signals that a file has been opened.

◆ fileSaved

void pqPythonFileIO::fileSaved ( const QString &  )
signal

Signals that the file has been saved.

◆ contentChanged

void pqPythonFileIO::contentChanged ( )
signal

Emitted when the content of the buffer has changed.

◆ setModified

void pqPythonFileIO::setModified ( bool  modified)
slot

Change the buffer status to modified.

◆ save

bool pqPythonFileIO::save ( )
slot

Saves the underlying file.

If no file is associated, ask the user which file to save this buffer in

◆ saveAs

bool pqPythonFileIO::saveAs ( )
slot

Saves the current file under a new file and opens it in the editor.

◆ saveAsMacro

bool pqPythonFileIO::saveAsMacro ( )
slot

Saves the current file under the macro directory.

◆ saveAsScript

bool pqPythonFileIO::saveAsScript ( )
slot

Saves the current file under the script directory.


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