From 32d8cb010545f5f221689bd7f9a80281f62ad89d Mon Sep 17 00:00:00 2001 From: JiDe Zhang Date: Sat, 2 Jul 2022 13:08:21 +0800 Subject: Use QColor::fromString instead of some deprecated functions It's a follow-up of a series changes from 78b6876974d2cea087cb229257097052dad5fcf7 in qtbase. Pick-to: 6.4 Change-Id: I4ad19b07489630a4648b5d6ca4a8c074ed88827b Reviewed-by: Liang Qi --- examples/wayland/custom-extension/cpp-client/main.cpp | 8 ++++---- src/client/qwaylandinputmethodcontext.cpp | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/wayland/custom-extension/cpp-client/main.cpp b/examples/wayland/custom-extension/cpp-client/main.cpp index 6b6fa7069..d3feae404 100644 --- a/examples/wayland/custom-extension/cpp-client/main.cpp +++ b/examples/wayland/custom-extension/cpp-client/main.cpp @@ -77,13 +77,13 @@ protected: QPainter p(this); p.setFont(m_font); p.fillRect(QRect(0,0,width(),height()),Qt::gray); - p.fillRect(rect1, QColor("#C0FFEE")); + p.fillRect(rect1, QColor::fromString("#C0FFEE")); p.drawText(rect1, Qt::TextWordWrap, "Press here to send spin request."); - p.fillRect(rect2, QColor("#decaff")); + p.fillRect(rect2, QColor::fromString("#decaff")); p.drawText(rect2, Qt::TextWordWrap, "Press here to send bounce request."); - p.fillRect(rect3, QColor("#7EA")); + p.fillRect(rect3, QColor::fromString("#7EA")); p.drawText(rect3, Qt::TextWordWrap, "Create new window."); - p.fillRect(rect4, QColor("#7EABA6")); + p.fillRect(rect4, QColor::fromString("#7EABA6")); p.drawText(rect4, Qt::TextWordWrap, "Create custom object."); } diff --git a/src/client/qwaylandinputmethodcontext.cpp b/src/client/qwaylandinputmethodcontext.cpp index 383725d1f..85cd42714 100644 --- a/src/client/qwaylandinputmethodcontext.cpp +++ b/src/client/qwaylandinputmethodcontext.cpp @@ -110,7 +110,7 @@ void QWaylandTextInputMethod::text_input_method_v1_input_method_event_attribute( attributes.append(QInputMethodEvent::Attribute(QInputMethodEvent::AttributeType(type), startMapped, length)); break; case QInputMethodEvent::Cursor: - attributes.append(QInputMethodEvent::Attribute(QInputMethodEvent::AttributeType(type), start, length, QColor(value))); + attributes.append(QInputMethodEvent::Attribute(QInputMethodEvent::AttributeType(type), start, length, QColor::fromString(value))); break; case QInputMethodEvent::TextFormat: { -- cgit v1.2.3