if ( fileName.isEmpty() )
return;
+ exportData( fileName );
+}
+
+void TableViewer_ViewWindow::exportData( const QString& theFileName )
+{
QApplication::setOverrideCursor( Qt::WaitCursor );
int rows = numRows( Cells );
Handle(HTMLService_HTMLTable) table = new HTMLService_HTMLTable( rows + horOffset,
cols + verOffset );
- QString title = getViewManager()->getTitle();
- SUIT_ViewWindow* anActiveWnd = getViewManager()->getActiveView();
+ QString title = getViewManager() ? getViewManager()->getTitle() : "";
+ SUIT_ViewWindow* anActiveWnd = getViewManager() ? getViewManager()->getActiveView() : 0;
if ( anActiveWnd )
title = anActiveWnd->windowTitle();
ltCell->SetHeaderCell( true );
ltCell->SetBackgroundColor( Quantity_NOC_GRAY );
}
- table->GenerateFile( TableViewer_Tool::ToExtString( fileName ), true );
+ table->GenerateFile( TableViewer_Tool::ToExtString( theFileName ), true );
QApplication::restoreOverrideCursor();
}
virtual void initLayout();
virtual QImage dumpView();
+ void exportData();
+ void exportData( const QString& );
+ void copyData();
+ void pasteData();
+
protected:
typedef enum { VerticalHeader, HorizontalHeader, Cells } ContentType;
typedef enum { DumpId, CopyId, PasteId, PrintId, ExportId, Custom } ActionId;
void onActivated();
private:
- void exportData();
- void copyData();
- void pasteData();
typedef struct {
QString myText;
QColor myBgCol;