summaryrefslogtreecommitdiff
path: root/examples/widgets/itemviews/spreadsheet/spreadsheet.cpp
diff options
context:
space:
mode:
authorChristoph Schleifenbaum <christoph@kdab.com>2011-12-22 19:33:28 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-04-22 17:56:55 +0200
commitae0fd6884d30ae2ce084e239468696aaec7f5795 (patch)
tree7342d45c8b2c9cbf309d2347812c4d83f1701ac3 /examples/widgets/itemviews/spreadsheet/spreadsheet.cpp
parent7df16fb4ccbe0476bc34274a77e98eec4e8d2d93 (diff)
downloadqtbase-ae0fd6884d30ae2ce084e239468696aaec7f5795.tar.gz
QAbstractScrollArea - add SizeAdjustPolicy and viewportSizeHint
This patch adds SizeAdjustPolicy to QAbstractScrollArea. If it is set to AdjustToContents it will make use of the new protected viewportSizeHint() (BC since it was reserved in Qt5). This function returns a suggested size based on contents. Change-Id: I5d8aa517e88b8b21c5712e62b4d574c3aad99d3b Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Diffstat (limited to 'examples/widgets/itemviews/spreadsheet/spreadsheet.cpp')
-rw-r--r--examples/widgets/itemviews/spreadsheet/spreadsheet.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/examples/widgets/itemviews/spreadsheet/spreadsheet.cpp b/examples/widgets/itemviews/spreadsheet/spreadsheet.cpp
index 59d29f0e61..6fab0c2aae 100644
--- a/examples/widgets/itemviews/spreadsheet/spreadsheet.cpp
+++ b/examples/widgets/itemviews/spreadsheet/spreadsheet.cpp
@@ -64,6 +64,7 @@ SpreadSheet::SpreadSheet(int rows, int cols, QWidget *parent)
toolBar->addWidget(formulaInput);
table = new QTableWidget(rows, cols, this);
+ table->setSizeAdjustPolicy(QTableWidget::AdjustToContents);
for (int c = 0; c < cols; ++c) {
QString character(QChar('A' + c));
table->setHorizontalHeaderItem(c, new QTableWidgetItem(character));