casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | Private Slots | Private Member Functions | Private Attributes | List of all members
casa::QtRSFileSaver Class Reference

Class for saving region files. More...

#include <QtRegionShapeManager.qo.h>

Inheritance diagram for casa::QtRSFileSaver:

Public Member Functions

 QtRSFileSaver (casacore::String file="", casacore::String format="", casacore::String dir="")
 Constructor. More...
 
 ~QtRSFileSaver ()
 Destructor. More...
 

Static Public Member Functions

static RSFileWritergetFileWriter (casacore::String *file=NULL, casacore::String *format=NULL, casacore::String *directory=NULL)
 Opens a new QtRegionFileSaver so that the user can input a filename, file format, and format options, and then returns a RegionFileWriter appropriate for writing that file. More...
 

Private Slots

void browse ()
 Show a file chooser dialog. More...
 
void showHideOptions (bool show)
 Show/hide the region-specific options frame. More...
 
void ok ()
 Check that the entered file is valid, then accept(). More...
 

Private Member Functions

casacore::String getFilename ()
 Gets the current filename chosen by the user. More...
 
casacore::String getDirectory ()
 Gets the directory of the filename chosen by the user. More...
 
casacore::String getFormat ()
 Gets the current region file format chosen by the user. More...
 
QWidget * getOptions ()
 Gets the current options widget. More...
 

Private Attributes

QString m_lastDir
 
QStackedLayout * m_formatOptions
 Layout holding widgets for specialized format options. More...
 

Detailed Description

Class for saving region files.

The main use is QtRSFileSaver::getFileWriter(), which prompts the user for a filename (with file chooser dialog), a file format, and options specific to the file format, and then returns a RSFileWriter appropriate for writing that file.

Definition at line 223 of file QtRegionShapeManager.qo.h.

Constructor & Destructor Documentation

casa::QtRSFileSaver::QtRSFileSaver ( casacore::String  file = "",
casacore::String  format = "",
casacore::String  dir = "" 
)

Constructor.

The initial file and format will be set to the given, and if a filechooser is opened the starting directory will be set to the given.

casa::QtRSFileSaver::~QtRSFileSaver ( )

Destructor.

Member Function Documentation

void casa::QtRSFileSaver::browse ( )
privateslot

Show a file chooser dialog.

casacore::String casa::QtRSFileSaver::getDirectory ( )
private

Gets the directory of the filename chosen by the user.

casacore::String casa::QtRSFileSaver::getFilename ( )
private

Gets the current filename chosen by the user.

static RSFileWriter* casa::QtRSFileSaver::getFileWriter ( casacore::String file = NULL,
casacore::String format = NULL,
casacore::String directory = NULL 
)
static

Opens a new QtRegionFileSaver so that the user can input a filename, file format, and format options, and then returns a RegionFileWriter appropriate for writing that file.

Returns NULL if the user cancels or an error occurs (shouldn't happen). If the casacore::String* arguments are given, they will be used for the initial settings and then updated to show the saved file, format, and directory, respectively.

casacore::String casa::QtRSFileSaver::getFormat ( )
private

Gets the current region file format chosen by the user.

Guaranteed to be one of the values in RegionFileReader::supportedTypesStrings().

QWidget* casa::QtRSFileSaver::getOptions ( )
private

Gets the current options widget.

void casa::QtRSFileSaver::ok ( )
privateslot

Check that the entered file is valid, then accept().

void casa::QtRSFileSaver::showHideOptions ( bool  show)
privateslot

Show/hide the region-specific options frame.

Member Data Documentation

QStackedLayout* casa::QtRSFileSaver::m_formatOptions
private

Layout holding widgets for specialized format options.

Definition at line 250 of file QtRegionShapeManager.qo.h.

QString casa::QtRSFileSaver::m_lastDir
private

Definition at line 247 of file QtRegionShapeManager.qo.h.


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