diff options
Diffstat (limited to 'src/widgets/accessible')
-rw-r--r-- | src/widgets/accessible/complexwidgets.cpp | 6 | ||||
-rw-r--r-- | src/widgets/accessible/qaccessiblewidget.cpp | 8 | ||||
-rw-r--r-- | src/widgets/accessible/qaccessiblewidgetfactory.cpp | 98 | ||||
-rw-r--r-- | src/widgets/accessible/qaccessiblewidgets.cpp | 24 | ||||
-rw-r--r-- | src/widgets/accessible/rangecontrols.cpp | 12 | ||||
-rw-r--r-- | src/widgets/accessible/simplewidgets.cpp | 10 |
6 files changed, 85 insertions, 73 deletions
diff --git a/src/widgets/accessible/complexwidgets.cpp b/src/widgets/accessible/complexwidgets.cpp index ab543a79df..3030208c89 100644 --- a/src/widgets/accessible/complexwidgets.cpp +++ b/src/widgets/accessible/complexwidgets.cpp @@ -76,6 +76,8 @@ QT_BEGIN_NAMESPACE +using namespace Qt::StringLiterals; + QString qt_accStripAmp(const QString &text); QString qt_accHotKey(const QString &text); @@ -517,9 +519,9 @@ QAccessibleAbstractScrollArea::elementType(QWidget *widget) const return Self; if (widget == abstractScrollArea()->viewport()) return Viewport; - if (widget->objectName() == QLatin1String("qt_scrollarea_hcontainer")) + if (widget->objectName() == "qt_scrollarea_hcontainer"_L1) return HorizontalContainer; - if (widget->objectName() == QLatin1String("qt_scrollarea_vcontainer")) + if (widget->objectName() == "qt_scrollarea_vcontainer"_L1) return VerticalContainer; if (widget == abstractScrollArea()->cornerWidget()) return CornerWidget; diff --git a/src/widgets/accessible/qaccessiblewidget.cpp b/src/widgets/accessible/qaccessiblewidget.cpp index 1a8d2febec..28583f9872 100644 --- a/src/widgets/accessible/qaccessiblewidget.cpp +++ b/src/widgets/accessible/qaccessiblewidget.cpp @@ -68,6 +68,8 @@ QT_BEGIN_NAMESPACE +using namespace Qt::StringLiterals; + static QList<QWidget*> childWidgets(const QWidget *widget) { QList<QWidget*> widgets; @@ -78,8 +80,8 @@ static QList<QWidget*> childWidgets(const QWidget *widget) #if QT_CONFIG(menu) && !qobject_cast<QMenu*>(w) #endif - && w->objectName() != QLatin1String("qt_rubberband") - && w->objectName() != QLatin1String("qt_spinbox_lineedit")) + && w->objectName() != "qt_rubberband"_L1 + && w->objectName() != "qt_spinbox_lineedit"_L1) widgets.append(w); } return widgets; @@ -148,7 +150,7 @@ QString qt_accStripAmp(const QString &text) if (ampIndex != -1) newText.remove(ampIndex, 1); - return newText.replace(QLatin1String("&&"), QLatin1String("&")); + return newText.replace("&&"_L1, "&"_L1); } QString qt_accHotKey(const QString &text) diff --git a/src/widgets/accessible/qaccessiblewidgetfactory.cpp b/src/widgets/accessible/qaccessiblewidgetfactory.cpp index 4c6a6fdecb..dc1569cd95 100644 --- a/src/widgets/accessible/qaccessiblewidgetfactory.cpp +++ b/src/widgets/accessible/qaccessiblewidgetfactory.cpp @@ -60,6 +60,8 @@ QT_BEGIN_NAMESPACE +using namespace Qt::StringLiterals; + QAccessibleInterface *qAccessibleFactory(const QString &classname, QObject *object) { QAccessibleInterface *iface = nullptr; @@ -77,154 +79,154 @@ QAccessibleInterface *qAccessibleFactory(const QString &classname, QObject *obje if (false) { #if QT_CONFIG(lineedit) - } else if (classname == QLatin1String("QLineEdit")) { - if (widget->objectName() == QLatin1String("qt_spinbox_lineedit")) + } else if (classname == "QLineEdit"_L1) { + if (widget->objectName() == "qt_spinbox_lineedit"_L1) iface = nullptr; else iface = new QAccessibleLineEdit(widget); #endif #if QT_CONFIG(combobox) - } else if (classname == QLatin1String("QComboBox")) { + } else if (classname == "QComboBox"_L1) { iface = new QAccessibleComboBox(widget); #endif #if QT_CONFIG(spinbox) - } else if (classname == QLatin1String("QAbstractSpinBox")) { + } else if (classname == "QAbstractSpinBox"_L1) { iface = new QAccessibleAbstractSpinBox(widget); - } else if (classname == QLatin1String("QSpinBox")) { + } else if (classname == "QSpinBox"_L1) { iface = new QAccessibleSpinBox(widget); - } else if (classname == QLatin1String("QDoubleSpinBox")) { + } else if (classname == "QDoubleSpinBox"_L1) { iface = new QAccessibleDoubleSpinBox(widget); #endif #if QT_CONFIG(scrollbar) - } else if (classname == QLatin1String("QScrollBar")) { + } else if (classname == "QScrollBar"_L1) { iface = new QAccessibleScrollBar(widget); #endif #if QT_CONFIG(slider) - } else if (classname == QLatin1String("QAbstractSlider")) { + } else if (classname == "QAbstractSlider"_L1) { iface = new QAccessibleAbstractSlider(widget); - } else if (classname == QLatin1String("QSlider")) { + } else if (classname == "QSlider"_L1) { iface = new QAccessibleSlider(widget); #endif #if QT_CONFIG(toolbutton) - } else if (classname == QLatin1String("QToolButton")) { + } else if (classname == "QToolButton"_L1) { iface = new QAccessibleToolButton(widget); #endif // QT_CONFIG(toolbutton) #if QT_CONFIG(abstractbutton) - } else if (classname == QLatin1String("QCheckBox") - || classname == QLatin1String("QRadioButton") - || classname == QLatin1String("QPushButton") - || classname == QLatin1String("QAbstractButton")) { + } else if (classname == "QCheckBox"_L1 + || classname == "QRadioButton"_L1 + || classname == "QPushButton"_L1 + || classname == "QAbstractButton"_L1) { iface = new QAccessibleButton(widget); #endif - } else if (classname == QLatin1String("QDialog")) { + } else if (classname == "QDialog"_L1) { iface = new QAccessibleWidget(widget, QAccessible::Dialog); - } else if (classname == QLatin1String("QMessageBox")) { + } else if (classname == "QMessageBox"_L1) { iface = new QAccessibleWidget(widget, QAccessible::AlertMessage); #if QT_CONFIG(mainwindow) - } else if (classname == QLatin1String("QMainWindow")) { + } else if (classname == "QMainWindow"_L1) { iface = new QAccessibleMainWindow(widget); #endif - } else if (classname == QLatin1String("QLabel") || classname == QLatin1String("QLCDNumber")) { + } else if (classname == "QLabel"_L1 || classname == "QLCDNumber"_L1) { iface = new QAccessibleDisplay(widget); #if QT_CONFIG(groupbox) - } else if (classname == QLatin1String("QGroupBox")) { + } else if (classname == "QGroupBox"_L1) { iface = new QAccessibleGroupBox(widget); #endif - } else if (classname == QLatin1String("QStatusBar")) { + } else if (classname == "QStatusBar"_L1) { iface = new QAccessibleDisplay(widget); #if QT_CONFIG(progressbar) - } else if (classname == QLatin1String("QProgressBar")) { + } else if (classname == "QProgressBar"_L1) { iface = new QAccessibleProgressBar(widget); #endif - } else if (classname == QLatin1String("QToolBar")) { + } else if (classname == "QToolBar"_L1) { iface = new QAccessibleWidget(widget, QAccessible::ToolBar, widget->windowTitle()); #if QT_CONFIG(menubar) - } else if (classname == QLatin1String("QMenuBar")) { + } else if (classname == "QMenuBar"_L1) { iface = new QAccessibleMenuBar(widget); #endif #if QT_CONFIG(menu) - } else if (classname == QLatin1String("QMenu")) { + } else if (classname == "QMenu"_L1) { iface = new QAccessibleMenu(widget); #endif #if QT_CONFIG(treeview) - } else if (classname == QLatin1String("QTreeView")) { + } else if (classname == "QTreeView"_L1) { iface = new QAccessibleTree(widget); #endif // QT_CONFIG(treeview) #if QT_CONFIG(itemviews) - } else if (classname == QLatin1String("QTableView") || classname == QLatin1String("QListView")) { + } else if (classname == "QTableView"_L1 || classname == "QListView"_L1) { iface = new QAccessibleTable(widget); // ### This should be cleaned up. We return the parent for the scrollarea to hide it. #endif // QT_CONFIG(itemviews) #if QT_CONFIG(tabbar) - } else if (classname == QLatin1String("QTabBar")) { + } else if (classname == "QTabBar"_L1) { iface = new QAccessibleTabBar(widget); #endif - } else if (classname == QLatin1String("QSizeGrip")) { + } else if (classname == "QSizeGrip"_L1) { iface = new QAccessibleWidget(widget, QAccessible::Grip); #if QT_CONFIG(splitter) - } else if (classname == QLatin1String("QSplitter")) { + } else if (classname == "QSplitter"_L1) { iface = new QAccessibleWidget(widget, QAccessible::Splitter); - } else if (classname == QLatin1String("QSplitterHandle")) { + } else if (classname == "QSplitterHandle"_L1) { iface = new QAccessibleWidget(widget, QAccessible::Grip); #endif #if QT_CONFIG(textedit) && !defined(QT_NO_CURSOR) - } else if (classname == QLatin1String("QTextEdit")) { + } else if (classname == "QTextEdit"_L1) { iface = new QAccessibleTextEdit(widget); - } else if (classname == QLatin1String("QPlainTextEdit")) { + } else if (classname == "QPlainTextEdit"_L1) { iface = new QAccessiblePlainTextEdit(widget); #endif - } else if (classname == QLatin1String("QTipLabel")) { + } else if (classname == "QTipLabel"_L1) { iface = new QAccessibleDisplay(widget, QAccessible::ToolTip); - } else if (classname == QLatin1String("QFrame")) { + } else if (classname == "QFrame"_L1) { iface = new QAccessibleWidget(widget, QAccessible::Border); #if QT_CONFIG(stackedwidget) - } else if (classname == QLatin1String("QStackedWidget")) { + } else if (classname == "QStackedWidget"_L1) { iface = new QAccessibleStackedWidget(widget); #endif #if QT_CONFIG(toolbox) - } else if (classname == QLatin1String("QToolBox")) { + } else if (classname == "QToolBox"_L1) { iface = new QAccessibleToolBox(widget); #endif #if QT_CONFIG(mdiarea) - } else if (classname == QLatin1String("QMdiArea")) { + } else if (classname == "QMdiArea"_L1) { iface = new QAccessibleMdiArea(widget); - } else if (classname == QLatin1String("QMdiSubWindow")) { + } else if (classname == "QMdiSubWindow"_L1) { iface = new QAccessibleMdiSubWindow(widget); #endif #if QT_CONFIG(dialogbuttonbox) - } else if (classname == QLatin1String("QDialogButtonBox")) { + } else if (classname == "QDialogButtonBox"_L1) { iface = new QAccessibleDialogButtonBox(widget); #endif #if QT_CONFIG(dial) - } else if (classname == QLatin1String("QDial")) { + } else if (classname == "QDial"_L1) { iface = new QAccessibleDial(widget); #endif #if QT_CONFIG(rubberband) - } else if (classname == QLatin1String("QRubberBand")) { + } else if (classname == "QRubberBand"_L1) { iface = new QAccessibleWidget(widget, QAccessible::Border); #endif #if QT_CONFIG(textbrowser) && !defined(QT_NO_CURSOR) - } else if (classname == QLatin1String("QTextBrowser")) { + } else if (classname == "QTextBrowser"_L1) { iface = new QAccessibleTextBrowser(widget); #endif #if QT_CONFIG(scrollarea) - } else if (classname == QLatin1String("QAbstractScrollArea")) { + } else if (classname == "QAbstractScrollArea"_L1) { iface = new QAccessibleAbstractScrollArea(widget); - } else if (classname == QLatin1String("QScrollArea")) { + } else if (classname == "QScrollArea"_L1) { iface = new QAccessibleScrollArea(widget); #endif #if QT_CONFIG(calendarwidget) - } else if (classname == QLatin1String("QCalendarWidget")) { + } else if (classname == "QCalendarWidget"_L1) { iface = new QAccessibleCalendarWidget(widget); #endif #if QT_CONFIG(dockwidget) - } else if (classname == QLatin1String("QDockWidget")) { + } else if (classname == "QDockWidget"_L1) { iface = new QAccessibleDockWidget(widget); #endif - } else if (classname == QLatin1String("QWidget")) { + } else if (classname == "QWidget"_L1) { iface = new QAccessibleWidget(widget); - } else if (classname == QLatin1String("QWindowContainer")) { + } else if (classname == "QWindowContainer"_L1) { iface = new QAccessibleWindowContainer(widget); } diff --git a/src/widgets/accessible/qaccessiblewidgets.cpp b/src/widgets/accessible/qaccessiblewidgets.cpp index fdabc051c8..7a3a387a87 100644 --- a/src/widgets/accessible/qaccessiblewidgets.cpp +++ b/src/widgets/accessible/qaccessiblewidgets.cpp @@ -96,6 +96,8 @@ QT_BEGIN_NAMESPACE +using namespace Qt::StringLiterals; + QString qt_accStripAmp(const QString &text); QString qt_accHotKey(const QString &text); @@ -114,8 +116,8 @@ QList<QWidget*> childWidgets(const QWidget *widget) #if QT_CONFIG(menu) && !qobject_cast<QMenu*>(w) #endif - && objectName != QLatin1String("qt_rubberband") - && objectName != QLatin1String("qt_qmainwindow_extended_splitter")) { + && objectName != "qt_rubberband"_L1 + && objectName != "qt_qmainwindow_extended_splitter"_L1) { widgets.append(w); } } @@ -432,7 +434,7 @@ QString QAccessibleMdiSubWindow::text(QAccessible::Text textType) const { if (textType == QAccessible::Name) { QString title = mdiSubWindow()->windowTitle(); - title.replace(QLatin1String("[*]"), QLatin1String("")); + title.replace("[*]"_L1, ""_L1); return title; } return QAccessibleWidget::text(textType); @@ -570,7 +572,7 @@ QCalendarWidget *QAccessibleCalendarWidget::calendarWidget() const QAbstractItemView *QAccessibleCalendarWidget::calendarView() const { for (QObject *child : calendarWidget()->children()) { - if (child->objectName() == QLatin1String("qt_calendar_calendarview")) + if (child->objectName() == "qt_calendar_calendarview"_L1) return static_cast<QAbstractItemView *>(child); } return nullptr; @@ -579,7 +581,7 @@ QAbstractItemView *QAccessibleCalendarWidget::calendarView() const QWidget *QAccessibleCalendarWidget::navigationBar() const { for (QObject *child : calendarWidget()->children()) { - if (child->objectName() == QLatin1String("qt_calendar_navigationbar")) + if (child->objectName() == "qt_calendar_navigationbar"_L1) return static_cast<QWidget *>(child); } return nullptr; @@ -852,12 +854,12 @@ QString QAccessibleTextWidget::attributes(int offset, int *startOffset, int *end AttributeFormatter attrs; QString family = charFormatFont.families().value(0, QString()); if (!family.isEmpty()) { - family = family.replace(u'\\', QLatin1String("\\\\")); - family = family.replace(u':', QLatin1String("\\:")); - family = family.replace(u',', QLatin1String("\\,")); - family = family.replace(u'=', QLatin1String("\\=")); - family = family.replace(u';', QLatin1String("\\;")); - family = family.replace(u'\"', QLatin1String("\\\"")); + family = family.replace(u'\\', "\\\\"_L1); + family = family.replace(u':', "\\:"_L1); + family = family.replace(u',', "\\,"_L1); + family = family.replace(u'=', "\\="_L1); + family = family.replace(u';', "\\;"_L1); + family = family.replace(u'\"', "\\\""_L1); attrs["font-family"] = u'"' + family + u'"'; } diff --git a/src/widgets/accessible/rangecontrols.cpp b/src/widgets/accessible/rangecontrols.cpp index 6c12b553b4..a6a91aa245 100644 --- a/src/widgets/accessible/rangecontrols.cpp +++ b/src/widgets/accessible/rangecontrols.cpp @@ -65,6 +65,8 @@ QT_BEGIN_NAMESPACE +using namespace Qt::StringLiterals; + #ifndef QT_NO_ACCESSIBILITY #if QT_CONFIG(spinbox) @@ -253,7 +255,7 @@ QAccessibleSpinBox::QAccessibleSpinBox(QWidget *w) : QAccessibleAbstractSpinBox(w) { Q_ASSERT(spinBox()); - addControllingSignal(QLatin1String("valueChanged(int)")); + addControllingSignal("valueChanged(int)"_L1); } /*! @@ -270,7 +272,7 @@ QAccessibleDoubleSpinBox::QAccessibleDoubleSpinBox(QWidget *widget) : QAccessibleAbstractSpinBox(widget) { Q_ASSERT(qobject_cast<QDoubleSpinBox *>(widget)); - addControllingSignal(QLatin1String("valueChanged(double)")); + addControllingSignal("valueChanged(double)"_L1); } /*! @@ -307,7 +309,7 @@ QAccessibleScrollBar::QAccessibleScrollBar(QWidget *w) : QAccessibleAbstractSlider(w, QAccessible::ScrollBar) { Q_ASSERT(scrollBar()); - addControllingSignal(QLatin1String("valueChanged(int)")); + addControllingSignal("valueChanged(int)"_L1); } /*! Returns the scroll bar. */ @@ -342,7 +344,7 @@ QAccessibleSlider::QAccessibleSlider(QWidget *w) : QAccessibleAbstractSlider(w) { Q_ASSERT(slider()); - addControllingSignal(QLatin1String("valueChanged(int)")); + addControllingSignal("valueChanged(int)"_L1); } /*! Returns the slider. */ @@ -410,7 +412,7 @@ QAccessibleDial::QAccessibleDial(QWidget *widget) : QAccessibleAbstractSlider(widget, QAccessible::Dial) { Q_ASSERT(qobject_cast<QDial *>(widget)); - addControllingSignal(QLatin1String("valueChanged(int)")); + addControllingSignal("valueChanged(int)"_L1); } QString QAccessibleDial::text(QAccessible::Text textType) const diff --git a/src/widgets/accessible/simplewidgets.cpp b/src/widgets/accessible/simplewidgets.cpp index 0d4556adc5..3aab843f64 100644 --- a/src/widgets/accessible/simplewidgets.cpp +++ b/src/widgets/accessible/simplewidgets.cpp @@ -93,6 +93,8 @@ QT_BEGIN_NAMESPACE +using namespace Qt::StringLiterals; + #ifndef QT_NO_ACCESSIBILITY extern QList<QWidget*> childWidgets(const QWidget *widget); @@ -120,9 +122,9 @@ QAccessibleButton::QAccessibleButton(QWidget *w) // FIXME: The checkable state of the button is dynamic, // while we only update the controlling signal once :( if (button()->isCheckable()) - addControllingSignal(QLatin1String("toggled(bool)")); + addControllingSignal("toggled(bool)"_L1); else - addControllingSignal(QLatin1String("clicked()")); + addControllingSignal("clicked()"_L1); } /*! Returns the button. */ @@ -687,8 +689,8 @@ QStringList QAccessibleGroupBox::keyBindingsForAction(const QString &) const QAccessibleLineEdit::QAccessibleLineEdit(QWidget *w, const QString &name) : QAccessibleWidget(w, QAccessible::EditableText, name) { - addControllingSignal(QLatin1String("textChanged(const QString&)")); - addControllingSignal(QLatin1String("returnPressed()")); + addControllingSignal("textChanged(const QString&)"_L1); + addControllingSignal("returnPressed()"_L1); } /*! Returns the line edit. */ |