Rename setResizeMode to setSectionResizeMode.

The overload of this method was renamed
in b64426248d but this one was not.

Change-Id: I60a6ddf0fcf9deea31ccf51e7b0db16c66023356
Reviewed-by: David Faure <faure@kde.org>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
This commit is contained in:
Stephen Kelly 2012-05-06 12:54:24 +02:00 committed by Qt by Nokia
parent 365cd77c26
commit 8ec1594e63
12 changed files with 42 additions and 31 deletions

View File

@ -76,7 +76,7 @@ void FreezeTableWidget::init()
frozenTableView->setModel(model());
frozenTableView->setFocusPolicy(Qt::NoFocus);
frozenTableView->verticalHeader()->hide();
frozenTableView->horizontalHeader()->setResizeMode(QHeaderView::Fixed);
frozenTableView->horizontalHeader()->setSectionResizeMode(QHeaderView::Fixed);
viewport()->stackUnder(frozenTableView);
//! [init part1]

View File

@ -51,7 +51,7 @@ ConnectionWidget::ConnectionWidget(QWidget *parent)
tree = new QTreeWidget(this);
tree->setObjectName(QLatin1String("tree"));
tree->setHeaderLabels(QStringList(tr("database")));
tree->header()->setResizeMode(QHeaderView::Stretch);
tree->header()->setSectionResizeMode(QHeaderView::Stretch);
QAction *refreshAction = new QAction(tr("Refresh"), tree);
metaDataAction = new QAction(tr("Show Schema"), tree);
connect(refreshAction, SIGNAL(triggered()), SLOT(refresh()));

View File

