summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets
diff options
context:
space:
mode:
authorThorbjørn Lund Martsum <tmartsum@gmail.com>2012-02-06 09:24:50 +0100
committerQt by Nokia <qt-info@nokia.com>2012-02-18 18:40:15 +0100
commit466107107a85e7211c4b7f77b36ec50625657061 (patch)
tree9eb0d64ac6a2ba4e2f0a110322c19cfc879cd047 /src/widgets/widgets
parent908a080006faff333b061b69b0dc0fd9cab36114 (diff)
Adding hasHeightForWidth as a virtual Widget funcion
Just implements what the note states (and removes the private function) Change-Id: I9a6fd5134460712accf09ba01691df8b9b1f5d0d Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
Diffstat (limited to 'src/widgets/widgets')
-rw-r--r--src/widgets/widgets/qsizegrip.cpp8
-rw-r--r--src/widgets/widgets/qtabwidget.cpp14
-rw-r--r--src/widgets/widgets/qtabwidget.h1
3 files changed, 14 insertions, 9 deletions
diff --git a/src/widgets/widgets/qsizegrip.cpp b/src/widgets/widgets/qsizegrip.cpp
index 145bdf02d4..09557a3c90 100644
--- a/src/widgets/widgets/qsizegrip.cpp
+++ b/src/widgets/widgets/qsizegrip.cpp
@@ -301,7 +301,7 @@ void QSizeGrip::mousePressEvent(QMouseEvent * e)
// Use a native X11 sizegrip for "real" top-level windows if supported.
if (tlw->isWindow() && X11->isSupportedByWM(ATOM(_NET_WM_MOVERESIZE))
&& !(tlw->windowFlags() & Qt::X11BypassWindowManagerHint)
- && !tlw->testAttribute(Qt::WA_DontShowOnScreen) && !qt_widget_private(tlw)->hasHeightForWidth()) {
+ && !tlw->testAttribute(Qt::WA_DontShowOnScreen) && !tlw->hasHeightForWidth()) {
XEvent xev;
xev.xclient.type = ClientMessage;
xev.xclient.message_type = ATOM(_NET_WM_MOVERESIZE);
@@ -323,7 +323,7 @@ void QSizeGrip::mousePressEvent(QMouseEvent * e)
}
#endif // Q_WS_X11
#ifdef Q_OS_WIN
- if (tlw->isWindow() && !tlw->testAttribute(Qt::WA_DontShowOnScreen) && !qt_widget_private(tlw)->hasHeightForWidth()) {
+ if (tlw->isWindow() && !tlw->testAttribute(Qt::WA_DontShowOnScreen) && !tlw->hasHeightForWidth()) {
uint orientation = 0;
if (d->atBottom())
orientation = d->atLeft() ? SZ_SIZEBOTTOMLEFT : SZ_SIZEBOTTOMRIGHT;
@@ -413,11 +413,11 @@ void QSizeGrip::mouseMoveEvent(QMouseEvent * e)
#ifdef Q_WS_X11
if (tlw->isWindow() && X11->isSupportedByWM(ATOM(_NET_WM_MOVERESIZE))
&& tlw->isTopLevel() && !(tlw->windowFlags() & Qt::X11BypassWindowManagerHint)
- && !tlw->testAttribute(Qt::WA_DontShowOnScreen) && !qt_widget_private(tlw)->hasHeightForWidth())
+ && !tlw->testAttribute(Qt::WA_DontShowOnScreen) && !tlw->hasHeightForWidth())
return;
#endif
#ifdef Q_OS_WIN
- if (tlw->isWindow() && qt_getWindowsSystemMenu(tlw) && !tlw->testAttribute(Qt::WA_DontShowOnScreen) && !qt_widget_private(tlw)->hasHeightForWidth()) {
+ if (tlw->isWindow() && qt_getWindowsSystemMenu(tlw) && !tlw->testAttribute(Qt::WA_DontShowOnScreen) && !tlw->hasHeightForWidth()) {
if (const HWND hwnd = QApplicationPrivate::getHWNDForWidget(tlw)) {
MSG msg;
while (PeekMessage(&msg, hwnd, WM_MOUSEMOVE, WM_MOUSEMOVE, PM_REMOVE)) ;
diff --git a/src/widgets/widgets/qtabwidget.cpp b/src/widgets/widgets/qtabwidget.cpp
index 66d31e72c7..612d51826c 100644
--- a/src/widgets/widgets/qtabwidget.cpp
+++ b/src/widgets/widgets/qtabwidget.cpp
@@ -186,7 +186,6 @@ public:
void _q_removeTab(int);
void _q_tabMoved(int from, int to);
void init();
- bool hasHeightForWidth() const;
QTabBar *tabs;
QStackedWidget *stack;
@@ -238,11 +237,16 @@ void QTabWidgetPrivate::init()
}
-bool QTabWidgetPrivate::hasHeightForWidth() const
+/*!
+ \reimp
+*/
+
+bool QTabWidget::hasHeightForWidth() const
{
- bool has = size_policy.hasHeightForWidth();
- if (!has && stack)
- has = qt_widget_private(stack)->hasHeightForWidth();
+ Q_D(const QTabWidget);
+ bool has = d->size_policy.hasHeightForWidth();
+ if (!has && d->stack)
+ has = d->stack->hasHeightForWidth();
return has;
}
diff --git a/src/widgets/widgets/qtabwidget.h b/src/widgets/widgets/qtabwidget.h
index 1865ddf897..26d9243eb9 100644
--- a/src/widgets/widgets/qtabwidget.h
+++ b/src/widgets/widgets/qtabwidget.h
@@ -125,6 +125,7 @@ public:
QSize sizeHint() const;
QSize minimumSizeHint() const;
int heightForWidth(int width) const;
+ bool hasHeightForWidth() const;
void setCornerWidget(QWidget * w, Qt::Corner corner = Qt::TopRightCorner);
QWidget * cornerWidget(Qt::Corner corner = Qt::TopRightCorner) const;