Remove deprecated members from QtWidgets/itemviews classes
Cleaning up those that are trivial to remove because they have direct replacements. Change-Id: Ie9fecd8c4822ed1a8f378b210cc4c4d9a10f7e36 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>bb10
parent
bd49862e8e
commit
eb3b37de83
|
|
@ -345,28 +345,6 @@ bool QAbstractItemDelegate::editorEvent(QEvent *,
|
|||
return false;
|
||||
}
|
||||
|
||||
#if QT_DEPRECATED_SINCE(5, 13)
|
||||
/*!
|
||||
\obsolete
|
||||
|
||||
Use QFontMetrics::elidedText() instead.
|
||||
|
||||
\oldcode
|
||||
QFontMetrics fm = ...
|
||||
QString str = QAbstractItemDelegate::elidedText(fm, width, mode, text);
|
||||
\newcode
|
||||
QFontMetrics fm = ...
|
||||
QString str = fm.elidedText(text, mode, width);
|
||||
\endcode
|
||||
*/
|
||||
|
||||
QString QAbstractItemDelegate::elidedText(const QFontMetrics &fontMetrics, int width,
|
||||
Qt::TextElideMode mode, const QString &text)
|
||||
{
|
||||
return fontMetrics.elidedText(text, mode, width);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*!
|
||||
\since 4.3
|
||||
Whenever a help event occurs, this function is called with the \a event
|
||||
|
|
|
|||
|
|
@ -103,12 +103,6 @@ public:
|
|||
const QStyleOptionViewItem &option,
|
||||
const QModelIndex &index);
|
||||
|
||||
#if QT_DEPRECATED_SINCE(5, 13)
|
||||
QT_DEPRECATED_X("Use QFontMetrics::elidedText() instead")
|
||||
static QString elidedText(const QFontMetrics &fontMetrics, int width,
|
||||
Qt::TextElideMode mode, const QString &text);
|
||||
#endif
|
||||
|
||||
virtual bool helpEvent(QHelpEvent *event,
|
||||
QAbstractItemView *view,
|
||||
const QStyleOptionViewItem &option,
|
||||
|
|
|
|||
|
|
@ -2924,65 +2924,7 @@ void QAbstractItemView::editorDestroyed(QObject *editor)
|
|||
setState(NoState);
|
||||
}
|
||||
|
||||
#if QT_DEPRECATED_SINCE(5, 13)
|
||||
/*!
|
||||
\obsolete
|
||||
Sets the horizontal scroll bar's steps per item to \a steps.
|
||||
|
||||
This is the number of steps used by the horizontal scroll bar to
|
||||
represent the width of an item.
|
||||
|
||||
Note that if the view has a horizontal header, the item steps
|
||||
will be ignored and the header section size will be used instead.
|
||||
|
||||
\sa horizontalStepsPerItem(), setVerticalStepsPerItem()
|
||||
*/
|
||||
void QAbstractItemView::setHorizontalStepsPerItem(int steps)
|
||||
{
|
||||
Q_UNUSED(steps)
|
||||
// do nothing
|
||||
}
|
||||
|
||||
/*!
|
||||
\obsolete
|
||||
Returns the horizontal scroll bar's steps per item.
|
||||
|
||||
\sa setHorizontalStepsPerItem(), verticalStepsPerItem()
|
||||
*/
|
||||
int QAbstractItemView::horizontalStepsPerItem() const
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*!
|
||||
\obsolete
|
||||
Sets the vertical scroll bar's steps per item to \a steps.
|
||||
|
||||
This is the number of steps used by the vertical scroll bar to
|
||||
represent the height of an item.
|
||||
|
||||
Note that if the view has a vertical header, the item steps
|
||||
will be ignored and the header section size will be used instead.
|
||||
|
||||
\sa verticalStepsPerItem(), setHorizontalStepsPerItem()
|
||||
*/
|
||||
void QAbstractItemView::setVerticalStepsPerItem(int steps)
|
||||
{
|
||||
Q_UNUSED(steps)
|
||||
// do nothing
|
||||
}
|
||||
|
||||
/*!
|
||||
\obsolete
|
||||
Returns the vertical scroll bar's steps per item.
|
||||
|
||||
\sa setVerticalStepsPerItem(), horizontalStepsPerItem()
|
||||
*/
|
||||
int QAbstractItemView::verticalStepsPerItem() const
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*!
|
||||
Moves to and selects the item best matching the string \a search.
|
||||
|
|
|
|||
|
|
@ -272,13 +272,6 @@ Q_SIGNALS:
|
|||
protected:
|
||||
QAbstractItemView(QAbstractItemViewPrivate &, QWidget *parent = nullptr);
|
||||
|
||||
#if QT_DEPRECATED_SINCE(5, 13)
|
||||
QT_DEPRECATED void setHorizontalStepsPerItem(int steps);
|
||||
QT_DEPRECATED int horizontalStepsPerItem() const;
|
||||
QT_DEPRECATED void setVerticalStepsPerItem(int steps);
|
||||
QT_DEPRECATED int verticalStepsPerItem() const;
|
||||
#endif
|
||||
|
||||
enum CursorAction { MoveUp, MoveDown, MoveLeft, MoveRight,
|
||||
MoveHome, MoveEnd, MovePageUp, MovePageDown,
|
||||
MoveNext, MovePrevious };
|
||||
|
|
|
|||
|
|
@ -115,19 +115,11 @@ public:
|
|||
|
||||
void setSectionsMovable(bool movable);
|
||||
bool sectionsMovable() const;
|
||||
#if QT_DEPRECATED_SINCE(5, 0)
|
||||
inline QT_DEPRECATED void setMovable(bool movable) { setSectionsMovable(movable); }
|
||||
inline QT_DEPRECATED bool isMovable() const { return sectionsMovable(); }
|
||||
#endif
|
||||
void setFirstSectionMovable(bool movable);
|
||||
bool isFirstSectionMovable() const;
|
||||
|
||||
void setSectionsClickable(bool clickable);
|
||||
bool sectionsClickable() const;
|
||||
#if QT_DEPRECATED_SINCE(5, 0)
|
||||
inline QT_DEPRECATED void setClickable(bool clickable) { setSectionsClickable(clickable); }
|
||||
inline QT_DEPRECATED bool isClickable() const { return sectionsClickable(); }
|
||||
#endif
|
||||
|
||||
void setHighlightSections(bool highlight);
|
||||
bool highlightSections() const;
|
||||
|
|
@ -139,15 +131,6 @@ public:
|
|||
void setResizeContentsPrecision(int precision);
|
||||
int resizeContentsPrecision() const;
|
||||
|
||||
#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
|
||||
{ return sectionResizeMode(logicalindex); }
|
||||
#endif
|
||||
|
||||
int stretchSectionCount() const;
|
||||
|
||||
void setSortIndicatorShown(bool show);
|
||||
|
|
|
|||
|
|
@ -1001,20 +1001,6 @@ static QString qPixmapSerial(quint64 i, bool enabled)
|
|||
return QString((const QChar *)ptr, int(&arr[sizeof(arr) / sizeof(ushort)] - ptr));
|
||||
}
|
||||
|
||||
#if QT_DEPRECATED_SINCE(5, 13)
|
||||
QPixmap *QItemDelegate::selected(const QPixmap &pixmap, const QPalette &palette, bool enabled) const
|
||||
{
|
||||
const QString key = qPixmapSerial(pixmap.cacheKey(), enabled);
|
||||
QT_WARNING_PUSH
|
||||
QT_WARNING_DISABLE_DEPRECATED
|
||||
QPixmap *pm = QPixmapCache::find(key);
|
||||
if (pm)
|
||||
return pm;
|
||||
selectedPixmap(pixmap, palette, enabled);
|
||||
return QPixmapCache::find(key);
|
||||
QT_WARNING_POP
|
||||
}
|
||||
#endif
|
||||
|
||||
/*!
|
||||
\internal
|
||||
|
|
|
|||
|
|
@ -114,10 +114,6 @@ protected:
|
|||
|
||||
QPixmap decoration(const QStyleOptionViewItem &option, const QVariant &variant) const;
|
||||
|
||||
#if QT_DEPRECATED_SINCE(5, 13)
|
||||
QT_DEPRECATED_X("Use selectedPixmap() instead")
|
||||
QPixmap *selected(const QPixmap &pixmap, const QPalette &palette, bool enabled) const;
|
||||
#endif
|
||||
static QPixmap selectedPixmap(const QPixmap &pixmap, const QPalette &palette, bool enabled);
|
||||
|
||||
QRect doCheck(const QStyleOptionViewItem &option, const QRect &bounding,
|
||||
|
|
|
|||
|
|
@ -227,7 +227,6 @@ bool QListModel::setData(const QModelIndex &index, const QVariant &value, int ro
|
|||
return true;
|
||||
}
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
bool QListModel::clearItemData(const QModelIndex &index)
|
||||
{
|
||||
if (!checkIndex(index, CheckIndexOption::IndexIsValid))
|
||||
|
|
@ -241,7 +240,6 @@ bool QListModel::clearItemData(const QModelIndex &index)
|
|||
emit dataChanged(index, index, QVector<int>{});
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
QMap<int, QVariant> QListModel::itemData(const QModelIndex &index) const
|
||||
{
|
||||
|
|
@ -937,15 +935,6 @@ QDataStream &operator>>(QDataStream &in, QListWidgetItem &item)
|
|||
\sa Qt::AlignmentFlag
|
||||
*/
|
||||
|
||||
#if QT_DEPRECATED_SINCE(5, 13)
|
||||
/*!
|
||||
\fn QColor QListWidgetItem::backgroundColor() const
|
||||
\obsolete
|
||||
|
||||
This function is deprecated. Use background() instead.
|
||||
*/
|
||||
#endif
|
||||
|
||||
/*!
|
||||
\fn QBrush QListWidgetItem::background() const
|
||||
\since 4.2
|
||||
|
|
@ -955,17 +944,6 @@ QDataStream &operator>>(QDataStream &in, QListWidgetItem &item)
|
|||
\sa setBackground(), foreground()
|
||||
*/
|
||||
|
||||
#if QT_DEPRECATED_SINCE(5, 13)
|
||||
/*!
|
||||
\fn QColor QListWidgetItem::textColor() const
|
||||
\obsolete
|
||||
|
||||
Returns the color used to display the list item's text.
|
||||
|
||||
This function is deprecated. Use foreground() instead.
|
||||
*/
|
||||
#endif
|
||||
|
||||
/*!
|
||||
\fn QBrush QListWidgetItem::foreground() const
|
||||
\since 4.2
|
||||
|
|
@ -1115,13 +1093,6 @@ void QListWidgetItem::setFlags(Qt::ItemFlags aflags)
|
|||
\sa Qt::AlignmentFlag
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void QListWidgetItem::setBackgroundColor(const QColor &color)
|
||||
\obsolete
|
||||
|
||||
This function is deprecated. Use setBackground() instead.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void QListWidgetItem::setBackground(const QBrush &brush)
|
||||
\since 4.2
|
||||
|
|
@ -1133,15 +1104,6 @@ void QListWidgetItem::setFlags(Qt::ItemFlags aflags)
|
|||
\sa background(), setForeground()
|
||||
*/
|
||||
|
||||
#if QT_DEPRECATED_SINCE(5, 13)
|
||||
/*!
|
||||
\fn void QListWidgetItem::setTextColor(const QColor &color)
|
||||
\obsolete
|
||||
|
||||
This function is deprecated. Use setForeground() instead.
|
||||
*/
|
||||
#endif
|
||||
|
||||
/*!
|
||||
\fn void QListWidgetItem::setForeground(const QBrush &brush)
|
||||
\since 4.2
|
||||
|
|
@ -1791,34 +1753,6 @@ void QListWidget::setItemWidget(QListWidgetItem *item, QWidget *widget)
|
|||
QAbstractItemView::setIndexWidget(index, widget);
|
||||
}
|
||||
|
||||
#if QT_DEPRECATED_SINCE(5, 13)
|
||||
/*!
|
||||
Returns \c true if \a item is selected; otherwise returns \c false.
|
||||
|
||||
\obsolete
|
||||
|
||||
This function is deprecated. Use QListWidgetItem::isSelected() instead.
|
||||
*/
|
||||
bool QListWidget::isItemSelected(const QListWidgetItem *item) const
|
||||
{
|
||||
return ((item && item->listWidget() == this) ? item->isSelected() : false);
|
||||
}
|
||||
|
||||
/*!
|
||||
Selects or deselects the given \a item depending on whether \a select is
|
||||
true of false.
|
||||
|
||||
\obsolete
|
||||
|
||||
This function is deprecated. Use QListWidgetItem::setSelected() instead.
|
||||
*/
|
||||
void QListWidget::setItemSelected(const QListWidgetItem *item, bool select)
|
||||
{
|
||||
if (item && item->listWidget() == this)
|
||||
const_cast<QListWidgetItem*>(item)->setSelected(select);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*!
|
||||
Returns a list of all selected items in the list widget.
|
||||
*/
|
||||
|
|
@ -1853,32 +1787,6 @@ QList<QListWidgetItem*> QListWidget::findItems(const QString &text, Qt::MatchFla
|
|||
return items;
|
||||
}
|
||||
|
||||
#if QT_DEPRECATED_SINCE(5, 13)
|
||||
/*!
|
||||
Returns \c true if the \a item is explicitly hidden; otherwise returns \c false.
|
||||
|
||||
\obsolete
|
||||
|
||||
This function is deprecated. Use QListWidgetItem::isHidden() instead.
|
||||
*/
|
||||
bool QListWidget::isItemHidden(const QListWidgetItem *item) const
|
||||
{
|
||||
return isRowHidden(row(item));
|
||||
}
|
||||
|
||||
/*!
|
||||
If \a hide is true, the \a item will be hidden; otherwise it will be shown.
|
||||
|
||||
\obsolete
|
||||
|
||||
This function is deprecated. Use QListWidgetItem::setHidden() instead.
|
||||
*/
|
||||
void QListWidget::setItemHidden(const QListWidgetItem *item, bool hide)
|
||||
{
|
||||
setRowHidden(row(item), hide);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*!
|
||||
Scrolls the view if necessary to ensure that the \a item is visible.
|
||||
|
||||
|
|
@ -1923,11 +1831,7 @@ QStringList QListWidget::mimeTypes() const
|
|||
If the list of items is empty, \nullptr is returned instead of a
|
||||
serialized empty list.
|
||||
*/
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
|
||||
QMimeData *QListWidget::mimeData(const QList<QListWidgetItem *> &items) const
|
||||
#else
|
||||
QMimeData *QListWidget::mimeData(const QList<QListWidgetItem*> items) const
|
||||
#endif
|
||||
{
|
||||
Q_D(const QListWidget);
|
||||
|
||||
|
|
@ -2050,18 +1954,6 @@ QModelIndex QListWidget::indexFromItem(const QListWidgetItem *item) const
|
|||
return d->listModel()->index(item);
|
||||
}
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
/*!
|
||||
\internal
|
||||
\obsolete
|
||||
\overload
|
||||
*/
|
||||
QModelIndex QListWidget::indexFromItem(QListWidgetItem *item) const
|
||||
{
|
||||
return indexFromItem(const_cast<const QListWidgetItem *>(item));
|
||||
}
|
||||
#endif
|
||||
|
||||
/*!
|
||||
Returns a pointer to the QListWidgetItem associated with the given \a index.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -114,30 +114,11 @@ public:
|
|||
inline void setTextAlignment(int alignment)
|
||||
{ setData(Qt::TextAlignmentRole, alignment); }
|
||||
|
||||
#if QT_DEPRECATED_SINCE(5, 13)
|
||||
QT_DEPRECATED_X ("Use QListWidgetItem::background() instead")
|
||||
inline QColor backgroundColor() const
|
||||
{ return qvariant_cast<QColor>(data(Qt::BackgroundRole)); }
|
||||
#endif
|
||||
// no QT_DEPRECATED_SINCE because it is a virtual function
|
||||
QT_DEPRECATED_X ("Use QListWidgetItem::setBackground() instead")
|
||||
virtual void setBackgroundColor(const QColor &color)
|
||||
{ setData(Qt::BackgroundRole, color); }
|
||||
|
||||
inline QBrush background() const
|
||||
{ return qvariant_cast<QBrush>(data(Qt::BackgroundRole)); }
|
||||
inline void setBackground(const QBrush &brush)
|
||||
{ setData(Qt::BackgroundRole, brush.style() != Qt::NoBrush ? QVariant(brush) : QVariant()); }
|
||||
|
||||
#if QT_DEPRECATED_SINCE(5, 13)
|
||||
QT_DEPRECATED_X ("Use QListWidgetItem::foreground() instead")
|
||||
inline QColor textColor() const
|
||||
{ return qvariant_cast<QColor>(data(Qt::ForegroundRole)); }
|
||||
QT_DEPRECATED_X ("Use QListWidgetItem::setForeground() instead")
|
||||
inline void setTextColor(const QColor &color)
|
||||
{ setData(Qt::ForegroundRole, color); }
|
||||
#endif
|
||||
|
||||
inline QBrush foreground() const
|
||||
{ return qvariant_cast<QBrush>(data(Qt::ForegroundRole)); }
|
||||
inline void setForeground(const QBrush &brush)
|
||||
|
|
@ -256,24 +237,15 @@ public:
|
|||
void setItemWidget(QListWidgetItem *item, QWidget *widget);
|
||||
inline void removeItemWidget(QListWidgetItem *item);
|
||||
|
||||
#if QT_DEPRECATED_SINCE(5, 13)
|
||||
QT_DEPRECATED_X ("Use QListWidgetItem::isSelected() instead")
|
||||
bool isItemSelected(const QListWidgetItem *item) const;
|
||||
QT_DEPRECATED_X ("Use QListWidgetItem::setSelected() instead")
|
||||
void setItemSelected(const QListWidgetItem *item, bool select);
|
||||
#endif
|
||||
QList<QListWidgetItem*> selectedItems() const;
|
||||
QList<QListWidgetItem*> findItems(const QString &text, Qt::MatchFlags flags) const;
|
||||
|
||||
#if QT_DEPRECATED_SINCE(5, 13)
|
||||
QT_DEPRECATED_X ("Use QListWidgetItem::isHidden() instead")
|
||||
bool isItemHidden(const QListWidgetItem *item) const;
|
||||
QT_DEPRECATED_X ("Use QListWidgetItem::setHidden() instead")
|
||||
void setItemHidden(const QListWidgetItem *item, bool hide);
|
||||
#endif
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
QList<QListWidgetItem*> items(const QMimeData *data) const;
|
||||
|
||||
QModelIndex indexFromItem(const QListWidgetItem *item) const;
|
||||
QListWidgetItem *itemFromIndex(const QModelIndex &index) const;
|
||||
|
||||
protected:
|
||||
#endif
|
||||
#if QT_CONFIG(draganddrop)
|
||||
void dropEvent(QDropEvent *event) override;
|
||||
#endif
|
||||
|
|
@ -299,29 +271,12 @@ Q_SIGNALS:
|
|||
protected:
|
||||
bool event(QEvent *e) override;
|
||||
virtual QStringList mimeTypes() const;
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
|
||||
virtual QMimeData *mimeData(const QList<QListWidgetItem *> &items) const;
|
||||
#else
|
||||
virtual QMimeData *mimeData(const QList<QListWidgetItem*> items) const;
|
||||
#endif
|
||||
#if QT_CONFIG(draganddrop)
|
||||
virtual bool dropMimeData(int index, const QMimeData *data, Qt::DropAction action);
|
||||
virtual Qt::DropActions supportedDropActions() const;
|
||||
#endif
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
public:
|
||||
#else
|
||||
protected:
|
||||
#endif
|
||||
QList<QListWidgetItem*> items(const QMimeData *data) const;
|
||||
|
||||
QModelIndex indexFromItem(const QListWidgetItem *item) const;
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
QModelIndex indexFromItem(QListWidgetItem *item) const; // ### Qt 6: remove
|
||||
#endif
|
||||
QListWidgetItem *itemFromIndex(const QModelIndex &index) const;
|
||||
|
||||
private:
|
||||
void setModel(QAbstractItemModel *model) override;
|
||||
Qt::SortOrder sortOrder() const;
|
||||
|
|
|
|||
|
|
@ -3219,22 +3219,6 @@ void QTableView::resizeColumnsToContents()
|
|||
d->horizontalHeader->resizeSections(QHeaderView::ResizeToContents);
|
||||
}
|
||||
|
||||
#if QT_DEPRECATED_SINCE(5, 13)
|
||||
/*!
|
||||
\obsolete
|
||||
\overload
|
||||
|
||||
This function is deprecated. Use
|
||||
sortByColumn(int column, Qt::SortOrder order) instead.
|
||||
Sorts the model by the values in the given \a column.
|
||||
*/
|
||||
void QTableView::sortByColumn(int column)
|
||||
{
|
||||
Q_D(QTableView);
|
||||
sortByColumn(column, d->horizontalHeader->sortIndicatorOrder());
|
||||
}
|
||||
#endif
|
||||
|
||||
/*!
|
||||
\since 4.2
|
||||
|
||||
|
|
|
|||
|
|
@ -130,10 +130,6 @@ public Q_SLOTS:
|
|||
void resizeRowsToContents();
|
||||
void resizeColumnToContents(int column);
|
||||
void resizeColumnsToContents();
|
||||
#if QT_DEPRECATED_SINCE(5, 13)
|
||||
QT_DEPRECATED_X ("Use QTableView::sortByColumn(int column, Qt::SortOrder order) instead")
|
||||
void sortByColumn(int column);
|
||||
#endif
|
||||
void sortByColumn(int column, Qt::SortOrder order);
|
||||
void setShowGrid(bool show);
|
||||
|
||||
|
|
|
|||
|
|
@ -1249,22 +1249,6 @@ void QTableWidgetItem::setFlags(Qt::ItemFlags aflags)
|
|||
\sa font(), setText(), setForeground()
|
||||
*/
|
||||
|
||||
#if QT_DEPRECATED_SINCE(5, 13)
|
||||
/*!
|
||||
\fn QColor QTableWidgetItem::backgroundColor() const
|
||||
\obsolete
|
||||
|
||||
This function is deprecated. Use background() instead.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void QTableWidgetItem::setBackgroundColor(const QColor &color)
|
||||
\obsolete
|
||||
|
||||
This function is deprecated. Use setBackground() instead.
|
||||
*/
|
||||
#endif
|
||||
|
||||
/*!
|
||||
\fn QBrush QTableWidgetItem::background() const
|
||||
\since 4.2
|
||||
|
|
@ -1285,22 +1269,6 @@ void QTableWidgetItem::setFlags(Qt::ItemFlags aflags)
|
|||
\sa setForeground()
|
||||
*/
|
||||
|
||||
#if QT_DEPRECATED_SINCE(5, 13)
|
||||
/*!
|
||||
\fn QColor QTableWidgetItem::textColor() const
|
||||
\obsolete
|
||||
|
||||
This function is deprecated. Use foreground() instead.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void QTableWidgetItem::setTextColor(const QColor &color)
|
||||
\obsolete
|
||||
|
||||
This function is deprecated. Use setForeground() instead.
|
||||
*/
|
||||
#endif
|
||||
|
||||
/*!
|
||||
\fn QBrush QTableWidgetItem::foreground() const
|
||||
\since 4.2
|
||||
|
|
@ -2358,34 +2326,6 @@ void QTableWidget::setCellWidget(int row, int column, QWidget *widget)
|
|||
QAbstractItemView::setIndexWidget(index, widget);
|
||||
}
|
||||
|
||||
#if QT_DEPRECATED_SINCE(5, 13)
|
||||
/*!
|
||||
Returns \c true if the \a item is selected, otherwise returns \c false.
|
||||
|
||||
\obsolete
|
||||
|
||||
This function is deprecated. Use \l{QTableWidgetItem::isSelected()} instead.
|
||||
*/
|
||||
|
||||
bool QTableWidget::isItemSelected(const QTableWidgetItem *item) const
|
||||
{
|
||||
return ((item && item->tableWidget() == this) ? item->isSelected() : false);
|
||||
}
|
||||
|
||||
/*!
|
||||
Selects or deselects \a item depending on \a select.
|
||||
|
||||
\obsolete
|
||||
|
||||
This function is deprecated. Use \l{QTableWidgetItem::setSelected()} instead.
|
||||
*/
|
||||
void QTableWidget::setItemSelected(const QTableWidgetItem *item, bool select)
|
||||
{
|
||||
if (item && item->tableWidget() == this)
|
||||
const_cast<QTableWidgetItem*>(item)->setSelected(select);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*!
|
||||
Selects or deselects the \a range depending on \a select.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -134,29 +134,11 @@ public:
|
|||
inline void setTextAlignment(int alignment)
|
||||
{ setData(Qt::TextAlignmentRole, alignment); }
|
||||
|
||||
#if QT_DEPRECATED_SINCE(5, 13)
|
||||
QT_DEPRECATED_X ("Use QTableWidgetItem::background() instead")
|
||||
inline QColor backgroundColor() const
|
||||
{ return qvariant_cast<QColor>(data(Qt::BackgroundRole)); }
|
||||
QT_DEPRECATED_X ("Use QTableWidgetItem::setBackground() instead")
|
||||
inline void setBackgroundColor(const QColor &color)
|
||||
{ setData(Qt::BackgroundRole, color); }
|
||||
#endif
|
||||
|
||||
inline QBrush background() const
|
||||
{ return qvariant_cast<QBrush>(data(Qt::BackgroundRole)); }
|
||||
inline void setBackground(const QBrush &brush)
|
||||
{ setData(Qt::BackgroundRole, brush.style() != Qt::NoBrush ? QVariant(brush) : QVariant()); }
|
||||
|
||||
#if QT_DEPRECATED_SINCE(5, 13)
|
||||
QT_DEPRECATED_X ("Use QTableWidgetItem::foreground() instead")
|
||||
inline QColor textColor() const
|
||||
{ return qvariant_cast<QColor>(data(Qt::ForegroundRole)); }
|
||||
QT_DEPRECATED_X ("Use QTableWidgetItem::setForeground() instead")
|
||||
inline void setTextColor(const QColor &color)
|
||||
{ setData(Qt::ForegroundRole, color); }
|
||||
#endif
|
||||
|
||||
inline QBrush foreground() const
|
||||
{ return qvariant_cast<QBrush>(data(Qt::ForegroundRole)); }
|
||||
inline void setForeground(const QBrush &brush)
|
||||
|
|
@ -282,12 +264,6 @@ public:
|
|||
void setCellWidget(int row, int column, QWidget *widget);
|
||||
inline void removeCellWidget(int row, int column);
|
||||
|
||||
#if QT_DEPRECATED_SINCE(5, 13)
|
||||
QT_DEPRECATED_X ("Use QTableWidgetItem::isSelected() instead")
|
||||
bool isItemSelected(const QTableWidgetItem *item) const;
|
||||
QT_DEPRECATED_X ("Use QTableWidgetItem::setSelected() instead")
|
||||
void setItemSelected(const QTableWidgetItem *item, bool select);
|
||||
#endif
|
||||
void setRangeSelected(const QTableWidgetSelectionRange &range, bool select);
|
||||
|
||||
QList<QTableWidgetSelectionRange> selectedRanges() const;
|
||||
|
|
|
|||
|
|
@ -2594,22 +2594,6 @@ void QTreeView::resizeColumnToContents(int column)
|
|||
d->header->resizeSection(column, qMax(contents, header));
|
||||
}
|
||||
|
||||
#if QT_DEPRECATED_SINCE(5, 13)
|
||||
/*!
|
||||
\obsolete
|
||||
\overload
|
||||
|
||||
This function is deprecated. Use
|
||||
sortByColumn(int column, Qt::SortOrder order) instead.
|
||||
Sorts the model by the values in the given \a column.
|
||||
*/
|
||||
void QTreeView::sortByColumn(int column)
|
||||
{
|
||||
Q_D(QTreeView);
|
||||
sortByColumn(column, d->header->sortIndicatorOrder());
|
||||
}
|
||||
#endif
|
||||
|
||||
/*!
|
||||
\since 4.2
|
||||
|
||||
|
|
|
|||
|
|
@ -157,10 +157,6 @@ public Q_SLOTS:
|
|||
void expand(const QModelIndex &index);
|
||||
void collapse(const QModelIndex &index);
|
||||
void resizeColumnToContents(int column);
|
||||
#if QT_DEPRECATED_SINCE(5, 13)
|
||||
QT_DEPRECATED_X ("Use QTreeView::sortByColumn(int column, Qt::SortOrder order) instead")
|
||||
void sortByColumn(int column);
|
||||
#endif
|
||||
void sortByColumn(int column, Qt::SortOrder order);
|
||||
void expandAll();
|
||||
void expandRecursively(const QModelIndex &index, int depth = -1);
|
||||
|
|
|
|||
|
|
@ -1256,22 +1256,6 @@ bool QTreeWidgetItem::isFirstColumnSpanned() const
|
|||
\sa font(), setText(), setForeground()
|
||||
*/
|
||||
|
||||
#if QT_DEPRECATED_SINCE(5, 13)
|
||||
/*!
|
||||
\fn QColor QTreeWidgetItem::backgroundColor(int column) const
|
||||
\obsolete
|
||||
|
||||
This function is deprecated. Use background() instead.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void QTreeWidgetItem::setBackgroundColor(int column, const QColor &color)
|
||||
\obsolete
|
||||
|
||||
This function is deprecated. Use setBackground() instead.
|
||||
*/
|
||||
#endif
|
||||
|
||||
/*!
|
||||
\fn QBrush QTreeWidgetItem::background(int column) const
|
||||
\since 4.2
|
||||
|
|
@ -1296,21 +1280,6 @@ bool QTreeWidgetItem::isFirstColumnSpanned() const
|
|||
\sa setForeground()
|
||||
*/
|
||||
|
||||
#if QT_DEPRECATED_SINCE(5, 13)
|
||||
/*!
|
||||
\fn QColor QTreeWidgetItem::textColor(int column) const
|
||||
\obsolete
|
||||
|
||||
This function is deprecated. Use foreground() instead.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void QTreeWidgetItem::setTextColor(int column, const QColor &color)
|
||||
\obsolete
|
||||
|
||||
This function is deprecated. Use setForeground() instead.
|
||||
*/
|
||||
#endif
|
||||
|
||||
/*!
|
||||
\fn QBrush QTreeWidgetItem::foreground(int column) const
|
||||
|
|
@ -3134,38 +3103,6 @@ void QTreeWidget::setItemWidget(QTreeWidgetItem *item, int column, QWidget *widg
|
|||
QAbstractItemView::setIndexWidget(d->index(item, column), widget);
|
||||
}
|
||||
|
||||
#if QT_DEPRECATED_SINCE(5, 13)
|
||||
/*!
|
||||
Returns \c true if the \a item is selected; otherwise returns \c false.
|
||||
|
||||
\sa itemSelectionChanged()
|
||||
|
||||
\obsolete
|
||||
|
||||
This function is deprecated. Use \l{QTreeWidgetItem::isSelected()} instead.
|
||||
*/
|
||||
bool QTreeWidget::isItemSelected(const QTreeWidgetItem *item) const
|
||||
{
|
||||
return ((item && item->treeWidget() == this) ? item->isSelected() : false);
|
||||
}
|
||||
|
||||
/*!
|
||||
If \a select is true, the given \a item is selected; otherwise it is
|
||||
deselected.
|
||||
|
||||
\sa itemSelectionChanged()
|
||||
|
||||
\obsolete
|
||||
|
||||
This function is deprecated. Use \l{QTreeWidgetItem::setSelected()} instead.
|
||||
*/
|
||||
void QTreeWidget::setItemSelected(const QTreeWidgetItem *item, bool select)
|
||||
{
|
||||
if (item && item->treeWidget() == this)
|
||||
const_cast<QTreeWidgetItem*>(item)->setSelected(select);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*!
|
||||
Returns a list of all selected non-hidden items.
|
||||
|
||||
|
|
@ -3204,99 +3141,6 @@ QList<QTreeWidgetItem*> QTreeWidget::findItems(const QString &text, Qt::MatchFla
|
|||
return items;
|
||||
}
|
||||
|
||||
#if QT_DEPRECATED_SINCE(5, 13)
|
||||
/*!
|
||||
Returns \c true if the \a item is explicitly hidden, otherwise returns \c false.
|
||||
|
||||
\obsolete
|
||||
|
||||
This function is deprecated. Use \l{QTreeWidgetItem::isHidden()} instead.
|
||||
*/
|
||||
bool QTreeWidget::isItemHidden(const QTreeWidgetItem *item) const
|
||||
{
|
||||
return ((item && item->treeWidget() == this) ? item->isHidden() : false);
|
||||
}
|
||||
|
||||
/*!
|
||||
Hides the given \a item if \a hide is true; otherwise shows the item.
|
||||
|
||||
\sa itemChanged()
|
||||
|
||||
\obsolete
|
||||
|
||||
This function is deprecated. Use \l{QTreeWidgetItem::setHidden()} instead.
|
||||
*/
|
||||
void QTreeWidget::setItemHidden(const QTreeWidgetItem *item, bool hide)
|
||||
{
|
||||
if (item && item->treeWidget() == this)
|
||||
const_cast<QTreeWidgetItem*>(item)->setHidden(hide);
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns \c true if the given \a item is open; otherwise returns \c false.
|
||||
|
||||
\sa itemExpanded()
|
||||
|
||||
\obsolete
|
||||
|
||||
This function is deprecated. Use \l{QTreeWidgetItem::isExpanded()} instead.
|
||||
*/
|
||||
bool QTreeWidget::isItemExpanded(const QTreeWidgetItem *item) const
|
||||
{
|
||||
return ((item && item->treeWidget() == this) ? item->isExpanded() : false);
|
||||
}
|
||||
|
||||
/*!
|
||||
Sets the item referred to by \a item to either closed or opened,
|
||||
depending on the value of \a expand.
|
||||
|
||||
\sa expandItem(), collapseItem(), itemExpanded()
|
||||
|
||||
\obsolete
|
||||
|
||||
This function is deprecated. Use \l{QTreeWidgetItem::setExpanded()} instead.
|
||||
*/
|
||||
void QTreeWidget::setItemExpanded(const QTreeWidgetItem *item, bool expand)
|
||||
{
|
||||
if (item && item->treeWidget() == this)
|
||||
const_cast<QTreeWidgetItem*>(item)->setExpanded(expand);
|
||||
}
|
||||
|
||||
/*!
|
||||
\since 4.3
|
||||
|
||||
Returns \c true if the given \a item is set to show only one section over all columns;
|
||||
otherwise returns \c false.
|
||||
|
||||
\sa setFirstItemColumnSpanned()
|
||||
|
||||
\obsolete
|
||||
|
||||
This function is deprecated. Use \l{QTreeWidgetItem::isFirstColumnSpanned()} instead.
|
||||
*/
|
||||
bool QTreeWidget::isFirstItemColumnSpanned(const QTreeWidgetItem *item) const
|
||||
{
|
||||
return ((item && item->treeWidget() == this) ? item->isFirstColumnSpanned() : false);
|
||||
}
|
||||
|
||||
/*!
|
||||
\since 4.3
|
||||
|
||||
Sets the given \a item to only show one section for all columns if \a span is true;
|
||||
otherwise the item will show one section per column.
|
||||
|
||||
\sa isFirstItemColumnSpanned()
|
||||
|
||||
\obsolete
|
||||
|
||||
This function is deprecated. Use \l{QTreeWidgetItem::setFirstColumnSpanned()} instead.
|
||||
*/
|
||||
void QTreeWidget::setFirstItemColumnSpanned(const QTreeWidgetItem *item, bool span)
|
||||
{
|
||||
if (item && item->treeWidget() == this)
|
||||
const_cast<QTreeWidgetItem*>(item)->setFirstColumnSpanned(span);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*!
|
||||
\since 4.3
|
||||
|
|
|
|||
|
|
@ -134,29 +134,11 @@ public:
|
|||
inline void setTextAlignment(int column, int alignment)
|
||||
{ setData(column, Qt::TextAlignmentRole, alignment); }
|
||||
|
||||
#if QT_DEPRECATED_SINCE(5, 13)
|
||||
QT_DEPRECATED_X ("Use QTreeWidgetItem::background() instead")
|
||||
inline QColor backgroundColor(int column) const
|
||||
{ return qvariant_cast<QColor>(data(column, Qt::BackgroundRole)); }
|
||||
QT_DEPRECATED_X ("Use QTreeWidgetItem::setBackground() instead")
|
||||
inline void setBackgroundColor(int column, const QColor &color)
|
||||
{ setData(column, Qt::BackgroundRole, color); }
|
||||
#endif
|
||||
|
||||
inline QBrush background(int column) const
|
||||
{ return qvariant_cast<QBrush>(data(column, Qt::BackgroundRole)); }
|
||||
inline void setBackground(int column, const QBrush &brush)
|
||||
{ setData(column, Qt::BackgroundRole, brush.style() != Qt::NoBrush ? QVariant(brush) : QVariant()); }
|
||||
|
||||
#if QT_DEPRECATED_SINCE(5, 13)
|
||||
QT_DEPRECATED_X ("Use QTreeWidgetItem::foreground() instead")
|
||||
inline QColor textColor(int column) const
|
||||
{ return qvariant_cast<QColor>(data(column, Qt::ForegroundRole)); }
|
||||
QT_DEPRECATED_X ("Use QTreeWidgetItem::setForeground() instead")
|
||||
inline void setTextColor(int column, const QColor &color)
|
||||
{ setData(column, Qt::ForegroundRole, color); }
|
||||
#endif
|
||||
|
||||
inline QBrush foreground(int column) const
|
||||
{ return qvariant_cast<QBrush>(data(column, Qt::ForegroundRole)); }
|
||||
inline void setForeground(int column, const QBrush &brush)
|
||||
|
|
@ -315,33 +297,10 @@ public:
|
|||
void setItemWidget(QTreeWidgetItem *item, int column, QWidget *widget);
|
||||
inline void removeItemWidget(QTreeWidgetItem *item, int column);
|
||||
|
||||
#if QT_DEPRECATED_SINCE(5, 13)
|
||||
QT_DEPRECATED_X ("Use QTreeWidgetItem::isSelected() instead")
|
||||
bool isItemSelected(const QTreeWidgetItem *item) const;
|
||||
QT_DEPRECATED_X ("Use QTreeWidgetItem::setSelected() instead")
|
||||
void setItemSelected(const QTreeWidgetItem *item, bool select);
|
||||
#endif
|
||||
QList<QTreeWidgetItem*> selectedItems() const;
|
||||
QList<QTreeWidgetItem*> findItems(const QString &text, Qt::MatchFlags flags,
|
||||
int column = 0) const;
|
||||
|
||||
#if QT_DEPRECATED_SINCE(5, 13)
|
||||
QT_DEPRECATED_X ("Use QTreeWidgetItem::isHidden() instead")
|
||||
bool isItemHidden(const QTreeWidgetItem *item) const;
|
||||
QT_DEPRECATED_X ("Use QTreeWidgetItem::setHidden() instead")
|
||||
void setItemHidden(const QTreeWidgetItem *item, bool hide);
|
||||
|
||||
QT_DEPRECATED_X ("Use QTreeWidgetItem::isExpanded() instead")
|
||||
bool isItemExpanded(const QTreeWidgetItem *item) const;
|
||||
QT_DEPRECATED_X ("Use QTreeWidgetItem::setExpanded() instead")
|
||||
void setItemExpanded(const QTreeWidgetItem *item, bool expand);
|
||||
|
||||
QT_DEPRECATED_X ("Use QTreeWidgetItem::isFirstColumnSpanned() instead")
|
||||
bool isFirstItemColumnSpanned(const QTreeWidgetItem *item) const;
|
||||
QT_DEPRECATED_X ("Use QTreeWidgetItem::setFirstColumnSpanned() instead")
|
||||
void setFirstItemColumnSpanned(const QTreeWidgetItem *item, bool span);
|
||||
#endif
|
||||
|
||||
QTreeWidgetItem *itemAbove(const QTreeWidgetItem *item) const;
|
||||
QTreeWidgetItem *itemBelow(const QTreeWidgetItem *item) const;
|
||||
|
||||
|
|
|
|||
|
|
@ -407,15 +407,6 @@ void tst_QListWidget::closePersistentEditor()
|
|||
|
||||
void tst_QListWidget::setItemHidden()
|
||||
{
|
||||
#if QT_DEPRECATED_SINCE(5, 13)
|
||||
QT_WARNING_PUSH
|
||||
QT_WARNING_DISABLE_DEPRECATED
|
||||
// Boundary checking
|
||||
testWidget->setItemHidden(nullptr, true);
|
||||
testWidget->setItemHidden(nullptr, false);
|
||||
QT_WARNING_POP
|
||||
#endif
|
||||
|
||||
auto countHidden = [](QListWidget *testWidget)
|
||||
{
|
||||
int totalHidden = 0;
|
||||
|
|
|
|||
|
|
@ -866,15 +866,6 @@ void tst_QTreeWidget::selectedItems()
|
|||
}
|
||||
}
|
||||
|
||||
#if QT_DEPRECATED_SINCE(5, 13)
|
||||
QT_WARNING_PUSH
|
||||
QT_WARNING_DISABLE_DEPRECATED
|
||||
// Possible to select null without crashing?
|
||||
testWidget->setItemSelected(nullptr, true);
|
||||
QVERIFY(!testWidget->isItemSelected(nullptr));
|
||||
QT_WARNING_POP
|
||||
#endif
|
||||
|
||||
// unselect
|
||||
for (const auto &itemPath : selectedItems) {
|
||||
QTreeWidgetItem *item = nullptr;
|
||||
|
|
|
|||
Loading…
Reference in New Issue