summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/harfbuzz
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/harfbuzz')
0 files changed, 0 insertions, 0 deletions
pare(); + break; + } + } delete iToneUtil; } QS60Beep* QS60Beep::NewL(TInt aFrequency, TTimeIntervalMicroSeconds aDuration) { - QS60Beep* self=new (ELeave) QS60Beep(); + QS60Beep* self = new (ELeave) QS60Beep(); CleanupStack::PushL(self); self->ConstructL(aFrequency, aDuration); CleanupStack::Pop(); return self; -}; +} void QS60Beep::ConstructL(TInt aFrequency, TTimeIntervalMicroSeconds aDuration) { - iToneUtil=CMdaAudioToneUtility::NewL(*this); - iState=EBeepNotPrepared; - iFrequency=aFrequency; - iDuration=aDuration; - iToneUtil->PrepareToPlayTone(iFrequency,iDuration); + iToneUtil = CMdaAudioToneUtility::NewL(*this); + iState = EBeepNotPrepared; + iFrequency = aFrequency; + iDuration = aDuration; + iToneUtil->PrepareToPlayTone(iFrequency, iDuration); } void QS60Beep::Play() { - if (iState != EBeepNotPrepared) { - if (iState == EBeepPlaying) { - iToneUtil->CancelPlay(); - iState = EBeepPrepared; - } + if (iState == EBeepPlaying) { + iToneUtil->CancelPlay(); + iState = EBeepPrepared; } iToneUtil->Play(); @@ -173,13 +183,14 @@ void QS60Beep::MatoPrepareComplete(TInt aError) { if (aError == KErrNone) { iState = EBeepPrepared; + Play(); } } void QS60Beep::MatoPlayComplete(TInt aError) { Q_UNUSED(aError); - iState=EBeepPrepared; + iState = EBeepPrepared; } @@ -1226,6 +1237,10 @@ void qt_init(QApplicationPrivate * /* priv */, int) *****************************************************************************/ void qt_cleanup() { + if(qt_S60Beep) { + delete qt_S60Beep; + qt_S60Beep = 0; + } QFontCache::cleanup(); // Has to happen now, since QFontEngineS60 has FBS handles // S60 structure and window server session are freed in eventdispatcher destructor as they are needed there @@ -1467,14 +1482,13 @@ void QApplication::setCursorFlashTime(int msecs) void QApplication::beep() { - TInt frequency=440; - TTimeIntervalMicroSeconds duration(500000); - QS60Beep* beep=NULL; - TRAPD(err, beep=QS60Beep::NewL(frequency, duration)); - if (!err) - beep->Play(); - delete beep; - beep=NULL; + if (!qt_S60Beep) { + TInt frequency = 880; + TTimeIntervalMicroSeconds duration(500000); + TRAP_IGNORE(qt_S60Beep=QS60Beep::NewL(frequency, duration)); + } + if (qt_S60Beep) + qt_S60Beep->Play(); } /*! -- cgit v0.12 From 9073a38e2ad3342291e9b2e68cf120a2faba06b0 Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Wed, 25 Nov 2009 10:01:23 +0100 Subject: Make sure the cursor of the lineedit doesn't blink when a key is pressed This was a regression against 4.5 Task-number: QTBUG-4944 Reviewed-by: ogoffart --- src/gui/widgets/qlineedit.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gui/widgets/qlineedit.cpp b/src/gui/widgets/qlineedit.cpp index 3800224..785b2bd 100644 --- a/src/gui/widgets/qlineedit.cpp +++ b/src/gui/widgets/qlineedit.cpp @@ -1411,6 +1411,8 @@ bool QLineEdit::event(QEvent * e) QTimer::singleShot(0, this, SLOT(_q_handleWindowActivate())); }else if(e->type() == QEvent::ShortcutOverride){ d->control->processEvent(e); + } else if (e->type() == QEvent::KeyRelease) { + d->control->setCursorBlinkPeriod(QApplication::cursorFlashTime()); } #ifdef QT_KEYPAD_NAVIGATION @@ -1615,6 +1617,8 @@ void QLineEdit::keyPressEvent(QKeyEvent *event) } #endif d->control->processKeyEvent(event); + if (event->isAccepted()) + d->control->setCursorBlinkPeriod(0); } /*! -- cgit v0.12 From acf398f764a7d73f5857d4544df4e06bfe60797a Mon Sep 17 00:00:00 2001 From: Kim Motoyoshi Kalland Date: Wed, 25 Nov 2009 10:04:19 +0100 Subject: Fixed subpixel text antialiasing with the GL2 engine on ATI. Use subpixel antialiasing even if the there is an alpha channel. Reviewed-by: Trond --- src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp index 823f919..07432c6 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp @@ -1773,13 +1773,10 @@ bool QGL2PaintEngineEx::begin(QPaintDevice *pdev) d->glyphCacheType = QFontEngineGlyphCache::Raster_A8; #if !defined(QT_OPENGL_ES_2) - if (!d->device->format().alpha() #if defined(Q_WS_WIN) - && qt_cleartype_enabled + if (qt_cleartype_enabled) #endif - ) { d->glyphCacheType = QFontEngineGlyphCache::Raster_RGBMask; - } #endif #if defined(QT_OPENGL_ES_2) -- cgit v0.12 From 503f9eb56d16dcf2a44ad491da8b17b2aea72d7d Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Wed, 25 Nov 2009 10:12:51 +0100 Subject: Make the animation timer more consistent We ensure that the startStop timer is always ticking before the animation timer. Task-number: QTBUG-5967 Reviewed-by: Aaron Kennedy --- src/corelib/animation/qabstractanimation.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/corelib/animation/qabstractanimation.cpp b/src/corelib/animation/qabstractanimation.cpp index ef4989b..299585a 100644 --- a/src/corelib/animation/qabstractanimation.cpp +++ b/src/corelib/animation/qabstractanimation.cpp @@ -229,7 +229,10 @@ void QUnifiedTimer::restartAnimationTimer() void QUnifiedTimer::timerEvent(QTimerEvent *event) { - if (event->timerId() == startStopAnimationTimer.timerId()) { + //in the case of consistent timing we make sure the orders in which events come is always the same + //for that purpose we do as if the startstoptimer would always fire before the animation timer + if ((consistentTiming && startStopAnimationTimer.isActive()) || + event->timerId() == startStopAnimationTimer.timerId()) { startStopAnimationTimer.stop(); //we transfer the waiting animations into the "really running" state @@ -247,7 +250,9 @@ void QUnifiedTimer::timerEvent(QTimerEvent *event) time.start(); } } - } else if (event->timerId() == animationTimer.timerId()) { + } + + if (event->timerId() == animationTimer.timerId()) { // update current time on all top level animations updateAnimationsTime(); restartAnimationTimer(); -- cgit v0.12 From e6010544c06232ff1baed9123c0292a7aff6985e Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Wed, 25 Nov 2009 11:20:13 +0100 Subject: skip one test on mac because it uses native menu bars --- tests/auto/qmenubar/tst_qmenubar.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/auto/qmenubar/tst_qmenubar.cpp b/tests/auto/qmenubar/tst_qmenubar.cpp index 320cd8d..7fbb760 100644 --- a/tests/auto/qmenubar/tst_qmenubar.cpp +++ b/tests/auto/qmenubar/tst_qmenubar.cpp @@ -1667,6 +1667,9 @@ void tst_QMenuBar::menubarSizeHint() void tst_QMenuBar::taskQTBUG4965_escapeEaten() { +#ifdef Q_WS_MAC + QSKIP("On Mac, do not test the menubar with escape key", SkipAll); +#endif QMenuBar menubar; QMenu menu("menu1"); QAction *first = menubar.addMenu(&menu); -- cgit v0.12 From b463bd91f5e19ec597990ea736ee51a4baaca338 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Wed, 25 Nov 2009 11:47:46 +0100 Subject: stabilize tests on X11 --- tests/auto/qcombobox/tst_qcombobox.cpp | 2 ++ tests/auto/qmenubar/tst_qmenubar.cpp | 12 ++++++------ tests/auto/qwidget_window/tst_qwidget_window.cpp | 24 ++++++++++++++---------- 3 files changed, 22 insertions(+), 16 deletions(-) diff --git a/tests/auto/qcombobox/tst_qcombobox.cpp b/tests/auto/qcombobox/tst_qcombobox.cpp index af71961..bd5cd70 100644 --- a/tests/auto/qcombobox/tst_qcombobox.cpp +++ b/tests/auto/qcombobox/tst_qcombobox.cpp @@ -2516,10 +2516,12 @@ void tst_QComboBox::task_QTBUG_1071_changingFocusEmitsActivated() layout.addWidget(&edit); w.show(); + QApplication::setActiveWindow(&w); QTest::qWaitForWindowShown(&w); cb.clearEditText(); cb.setFocus(); QApplication::processEvents(); + QTRY_VERIFY(cb.hasFocus()); QTest::keyClick(0, '1'); QCOMPARE(spy.count(), 0); edit.setFocus(); diff --git a/tests/auto/qmenubar/tst_qmenubar.cpp b/tests/auto/qmenubar/tst_qmenubar.cpp index 7fbb760..aa6caae 100644 --- a/tests/auto/qmenubar/tst_qmenubar.cpp +++ b/tests/auto/qmenubar/tst_qmenubar.cpp @@ -168,7 +168,7 @@ private slots: void task256322_highlight(); void menubarSizeHint(); void taskQTBUG4965_escapeEaten(); - + #if defined(QT3_SUPPORT) void indexBasedInsertion_data(); void indexBasedInsertion(); @@ -1360,7 +1360,7 @@ tst_QMenuBar::allowActiveAndDisabled() // disabled menu items are added QMenu fileMenu("&File"); - // Task 241043 : check that second menu is activated + // Task 241043 : check that second menu is activated // if all items are disabled QAction *act = fileMenu.addAction("Disabled"); act->setEnabled(false); @@ -1388,7 +1388,7 @@ tst_QMenuBar::allowActiveAndDisabled() QCOMPARE(mb->activeAction()->text(), fileMenu.title()); else QCOMPARE(mb->activeAction()->text(), fileMenu.title()); - + mb->hide(); #endif //Q_WS_MAC } @@ -1603,7 +1603,7 @@ void tst_QMenuBar::menubarSizeHint() virtual int pixelMetric(PixelMetric metric, const QStyleOption * option = 0, const QWidget * widget = 0 ) const { // I chose strange values (prime numbers to be more sure that the size of the menubar is correct) - switch (metric) + switch (metric) { case QStyle::PM_MenuBarItemSpacing: return 7; @@ -1621,7 +1621,7 @@ void tst_QMenuBar::menubarSizeHint() QMenuBar mb; mb.setNativeMenuBar(false); //we can't check the geometry of native menubars - + mb.setStyle(&style); //this is a list of arbitrary strings so that we check the geometry QStringList list = QStringList() << "trer" << "ezrfgtgvqd" << "sdgzgzerzerzer" << "eerzertz" << "er"; @@ -1675,7 +1675,7 @@ void tst_QMenuBar::taskQTBUG4965_escapeEaten() QAction *first = menubar.addMenu(&menu); menu.addAction("quit", &menubar, SLOT(close()), QKeySequence("ESC")); menubar.show(); - menubar.setActiveWindow(); + QApplication::setActiveWindow(&menubar); QTest::qWaitForWindowShown(&menubar); menubar.setActiveAction(first); QTRY_VERIFY(menu.isVisible()); diff --git a/tests/auto/qwidget_window/tst_qwidget_window.cpp b/tests/auto/qwidget_window/tst_qwidget_window.cpp index 13d1d2d..ec11ab3 100644 --- a/tests/auto/qwidget_window/tst_qwidget_window.cpp +++ b/tests/auto/qwidget_window/tst_qwidget_window.cpp @@ -52,6 +52,9 @@ #include #endif // Q_WS_X11 +#include "../../shared/util.h" + + class tst_QWidget_window : public QWidget { Q_OBJECT @@ -150,7 +153,7 @@ void tst_QWidget_window::tst_show_resize_hide_show() class TestWidget : public QWidget { public: - int m_first, m_next; + int m_first, m_next; bool paintEventReceived; void reset(){ m_first = m_next = 0; paintEventReceived = false; } @@ -163,7 +166,7 @@ public: case QEvent::Show: if (m_first) m_next = event->type(); - else + else m_first = event->type(); break; case QEvent::Paint: @@ -173,7 +176,7 @@ public: break; } return QWidget::event(event); - } + } }; void tst_QWidget_window::tst_windowFilePathAndwindowTitle_data() @@ -289,7 +292,7 @@ void tst_QWidget_window::tst_showWithoutActivating() #else QWidget w; w.show(); - qt_x11_wait_for_window_manager(&w); + QTest::qWaitForWindowShown(&w); QApplication::processEvents(); QApplication::clipboard(); @@ -302,8 +305,11 @@ void tst_QWidget_window::tst_showWithoutActivating() Window window; int revertto; - XGetInputFocus(QX11Info::display(), &window, &revertto); - QCOMPARE(lineEdit->winId(), window); + QTRY_COMPARE(lineEdit->winId(), + (XGetInputFocus(QX11Info::display(), &window, &revertto), window) ); + // Note the use of the , before window because we want the XGetInputFocus to be re-executed + // in each iteration of the inside loop of the QTRY_COMPARE macro + #endif // Q_WS_X11 } @@ -315,11 +321,9 @@ void tst_QWidget_window::tst_paintEventOnSecondShow() w.reset(); w.show(); -#ifdef Q_WS_X11 - QTest::qWait(500); -#endif + QTest::qWaitForWindowShown(&w); QApplication::processEvents(); - QVERIFY(w.paintEventReceived); + QTRY_VERIFY(w.paintEventReceived); } QTEST_MAIN(tst_QWidget_window) -- cgit v0.12 From 800ad1c685060bfb6f469a506e8cd85ff3d81577 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Wed, 25 Nov 2009 12:15:27 +0100 Subject: Removed unused setThemePalette(QStyleOption *option) Not used or missed, anywhere. Reviewed-By: Trustme --- src/gui/styles/qs60style.cpp | 5 ----- src/gui/styles/qs60style_p.h | 2 -- 2 files changed, 7 deletions(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index b5c0d4f..03f7a95 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -459,11 +459,6 @@ void QS60StylePrivate::setThemePalette(QApplication *app) const storeThemePalette(&widgetPalette); } -void QS60StylePrivate::setThemePalette(QStyleOption *option) const -{ - setThemePalette(&option->palette); -} - QPalette* QS60StylePrivate::themePalette() { return m_themePalette; diff --git a/src/gui/styles/qs60style_p.h b/src/gui/styles/qs60style_p.h index ea86bb2..36979a2 100644 --- a/src/gui/styles/qs60style_p.h +++ b/src/gui/styles/qs60style_p.h @@ -418,8 +418,6 @@ public: //set theme palette for application void setThemePalette(QApplication *application) const; - //set theme palette for style option - void setThemePalette(QStyleOption *option) const; //access to theme palette static QPalette* themePalette(); -- cgit v0.12 From 41f58d51cec171ccfa132dad2d863340d3ed2db4 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Wed, 25 Nov 2009 09:44:32 +0100 Subject: Offset in MDI subwindow bar buttons under Mac OS 10.6 Task-number: QTBUG-5830 Reviewed-by: Richard --- src/gui/styles/qmacstyle_mac.mm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/gui/styles/qmacstyle_mac.mm b/src/gui/styles/qmacstyle_mac.mm index 51c2a96..4075cf7 100644 --- a/src/gui/styles/qmacstyle_mac.mm +++ b/src/gui/styles/qmacstyle_mac.mm @@ -4843,9 +4843,11 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex uint sc = SC_TitleBarMinButton; ThemeTitleBarWidget tbw = kThemeWidgetCollapseBox; bool active = titlebar->state & State_Active; - int border = 2; - titleBarRect.origin.x += border; - titleBarRect.origin.y -= border; + if (qMacVersion() < QSysInfo::MV_10_6) { + int border = 2; + titleBarRect.origin.x += border; + titleBarRect.origin.y -= border; + } while (sc <= SC_TitleBarCloseButton) { if (sc & titlebar->subControls) { -- cgit v0.12 From a30aa66726c1992a0b21b3663b8080661d899e13 Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Wed, 25 Nov 2009 12:33:34 +0100 Subject: Test for the clipboard presence in autotest --- tests/auto/qlineedit/tst_qlineedit.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/auto/qlineedit/tst_qlineedit.cpp b/tests/auto/qlineedit/tst_qlineedit.cpp index dd5bb29..79d1b3a 100644 --- a/tests/auto/qlineedit/tst_qlineedit.cpp +++ b/tests/auto/qlineedit/tst_qlineedit.cpp @@ -1415,8 +1415,22 @@ void tst_QLineEdit::undo_keypressevents() } #ifndef QT_NO_CLIPBOARD +static bool nativeClipboardWorking() +{ +#ifdef Q_WS_MAC + PasteboardRef pasteboard; + OSStatus status = PasteboardCreate(0, &pasteboard); + if (status == noErr) + CFRelease(pasteboard); + return status == noErr; +#endif + return true; +} + void tst_QLineEdit::QTBUG5786_undoPaste() { + if (!nativeClipboardWorking()) + QSKIP("this machine doesn't support the clipboard", SkipAll); QString initial("initial"); QString string("test"); QString additional("add"); -- cgit v0.12 From cee1c16a4738e30db5c011f4ae7e273387b5d998 Mon Sep 17 00:00:00 2001 From: Janne Koskinen Date: Wed, 25 Nov 2009 14:10:45 +0200 Subject: Fixed crash when scrolling with deleted backingstore In Symbian we save memory by deleting widget backingstore from non-visible windows. 12-key FEP is fullscreen and causes the backing store to be deleted but still continues to scroll the view to show current caret position in focused lineedit control. Task-number: QTBUG-5922 Reviewed-by: Jason Barron --- src/gui/painting/qbackingstore.cpp | 2 ++ tests/auto/qwidget/tst_qwidget.cpp | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/src/gui/painting/qbackingstore.cpp b/src/gui/painting/qbackingstore.cpp index 8226797..1b8f413 100644 --- a/src/gui/painting/qbackingstore.cpp +++ b/src/gui/painting/qbackingstore.cpp @@ -949,6 +949,8 @@ void QWidgetPrivate::scrollRect(const QRect &rect, int dx, int dy) return; QWidgetBackingStore *wbs = x->backingStore; + if (!wbs) + return; static int accelEnv = -1; if (accelEnv == -1) { diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp index 1e3f5f8..9960f47 100644 --- a/tests/auto/qwidget/tst_qwidget.cpp +++ b/tests/auto/qwidget/tst_qwidget.cpp @@ -391,6 +391,7 @@ private slots: #endif void focusProxyAndInputMethods(); + void scrollWithoutBackingStore(); private: bool ensureScreenSize(int width, int height); @@ -9703,5 +9704,42 @@ void tst_QWidget::focusProxyAndInputMethods() delete toplevel; } +class scrollWidgetWBS : public QWidget +{ +public: + void deleteBackingStore() + { + if (static_cast(d_ptr.data())->maybeBackingStore()) { + delete static_cast(d_ptr.data())->topData()->backingStore; + static_cast(d_ptr.data())->topData()->backingStore = 0; + } + } + void enableBackingStore() + { + if (!static_cast(d_ptr.data())->maybeBackingStore()) { + static_cast(d_ptr.data())->topData()->backingStore = new QWidgetBackingStore(this); + static_cast(d_ptr.data())->invalidateBuffer(this->rect()); +