diff options
author | Keith Isdale <keith.isdale@nokia.com> | 2009-08-10 07:36:49 (GMT) |
---|---|---|
committer | Keith Isdale <keith.isdale@nokia.com> | 2009-08-10 07:36:49 (GMT) |
commit | 4942e2834c1da00bfceec6430ce351888efc1976 (patch) | |
tree | 944be213e12faa16fb260f5dec4f97d5fcc7c5fc /tools/designer/src/components | |
parent | 6cc14b9bd84de30471db40f73b119ba33356a6ba (diff) | |
parent | 5d01d0cde28f2ac1ff9b5d8ca731edcf38725051 (diff) | |
download | Qt-4942e2834c1da00bfceec6430ce351888efc1976.zip Qt-4942e2834c1da00bfceec6430ce351888efc1976.tar.gz Qt-4942e2834c1da00bfceec6430ce351888efc1976.tar.bz2 |
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt
Diffstat (limited to 'tools/designer/src/components')
3 files changed, 10 insertions, 11 deletions
diff --git a/tools/designer/src/components/buddyeditor/buddyeditor.cpp b/tools/designer/src/components/buddyeditor/buddyeditor.cpp index 9984b0d..d5c8670 100644 --- a/tools/designer/src/components/buddyeditor/buddyeditor.cpp +++ b/tools/designer/src/components/buddyeditor/buddyeditor.cpp @@ -404,7 +404,7 @@ QWidget *BuddyEditor::findBuddy(QLabel *l, const QWidgetList &existingBuddies) c const QRect geom = l->geometry(); const int y = geom.center().y(); QWidget *neighbour = 0; - switch (QApplication::layoutDirection()) { + switch (l->layoutDirection()) { case Qt::LeftToRight: { // Walk right to find next managed neighbour const int xEnd = parent->size().width(); for (int x = geom.right() + 1; x < xEnd; x += DeltaX) diff --git a/tools/designer/src/components/formeditor/default_actionprovider.cpp b/tools/designer/src/components/formeditor/default_actionprovider.cpp index 42d1f81..41333f8 100644 --- a/tools/designer/src/components/formeditor/default_actionprovider.cpp +++ b/tools/designer/src/components/formeditor/default_actionprovider.cpp @@ -73,9 +73,8 @@ enum { indicatorSize = 2 }; // Position an indicator horizontally over the rectangle, indicating // 'Insert before' (left or right according to layout direction) -static inline QRect horizontalIndicatorRect(const QRect &rect) +static inline QRect horizontalIndicatorRect(const QRect &rect, Qt::LayoutDirection layoutDirection) { - const Qt::LayoutDirection layoutDirection = QApplication::layoutDirection(); // Position right? QRect rc = QRect(rect.x(), 0, indicatorSize, rect.height() - 1); if (layoutDirection == Qt::RightToLeft) @@ -91,13 +90,13 @@ static inline QRect verticalIndicatorRect(const QRect &rect) // Determine the geometry of the indicator by retrieving // the action under mouse and positioning the bar within its geometry. -QRect ActionProviderBase::indicatorGeometry(const QPoint &pos) const +QRect ActionProviderBase::indicatorGeometry(const QPoint &pos, Qt::LayoutDirection layoutDirection) const { QAction *action = actionAt(pos); if (!action) return QRect(); QRect rc = actionGeometry(action); - return orientation() == Qt::Horizontal ? horizontalIndicatorRect(rc) : verticalIndicatorRect(rc); + return orientation() == Qt::Horizontal ? horizontalIndicatorRect(rc, layoutDirection) : verticalIndicatorRect(rc); } // Adjust the indicator while dragging. (-1,1) is called to finish a DND operation @@ -107,7 +106,7 @@ void ActionProviderBase::adjustIndicator(const QPoint &pos) m_indicator->hide(); return; } - const QRect ig = indicatorGeometry(pos); + const QRect ig = indicatorGeometry(pos, m_indicator->layoutDirection()); if (ig.isValid()) { m_indicator->setGeometry(ig); QPalette p = m_indicator->palette(); @@ -145,9 +144,9 @@ Qt::Orientation QToolBarActionProvider::orientation() const return m_widget->orientation(); } -QRect QToolBarActionProvider::indicatorGeometry(const QPoint &pos) const +QRect QToolBarActionProvider::indicatorGeometry(const QPoint &pos, Qt::LayoutDirection layoutDirection) const { - const QRect actionRect = ActionProviderBase::indicatorGeometry(pos); + const QRect actionRect = ActionProviderBase::indicatorGeometry(pos, layoutDirection); if (actionRect.isValid()) return actionRect; // Toolbar differs in that is has no dummy placeholder to 'insert before' @@ -155,7 +154,7 @@ QRect QToolBarActionProvider::indicatorGeometry(const QPoint &pos) const const QRect freeArea = ToolBarEventFilter::freeArea(m_widget); if (!freeArea.contains(pos)) return QRect(); - return orientation() == Qt::Horizontal ? horizontalIndicatorRect(freeArea) : verticalIndicatorRect(freeArea); + return orientation() == Qt::Horizontal ? horizontalIndicatorRect(freeArea, layoutDirection) : verticalIndicatorRect(freeArea); } // ------------- QMenuBarActionProvider diff --git a/tools/designer/src/components/formeditor/default_actionprovider.h b/tools/designer/src/components/formeditor/default_actionprovider.h index 3660f11..270ea36 100644 --- a/tools/designer/src/components/formeditor/default_actionprovider.h +++ b/tools/designer/src/components/formeditor/default_actionprovider.h @@ -66,7 +66,7 @@ public: virtual Qt::Orientation orientation() const = 0; protected: - virtual QRect indicatorGeometry(const QPoint &pos) const; + virtual QRect indicatorGeometry(const QPoint &pos, Qt::LayoutDirection layoutDirection) const; private: QWidget *m_indicator; @@ -84,7 +84,7 @@ public: Qt::Orientation orientation() const; protected: - virtual QRect indicatorGeometry(const QPoint &pos) const; + virtual QRect indicatorGeometry(const QPoint &pos, Qt::LayoutDirection layoutDirection) const; private: QToolBar *m_widget; |