SUIT_ViewWindow* TableViewer_Viewer::createView( SUIT_Desktop* theDesktop )
{
TableViewer_ViewWindow* vw = new TableViewer_ViewWindow( theDesktop, this );
- QtxTable* tbl = vw->table();
- if ( tbl && getViewManager() )
- tbl->viewport()->installEventFilter( getViewManager() );
+ initView( vw );
return vw;
}
+/*!
+ Start initialization of view window
+ \param theVW - view window to be initialized
+*/
+void TableViewer_Viewer::initView( TableViewer_ViewWindow* theVW )
+{
+ theVW->initLayout();
+ QtxTable* tbl = theVW->table();
+ //if ( tbl && getViewManager() )
+ // tbl->viewport()->installEventFilter( getViewManager() );
+}
#include "TableViewer.h"
#include "SUIT_ViewModel.h"
+class TableViewer_ViewWindow;
class SUIT_ViewWindow;
class SUIT_Desktop;
class QString;
~TableViewer_Viewer();
virtual SUIT_ViewWindow* createView(SUIT_Desktop* theDesktop);
- virtual QString getType() const { return Type(); }
+ virtual QString getType() const { return Type(); }
+protected:
+ void initView( TableViewer_ViewWindow* );
+
};
#endif // !defined(TABLEVIEWER_VIEWMODEL_H)
:SUIT_ViewWindow( theDesktop )
{
myModel = theModel;
- myTable = new QtxTable( this );
- connect( myTable->selectionModel(), SIGNAL( selectionChanged( const QItemSelection&,
- const QItemSelection& ) ), this, SLOT( selectionChanged() ) );
-
- //myTable->setReadOnly( true );
- setCentralWidget( myTable );
-
myToolBar = new QtxToolBar( true, tr("LBL_TOOLBAR_LABEL"), this );
- createActions();
- createToolBar();
-
// fill table
/*
myTable->setColumnCount(3);
return myTable;
}
+
+/*!
+ Internal initialization
+*/
+void TableViewer_ViewWindow::initLayout()
+{
+ myTable = createTable();
+ setCentralWidget( myTable );
+
+ createActions();
+ createToolBar();
+}
+
QImage TableViewer_ViewWindow::dumpView()
{
return QPixmap::grabWindow( table()->winId() ).toImage();
return theRow < myTable->rowCount() && theRow >= 0 &&
theCol < myTable->columnCount() & theCol >= 0;
}
+
+QtxTable* TableViewer_ViewWindow::createTable()
+{
+ QtxTable* aTable = new QtxTable( this );
+ connect( aTable->selectionModel(), SIGNAL( selectionChanged(
+ const QItemSelection&, const QItemSelection& ) ),
+ this, SLOT( selectionChanged() ) );
+ return aTable;
+}
QtxTable* table() const;
QToolBar* getToolBar() { return myToolBar; }
+ virtual void initLayout();
virtual QImage dumpView();
protected:
virtual bool canCopy( const int, const int );
virtual bool canPaste( const int, const int, const QString& );
+ virtual QtxTable* createTable();
void registerAction( const int, QtxAction* );
QtxAction* createAction( const int, const QString&, const QPixmap&, const QString&,
const QString&, const int = 0, QObject* = 0 );