22 #ifndef SGTABLEVIEW_HPP
23 #define SGTABLEVIEW_HPP
26 #include <QAbstractItemView>
42 setSelectionMode(QAbstractItemView::ContiguousSelection);
43 setEditTriggers(QAbstractItemView::AllEditTriggers);
44 setSizePolicy(QSizePolicy::MinimumExpanding,QSizePolicy::MinimumExpanding);
59 QSize hint(QTableView::sizeHint());
62 for (
int col = 0; col < model()->columnCount(); col++)
63 newWidth += columnWidth(col);
64 newWidth += verticalHeader()->sizeHint().width();
67 for (
int row = 0; row < model()->rowCount(); row++)
68 newHeight += rowHeight(row);
70 newHeight += horizontalHeader()->sizeHint().height();
72 hint.setHeight(newHeight);
73 hint.setWidth(newWidth);