From f195a8e2b69eba0e3c44f2dece222b0da9e06026 Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Mon, 13 Feb 2012 14:05:51 +0100 Subject: Added QAccessibleGroupBox MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added a new accessible interface for QGroupBox, as QAccessibleDisplay is not good enough when the QGroupBox is checkable. AccessibleFactory was modified to return a QAccessibleGroupBox when the accessible interface of a QGroupBox is requested. Created tst_QAccessibility::groupBoxTest Port to Qt5 of the patch by José Millán Soto Change-Id: I6c23dcf5562b3ea269b04102e78463b65827188a Reviewed-by: Jan-Arve Sæther (cherry picked from commit c03ceb203c65d9e3485fad848bfc0c4b6ee3e9aa) --- src/widgets/widgets/qgroupbox.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/widgets/widgets') diff --git a/src/widgets/widgets/qgroupbox.cpp b/src/widgets/widgets/qgroupbox.cpp index e9edea286f..d8ad04cd84 100644 --- a/src/widgets/widgets/qgroupbox.cpp +++ b/src/widgets/widgets/qgroupbox.cpp @@ -643,6 +643,12 @@ void QGroupBox::setChecked(bool b) update(); d->checked = b; d->_q_setChildrenEnabled(b); +#ifndef QT_NO_ACCESSIBILITY + QAccessible::State st; + st.checked = true; + QAccessibleStateChangeEvent *ev = new QAccessibleStateChangeEvent(this, st); + QAccessible::updateAccessibility(ev); +#endif emit toggled(b); } } -- cgit v1.2.3 From bc0b37d6b61fc8ab83026d6a5e515666e58d7938 Mon Sep 17 00:00:00 2001 From: Pekka Vuorela Date: Fri, 16 Mar 2012 14:08:13 +0200 Subject: Password editor mask delay stylable by platform plugin Replaced hard coding as QT_GUI_PASSWORD_ECHO_DELAY with a style hint. Change-Id: I0b78ebad723dbe19d9b9496583203e31545874e2 Reviewed-by: Andrew den Exter Reviewed-by: Lars Knoll --- src/widgets/widgets/qwidgetlinecontrol.cpp | 26 ++++---------------------- src/widgets/widgets/qwidgetlinecontrol_p.h | 8 -------- 2 files changed, 4 insertions(+), 30 deletions(-) (limited to 'src/widgets/widgets') diff --git a/src/widgets/widgets/qwidgetlinecontrol.cpp b/src/widgets/widgets/qwidgetlinecontrol.cpp index ca30c7eef8..b4a7007190 100644 --- a/src/widgets/widgets/qwidgetlinecontrol.cpp +++ b/src/widgets/widgets/qwidgetlinecontrol.cpp @@ -47,6 +47,7 @@ #include "qclipboard.h" #include #include +#include #ifndef QT_NO_ACCESSIBILITY #include "qaccessible.h" #endif @@ -58,21 +59,6 @@ QT_BEGIN_NAMESPACE -#ifdef QT_GUI_PASSWORD_ECHO_DELAY -static const int qt_passwordEchoDelay = QT_GUI_PASSWORD_ECHO_DELAY; -#endif - -/*! - \macro QT_GUI_PASSWORD_ECHO_DELAY - - \internal - - Defines the amount of time in milliseconds the last entered character - should be displayed unmasked in the Password echo mode. - - If not defined in qplatformdefs.h there will be no delay in masking - password characters. -*/ /*! \internal @@ -113,7 +99,6 @@ void QWidgetLineControl::updateDisplayText(bool forceUpdate) if (m_echoMode == QLineEdit::Password) { str.fill(m_passwordCharacter); -#ifdef QT_GUI_PASSWORD_ECHO_DELAY if (m_passwordEchoTimer != 0 && m_cursor > 0 && m_cursor <= m_text.length()) { int cursor = m_cursor - 1; QChar uc = m_text.at(cursor); @@ -126,7 +111,6 @@ void QWidgetLineControl::updateDisplayText(bool forceUpdate) str[cursor - 1] = uc; } } -#endif } else if (m_echoMode == QLineEdit::PasswordEchoOnEdit && !m_passwordEchoEditing) { str.fill(m_passwordCharacter); } @@ -818,13 +802,13 @@ void QWidgetLineControl::addCommand(const Command &cmd) */ void QWidgetLineControl::internalInsert(const QString &s) { -#ifdef QT_GUI_PASSWORD_ECHO_DELAY if (m_echoMode == QLineEdit::Password) { if (m_passwordEchoTimer != 0) killTimer(m_passwordEchoTimer); - m_passwordEchoTimer = startTimer(qt_passwordEchoDelay); + int delay = qGuiApp->styleHints()->passwordMaskDelay(); + if (delay > 0) + m_passwordEchoTimer = startTimer(delay); } -#endif if (hasSelectedText()) addCommand(Command(SetSelection, m_cursor, 0, m_selstart, m_selend)); if (m_maskData) { @@ -1517,12 +1501,10 @@ void QWidgetLineControl::timerEvent(QTimerEvent *event) } else if (event->timerId() == m_tripleClickTimer) { killTimer(m_tripleClickTimer); m_tripleClickTimer = 0; -#ifdef QT_GUI_PASSWORD_ECHO_DELAY } else if (event->timerId() == m_passwordEchoTimer) { killTimer(m_passwordEchoTimer); m_passwordEchoTimer = 0; updateDisplayText(); -#endif } } diff --git a/src/widgets/widgets/qwidgetlinecontrol_p.h b/src/widgets/widgets/qwidgetlinecontrol_p.h index 72f25e9068..62184a27bb 100644 --- a/src/widgets/widgets/qwidgetlinecontrol_p.h +++ b/src/widgets/widgets/qwidgetlinecontrol_p.h @@ -93,9 +93,7 @@ public: m_ascent(0), m_maxLength(32767), m_lastCursorPos(-1), m_tripleClickTimer(0), m_maskData(0), m_modifiedState(0), m_undoState(0), m_selstart(0), m_selend(0), m_passwordEchoEditing(false) -#ifdef QT_GUI_PASSWORD_ECHO_DELAY , m_passwordEchoTimer(0) -#endif #if defined(Q_WS_MAC) , m_threadChecks(false) , m_textLayoutThread(0) @@ -306,10 +304,8 @@ public: void updatePasswordEchoEditing(bool editing); bool passwordEchoEditing() const { -#ifdef QT_GUI_PASSWORD_ECHO_DELAY if (m_passwordEchoTimer != 0) return true; -#endif return m_passwordEchoEditing ; } @@ -484,17 +480,13 @@ private: bool m_passwordEchoEditing; QChar m_passwordCharacter; -#ifdef QT_GUI_PASSWORD_ECHO_DELAY int m_passwordEchoTimer; -#endif void cancelPasswordEchoTimer() { -#ifdef QT_GUI_PASSWORD_ECHO_DELAY if (m_passwordEchoTimer != 0) { killTimer(m_passwordEchoTimer); m_passwordEchoTimer = 0; } -#endif } int redoTextLayout() const; -- cgit v1.2.3