@ -48,7 +48,7 @@ XbelTree::XbelTree(QWidget *parent)
QStringList labels;
labels << tr("Title") << tr("Location");
header()->setResizeMode(QHeaderView::Stretch);
header()->setSectionResizeMode(QHeaderView::Stretch);
setHeaderLabels(labels);
folderIcon.addPixmap(style()->standardPixmap(QStyle::SP_DirClosedIcon),

View File

@ -86,7 +86,7 @@ RSSListing::RSSListing(QWidget *parent)
QStringList headerLabels;
headerLabels << tr("Title") << tr("Link");
treeWidget->setHeaderLabels(headerLabels);
treeWidget->header()->setResizeMode(QHeaderView::ResizeToContents);
treeWidget->header()->setSectionResizeMode(QHeaderView::ResizeToContents);
connect(&manager, SIGNAL(finished(QNetworkReply*)),
this, SLOT(finished(QNetworkReply*)));

View File

@ -50,7 +50,7 @@ MainWindow::MainWindow()
labels << tr("Title") << tr("Location");
treeWidget = new QTreeWidget;
treeWidget->header()->setResizeMode(QHeaderView::Stretch);
treeWidget->header()->setSectionResizeMode(QHeaderView::Stretch);
treeWidget->setHeaderLabels(labels);
setCentralWidget(treeWidget);

View File

@ -51,7 +51,7 @@ MainWindow::MainWindow()
labels << tr("Title") << tr("Location");
treeWidget = new QTreeWidget;
treeWidget->header()->setResizeMode(QHeaderView::Stretch);
treeWidget->header()->setSectionResizeMode(QHeaderView::Stretch);
treeWidget->setHeaderLabels(labels);
setCentralWidget(treeWidget);

View File

@ -122,7 +122,7 @@ QDataStream &operator>>(QDataStream &in, QHeaderViewPrivate::SectionItem &sectio
A header can be fixed in place, or made movable with setSectionsMovable(). It can
be made clickable with setSectionsClickable(), and has resizing behavior in
accordance with setResizeMode() and setSectionResizeMode()
accordance with setSectionResizeMode()
\note Double-clicking on a header to resize a section only applies for
visible rows.
@ -162,7 +162,7 @@ QDataStream &operator>>(QDataStream &in, QHeaderViewPrivate::SectionItem &sectio
The resize mode specifies the behavior of the header sections. It can be
set on the entire header view or on individual sections using
setResizeMode().
setSectionResizeMode().
\value Interactive The user can resize the section. The section can also be
resized programmatically using resizeSection(). The section size
@ -501,7 +501,7 @@ void QHeaderView::setOffsetToLastSection()
/*!
Returns the length along the orientation of the header.
\sa sizeHint(), setResizeMode(), offset()
\sa sizeHint(), setSectionResizeMode(), offset()
*/
int QHeaderView::length() const
@ -625,7 +625,7 @@ int QHeaderView::logicalIndexAt(int position) const
Returns the width (or height for vertical headers) of the given
\a logicalIndex.
\sa length(), setResizeMode(), defaultSectionSize()
\sa length(), setSectionResizeMode(), defaultSectionSize()
*/
int QHeaderView::sectionSize(int logicalIndex) const
@ -1186,7 +1186,7 @@ bool QHeaderView::highlightSections() const
\sa resizeMode(), length(), sectionResized()
*/
void QHeaderView::setResizeMode(ResizeMode mode)
void QHeaderView::setSectionResizeMode(ResizeMode mode)
{
Q_D(QHeaderView);
initializeSections();
@ -1242,11 +1242,20 @@ void QHeaderView::setSectionResizeMode(int logicalIndex, ResizeMode mode)
\sa setSectionResizeMode()
*/
/*!
\obsolete
\fn void QHeaderView::setResizeMode(ResizeMode mode)
Use setSectionResizeMode instead.
\sa setSectionResizeMode()
*/
/*!
Returns the resize mode that applies to the section specified by the given
\a logicalIndex.
\sa setResizeMode()
\sa setSectionResizeMode()
*/
QHeaderView::ResizeMode QHeaderView::sectionResizeMode(int logicalIndex) const
@ -1396,7 +1405,7 @@ Qt::SortOrder QHeaderView::sortIndicatorOrder() const
property will override the resize mode set on the last section in the
header.
\sa setResizeMode()
\sa setSectionResizeMode()
*/
bool QHeaderView::stretchLastSection() const
{
@ -1428,7 +1437,7 @@ void QHeaderView::setStretchLastSection(bool stretch)
The default value is false.
\sa setResizeMode()
\sa setSectionResizeMode()
*/
bool QHeaderView::cascadingSectionResizes() const
{
@ -1449,7 +1458,7 @@ void QHeaderView::setCascadingSectionResizes(bool enable)
This property only affects sections that have \l Interactive or \l Fixed
as their resize mode.
\sa setResizeMode() minimumSectionSize
\sa setSectionResizeMode() minimumSectionSize
*/
int QHeaderView::defaultSectionSize() const
{
@ -1475,7 +1484,7 @@ void QHeaderView::setDefaultSectionSize(int size)
This property is honored by all \l{ResizeMode}{resize modes}.
\sa setResizeMode() defaultSectionSize
\sa setSectionResizeMode() defaultSectionSize
*/
int QHeaderView::minimumSectionSize() const
{

View File

@ -131,10 +131,12 @@ public:
void setHighlightSections(bool highlight);
bool highlightSections() const;
void setResizeMode(ResizeMode mode);
ResizeMode sectionResizeMode(int logicalIndex) const;
void setSectionResizeMode(ResizeMode mode);
void setSectionResizeMode(int logicalIndex, ResizeMode mode);
#if QT_DEPRECATED_SINCE(5, 0)
inline QT_DEPRECATED void setResizeMode(ResizeMode mode)
{ setSectionResizeMode(mode); }
inline QT_DEPRECATED void setResizeMode(int logicalindex, ResizeMode mode)
{ setSectionResizeMode(logicalindex, mode); }
inline QT_DEPRECATED ResizeMode resizeMode(int logicalindex) const

View File

@ -2067,9 +2067,9 @@ QCalendarWidget::QCalendarWidget(QWidget *parent)
d->m_model->setView(d->m_view);
d->m_view->setSelectionBehavior(QAbstractItemView::SelectItems);
d->m_view->setSelectionMode(QAbstractItemView::SingleSelection);
d->m_view->horizontalHeader()->setResizeMode(QHeaderView::Stretch);
d->m_view->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
d->m_view->horizontalHeader()->setSectionsClickable(false);
d->m_view->verticalHeader()->setResizeMode(QHeaderView::Stretch);
d->m_view->verticalHeader()->setSectionResizeMode(QHeaderView::Stretch);
d->m_view->verticalHeader()->setSectionsClickable(false);
d->m_selection = d->m_view->selectionModel();
d->createNavigationBar(this);

View File

@ -577,7 +577,7 @@ void tst_QHeaderView::oneSectionSize()
model.cols = 1;
model.rows = 1;
view.setResizeMode(QHeaderView::Interactive);
view.setSectionResizeMode(QHeaderView::Interactive);
view.setModel(&model);
view.show();
@ -1150,13 +1150,13 @@ void tst_QHeaderView::resizeMode()
{
// resizeMode must not be called with an invalid index
int last = view->count() - 1;
view->setResizeMode(QHeaderView::Interactive);
view->setSectionResizeMode(QHeaderView::Interactive);
QCOMPARE(view->sectionResizeMode(last), QHeaderView::Interactive);
QCOMPARE(view->sectionResizeMode(1), QHeaderView::Interactive);
view->setResizeMode(QHeaderView::Stretch);
view->setSectionResizeMode(QHeaderView::Stretch);
QCOMPARE(view->sectionResizeMode(last), QHeaderView::Stretch);
QCOMPARE(view->sectionResizeMode(1), QHeaderView::Stretch);
view->setResizeMode(QHeaderView::Custom);
view->setSectionResizeMode(QHeaderView::Custom);
QCOMPARE(view->sectionResizeMode(last), QHeaderView::Custom);
QCOMPARE(view->sectionResizeMode(1), QHeaderView::Custom);
@ -1349,7 +1349,7 @@ void tst_QHeaderView::unhideSection()
view->setSectionHidden(0, true);
QCOMPARE(view->sectionsHidden(), true);
QVERIFY(view->sectionSize(0) == 0);
view->setResizeMode(QHeaderView::Interactive);
view->setSectionResizeMode(QHeaderView::Interactive);
view->setSectionHidden(0, false);
QVERIFY(view->sectionSize(0) > 0);
@ -1357,7 +1357,7 @@ void tst_QHeaderView::unhideSection()
QVERIFY(view->sectionSize(0) == 0);
view->setSectionHidden(0, true);
QVERIFY(view->sectionSize(0) == 0);
view->setResizeMode(QHeaderView::Stretch);
view->setSectionResizeMode(QHeaderView::Stretch);
view->setSectionHidden(0, false);
QVERIFY(view->sectionSize(0) > 0);
@ -1462,7 +1462,7 @@ void tst_QHeaderView::hiddenSectionCount()
QCOMPARE(view->hiddenSectionCount(), 5);
view->setResizeMode(QHeaderView::Stretch);
view->setSectionResizeMode(QHeaderView::Stretch);
QCOMPARE(view->hiddenSectionCount(), 5);
// Remove some rows and make sure they are now still counted
@ -1717,7 +1717,7 @@ void tst_QHeaderView::globalResizeMode()
QHeaderView h((Qt::Orientation)direction);
h.setModel(&m);
h.setResizeMode((QHeaderView::ResizeMode)mode);
h.setSectionResizeMode((QHeaderView::ResizeMode)mode);
m.insertRow(insert);
for (int i = 0; i < h.count(); ++i)
QCOMPARE(h.sectionResizeMode(i), (QHeaderView::ResizeMode)mode);
@ -2095,7 +2095,7 @@ void tst_QHeaderView::QTBUG7833_sectionClicked()
tv.horizontalHeader()->setSortIndicatorShown(true);
tv.horizontalHeader()->setSectionsClickable(true);
tv.horizontalHeader()->setStretchLastSection(true);
tv.horizontalHeader()->setResizeMode(QHeaderView::Interactive);
tv.horizontalHeader()->setSectionResizeMode(QHeaderView::Interactive);
tv.setModel(proxyModel);
tv.setColumnHidden(5, true);
@ -2172,7 +2172,7 @@ void tst_QHeaderView::QTBUG14242_hideSectionAutoSize()
qtv.setModel(&amodel);
QHeaderView *hv = qtv.verticalHeader();
hv->setDefaultSectionSize(25);
hv->setResizeMode(QHeaderView::ResizeToContents);
hv->setSectionResizeMode(QHeaderView::ResizeToContents);
qtv.show();
hv->hideSection(0);

View File

@ -4067,7 +4067,7 @@ void tst_QTableView::taskQTBUG_10169_sizeHintForRow()
QStandardItemModel model(1, 3);
model.setData(model.index(0, 0), "Word wrapping text goes here.");
tableView.setModel(&model);
tableView.verticalHeader()->setResizeMode(QHeaderView::ResizeToContents);
tableView.verticalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
const int orderedHeight = tableView.sizeHintForRow(0);
tableView.horizontalHeader()->moveSection(2, 0);
const int reorderedHeight = tableView.sizeHintForRow(0);

View File

@ -3608,7 +3608,7 @@ void tst_QTreeView::task250683_wrongSectionSize()
{
QDirModel model;
QTreeView treeView;
treeView.header()->setResizeMode(QHeaderView::ResizeToContents);
treeView.header()->setSectionResizeMode(QHeaderView::ResizeToContents);
treeView.setModel(&model);
treeView.setColumnHidden(2, true);
treeView.setColumnHidden(3, true);