QHeaderView - remove confusing bool

It is probably better not to have a default boolean in
QHeaderView::setResizeContentsPrecision

Task-number: QTBUG-34665

Change-Id: I0bb2c35abc1d5713bb3ee65df3af86c04f175a38
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
bb10
Thorbjørn Martsum 2013-11-07 18:58:15 +01:00 committed by The Qt Project
parent becdfa6fab
commit 5f5c879832
5 changed files with 9 additions and 10 deletions

View File

@ -1337,18 +1337,13 @@ QHeaderView::ResizeMode QHeaderView::sectionResizeMode(int logicalIndex) const
and QTreeView::sizeHintForColumn(). Reimplementing these functions can make this
function not having an effect.
If \a resizeSectionsNow is set to true (default) it will do adjustment of sections by calling
resizeSections(). (regardless if the precision was changed).
\sa resizeContentsPrecision(), setSectionResizeMode(), resizeSections(), QTableView::sizeHintForColumn(), QTableView::sizeHintForRow(), QTreeView::sizeHintForColumn()
*/
void QHeaderView::setResizeContentsPrecision(int precision, bool resizeSectionsNow)
void QHeaderView::setResizeContentsPrecision(int precision)
{
Q_D(QHeaderView);
d->resizeContentsPrecision = precision;
if (resizeSectionsNow)
resizeSections();
}
/*!

View File

@ -135,7 +135,7 @@ public:
void setSectionResizeMode(ResizeMode mode);
void setSectionResizeMode(int logicalIndex, ResizeMode mode);
void setResizeContentsPrecision(int precision, bool resizeNow = true);
void setResizeContentsPrecision(int precision);
int resizeContentsPrecision() const;
#if QT_DEPRECATED_SINCE(5, 0)

View File

@ -100,7 +100,8 @@ protected:
void TableDialog::slotValueChanged(int newval)
{
tableView->horizontalHeader()->setResizeContentsPrecision(newval, true);
tableView->horizontalHeader()->setResizeContentsPrecision(newval);
tableView->resizeColumnsToContents();
}

View File

@ -110,7 +110,8 @@ protected:
void TableDialog::slotValueChanged(int newval)
{
tableView->verticalHeader()->setResizeContentsPrecision(newval, true);
tableView->verticalHeader()->setResizeContentsPrecision(newval);
tableView->resizeRowsToContents();
}

View File

@ -118,7 +118,9 @@ protected:
void TreeDialog::slotValueChanged(int newval)
{
treeWidget->header()->setResizeContentsPrecision(newval, true);
treeWidget->header()->setResizeContentsPrecision(newval);
for (int u = 0; u < treeWidget->header()->count(); ++u)
treeWidget->resizeColumnToContents(u);
}
int main(int argc, char *argv[])