#include <QGridLayout>
#include <QGroupBox>
#include <QHeaderView>
+#include <QInputDialog>
#include <QLabel>
#include <QLineEdit>
#include <QPushButton>
// set edit triggers by default
setReadOnly( false );
+ connect( horizontalHeader(), SIGNAL( sectionDoubleClicked( int ) ), this, SLOT( headerDblClicked( int ) ) );
+
if ( stepVar->_is_nil() )
return;
return;
}
+//=======================================================================
+//function : headerDblClicked
+//purpose : rename column, called when used double-clicks on the header
+//=======================================================================
+
+void EntityGUI_FieldDlg::StepTable::headerDblClicked( int section )
+{
+ if ( section > 0 ) {
+ bool bOk;
+ QString label = QInputDialog::getText( this, EntityGUI_FieldDlg::tr( "RENAME_COMPONENT" ),
+ EntityGUI_FieldDlg::tr ( "COMPONENT_NAME" ), QLineEdit::Normal,
+ horizontalHeaderItem( section )->text(), &bOk );
+ if ( bOk && !label.isEmpty() )
+ horizontalHeaderItem( section )->setText( label );
+ }
+}
+
//=======================================================================
//function : EntityGUI_FieldDlg
//purpose :
class Delegate;
public:
-
EntityGUI_FieldDlg (GeometryGUI* theGeometryGUI,
GEOM::GEOM_Field_ptr theField, int stepID=0,
QWidget* parent=0,
int getSelectedSubshapes (TColStd_IndexedMapOfInteger& map);
private:
-
bool myIsCreation;
GEOM::GEOM_Field_var myField;
GEOM::GEOM_Object_var myShape;
bool myIsChanged;
QTableWidgetItem * newDefaultItem();
+
public:
StepTable( int stepID, int dataType, int nbRows, int nbColumns,
QString shapeName, QStringList headers,
void setHeaders(const QStringList& headers);
GEOM::GEOM_FieldStep_var getStep() { return myStep; }
void setValues(GEOM::GEOM_FieldStep_var& step);
+
public slots:
void setIsChanged() { myIsChanged = true; }
+ void headerDblClicked( int );
};
#endif
<source>WHOLE_SHAPE_VHEADER</source>
<translation>Shape</translation>
</message>
+ <message>
+ <source>RENAME_COMPONENT</source>
+ <translation>Change component name</translation>
+ </message>
+ <message>
+ <source>COMPONENT_NAME</source>
+ <translation>Name:</translation>
+ </message>
</context>
<context>
<name>MeasureGUI_1Sel1TextView1Check_QTD</name>