From 24d60cb64d2d2d677612d8f517031b38c685ee7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Lund=20Martsum?= Date: Wed, 15 Jul 2020 09:24:20 +0200 Subject: Make initStyleOption virtual for various classes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Often a simple change in the styleoptions is needed in e.g a paintEvent, but it was impossible without copying the whole paint-function which is not always trivial and also wouldn't be kept up-to-date if it was changed in Qt. The initStyleOption is similar to viewOptions in QAbstractTableView and it is handy that this function is virtual. Furthermore QStyledItemDelegate::initStyleOption is already virtual. This change only makes initStyleOption virtual for public classes. [ChangeLog][QtWidgets] InitStyleOption has been made virtual in public Qt classes to make override of stylebehavior more simple. Change-Id: I38974c6d4dd0793ca5976ecf3aa28892215a1579 Task-number: QTBUG-77642 Reviewed-by: Richard Moe Gustavsen Reviewed-by: Thorbjørn Lund Martsum --- src/widgets/widgets/qcombobox.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/widgets/widgets/qcombobox.h') diff --git a/src/widgets/widgets/qcombobox.h b/src/widgets/widgets/qcombobox.h index 1e518fb2c0..75dbb1183d 100644 --- a/src/widgets/widgets/qcombobox.h +++ b/src/widgets/widgets/qcombobox.h @@ -230,7 +230,7 @@ protected: void contextMenuEvent(QContextMenuEvent *e) override; #endif // QT_NO_CONTEXTMENU void inputMethodEvent(QInputMethodEvent *) override; - void initStyleOption(QStyleOptionComboBox *option) const; + virtual void initStyleOption(QStyleOptionComboBox *option) const; protected: -- cgit v1.2.3