Table( int, int, QWidget* = 0 );
virtual ~Table();
+ QSize minimumSizeHint() const;
+
void setEditable( bool, int, int );
bool isEditable( int, int ) const;
setReadOnly( false );
}
+//=======================================================================
+// name : SMESHGUI_FilterTable::Table::Table
+// Purpose : Constructor
+//=======================================================================
SMESHGUI_FilterTable::Table::Table (int numRows, int numCols, QWidget* parent)
: QTableWidget(numRows, numCols, parent)
{
setReadOnly( false );
}
+//=======================================================================
+// name : SMESHGUI_FilterTable::Table::~Table
+// Purpose : Destructor
+//=======================================================================
SMESHGUI_FilterTable::Table::~Table()
{
}
+//=======================================================================
+// name : SMESHGUI_FilterTable::Table::minimumSizeHint
+// Purpose : Get minimum size for the table
+//=======================================================================
+QSize SMESHGUI_FilterTable::Table::minimumSizeHint() const
+{
+ QSize s = QTableWidget::minimumSizeHint();
+ QHeaderView* hv = horizontalHeader();
+ if ( hv )
+ s.setWidth( qMax( s.width(), hv->length() ) );
+ return s;
+}
+
//=======================================================================
// name : SMESHGUI_FilterTable::Table::setEditable
// Purpose : Set editable of specified cell
{
setEditTriggers( on ?
QAbstractItemView::NoEditTriggers :
- QAbstractItemView::DoubleClicked |
- QAbstractItemView::SelectedClicked |
- QAbstractItemView::EditKeyPressed |
- QAbstractItemView::AnyKeyPressed );
+ QAbstractItemView::AllEditTriggers );
}
bool SMESHGUI_FilterTable::Table::isReadOnly() const
aHeaderLabels.append( tr("BINARY") + " " );
aHeaderLabels.append( tr("ID") );
aTable->setHorizontalHeaderLabels( aHeaderLabels );
-
+
// set geometry of the table
for (int i = 0; i <= 4; i++)
aTable->resizeColumnToContents(i);