#include "CurveCreator_TableView.h"
#include "CurveCreator_UtilsICurve.hxx"
+#include "CurveCreator_Widget.h"
#include <gp_Pnt.hxx>
CurveCreator_TableView::CurveCreator_TableView( CurveCreator_ICurve* theCurve,
- QWidget* theParent,
+ CurveCreator_Widget* theParent,
const QStringList& theCoordTitles )
- : QTableWidget( theParent ), myCurve( theCurve ), myCurrentSortId( -1 ), myCurrentSortOrder( Qt::AscendingOrder )
+ : QTableWidget( theParent ), myWidget( theParent ),
+ myCurve( theCurve ), myCurrentSortId( -1 ), myCurrentSortOrder( Qt::AscendingOrder )
{
setItemDelegate( new CurveCreator_TableItemDelegate( this ) );
setVisible( false );
myCurrentSortOrder = Qt::AscendingOrder;
sortByColumn( theLogicalId, myCurrentSortOrder );
+
+ CurveCreator_ICurve::SectionToPointList selected;
+ for( int r=0, n=rowCount(); r<n; r++ )
+ {
+ int section = item( r, 0 )->data( Qt::UserRole ).toInt();
+ int point = item( r, 1 )->data( Qt::UserRole ).toInt();
+ selected.push_back( CurveCreator_ICurve::SectionToPoint( section, point ) );
+ }
+ myWidget->setSelectedPoints( selected );
+
myCurrentSortId = theLogicalId;
}
#include <QItemDelegate>
#include <QTableWidget>
+class CurveCreator_Widget;
+
class CurveCreator_TableItemDelegate : public QItemDelegate
{
public:
Q_OBJECT
public:
- CurveCreator_TableView( CurveCreator_ICurve* theCurve, QWidget* theParent = 0,
+ CurveCreator_TableView( CurveCreator_ICurve* theCurve, CurveCreator_Widget* theParent,
const QStringList& theCoordTitles = QStringList() );
~CurveCreator_TableView() {};
void OnHeaderClick( int );
private:
+ CurveCreator_Widget* myWidget;
CurveCreator_ICurve* myCurve;
int myCurrentSortId;
void SetViewer2DMode(const bool To2D);
+ void setSelectedPoints( const CurveCreator_ICurve::SectionToPointList& =
+ CurveCreator_ICurve::SectionToPointList() );
+
signals:
void selectionChanged();
void subOperationStarted( QWidget*, bool );
void setDragStarted( const bool theState, const QPoint& thePoint = QPoint() );
void getSelectedPoints( CurveCreator_ICurve::SectionToPointList& thePoints );
- void setSelectedPoints( const CurveCreator_ICurve::SectionToPointList& =
- CurveCreator_ICurve::SectionToPointList() );
void stopActionMode();