diff options
-rw-r--r-- | src/gui/widgets/qcombobox.cpp | 12 | ||||
-rw-r--r-- | src/gui/widgets/qplaintextedit.cpp | 5 | ||||
-rw-r--r-- | src/xmlpatterns/acceltree/qacceltree_p.h | 4 |
3 files changed, 17 insertions, 4 deletions
diff --git a/src/gui/widgets/qcombobox.cpp b/src/gui/widgets/qcombobox.cpp index 166a0d7..de36c2e 100644 --- a/src/gui/widgets/qcombobox.cpp +++ b/src/gui/widgets/qcombobox.cpp @@ -2418,7 +2418,16 @@ void QComboBox::showPopup() && !style->styleHint(QStyle::SH_ComboBox_Popup, &opt, this) && !window()->testAttribute(Qt::WA_DontShowOnScreen)) qScrollEffect(container, scrollDown ? QEffects::DownScroll : QEffects::UpScroll, 150); #endif + +// Don't disable updates on Mac OS X. Windows are displayed immediately on this platform, +// which means that the window will be visible before the call to container->show() returns. +// If updates are disabled at this point we'll miss our chance at painting the popup +// menu before it's shown, causing flicker since the window then displays the standard gray +// background. +#ifndef Q_WS_MAC container->setUpdatesEnabled(false); +#endif + container->raise(); container->show(); container->updateScrollers(); @@ -2429,7 +2438,10 @@ void QComboBox::showPopup() ? QAbstractItemView::PositionAtCenter : QAbstractItemView::EnsureVisible); +#ifndef Q_WS_MAC container->setUpdatesEnabled(updatesEnabled); +#endif + container->update(); } diff --git a/src/gui/widgets/qplaintextedit.cpp b/src/gui/widgets/qplaintextedit.cpp index 384889d..267de38 100644 --- a/src/gui/widgets/qplaintextedit.cpp +++ b/src/gui/widgets/qplaintextedit.cpp @@ -562,13 +562,14 @@ QRectF QPlainTextEditControl::blockBoundingRect(const QTextBlock &block) const { if (!block.isValid()) return QRectF(); QRectF r = documentLayout->blockBoundingRect(currentBlock); - while (currentBlockNumber < blockNumber && offset.y() <= 2* textEdit->viewport()->height()) { + int maxVerticalOffset = r.height(); + while (currentBlockNumber < blockNumber && offset.y() - maxVerticalOffset <= 2* textEdit->viewport()->height()) { offset.ry() += r.height(); currentBlock = currentBlock.next(); ++currentBlockNumber; r = documentLayout->blockBoundingRect(currentBlock); } - while (currentBlockNumber > blockNumber && offset.y() >= -textEdit->viewport()->height()) { + while (currentBlockNumber > blockNumber && offset.y() + maxVerticalOffset >= -textEdit->viewport()->height()) { currentBlock = currentBlock.previous(); if (!currentBlock.isValid()) break; diff --git a/src/xmlpatterns/acceltree/qacceltree_p.h b/src/xmlpatterns/acceltree/qacceltree_p.h index a033c15..d91fdf4 100644 --- a/src/xmlpatterns/acceltree/qacceltree_p.h +++ b/src/xmlpatterns/acceltree/qacceltree_p.h @@ -128,8 +128,8 @@ namespace QPatternist class BasicNodeData { public: + /* No need to initialize the members. See AccelTreeBuilder. */ inline BasicNodeData() - : m_parent(0), m_size(0), m_depth(0), m_kind(0) { } @@ -217,7 +217,7 @@ namespace QPatternist Depth m_depth; /** - * Technically it is sufficient with 8 bits. However, at least MSVC + * Technically it is sufficient with 7 bits. However, at least MSVC * 2005 miscompiles it such that QXmlNodeModelIndex::Text becomes * -64 instead of 64 with hilarious crashes as result. * |