summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qwidget_p.h
diff options
context:
space:
mode:
authorJan-Arve Sæther <jan-arve.saether@nokia.com>2010-04-22 13:40:44 (GMT)
committerJan-Arve Sæther <jan-arve.saether@nokia.com>2010-04-22 13:40:44 (GMT)
commit4780f94e391b5e881497c5228661dead42c821fa (patch)
tree2e60b5f8a599e8c927cad3d218d0126262cfdbea /src/gui/kernel/qwidget_p.h
parent12eac6fa53680b5c7a6c898749a4ac0d3c427c18 (diff)
downloadQt-4780f94e391b5e881497c5228661dead42c821fa.zip
Qt-4780f94e391b5e881497c5228661dead42c821fa.tar.gz
Qt-4780f94e391b5e881497c5228661dead42c821fa.tar.bz2
Implement heightForWidth support for QTabWidget and QStackedWidget.
The problem was simply that QTabWidget does not have a layout (it does manual layouting, and since that the heightForWidth implementation it inherits from QWidget require that the widget has a layout it will not work and it always returned -1 for QTabWidget). The solution is then to reimplement heightForWidth(). Unfortunately the patch has several workarounds for BIC: 1. QWidget::hasHeightForWidth() should really have been virtual. Instead we add the virtual QWidgetPrivate::hasHeightForWidth(). Since this is a workaround/bugfix for QTabWidget we decided to keep QWidget::hasHeightForWidth() internal for now. 2. We cannot reimplement a virtual function in QStackedLayout. We therefore fix QStackedWidget by subclassing QStackedLayout and reimplement the virtual functions in the subclass. This is not an ideal fix, but improves QTabWidget and QStackedWidget wrt height for width. Task-number: QTBUG-7792 Reviewed-by: Paul Reviewed-by: Olivier
Diffstat (limited to 'src/gui/kernel/qwidget_p.h')
-rw-r--r--src/gui/kernel/qwidget_p.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/gui/kernel/qwidget_p.h b/src/gui/kernel/qwidget_p.h
index 89ea256..05a859c 100644
--- a/src/gui/kernel/qwidget_p.h
+++ b/src/gui/kernel/qwidget_p.h
@@ -493,6 +493,7 @@ public:
bool setMinimumSize_helper(int &minw, int &minh);
bool setMaximumSize_helper(int &maxw, int &maxh);
+ virtual bool hasHeightForWidth() const;
void setConstraints_sys();
QWidget *childAt_helper(const QPoint &, bool) const;
void updateGeometry_helper(bool forceUpdate);