summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiDe Zhang <zhangjide@uniontech.com>2022-07-02 13:08:21 +0800
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-07-05 05:34:49 +0000
commit1a4d53d55ee9d1654adf16c0a24d43bf0b1d122a (patch)
tree11a190162876a4e5e2a7ac2b57708806e8a3b378
parentb481addb5df148df8b0da9408d0a40537d65e362 (diff)
downloadqtwayland-1a4d53d55ee9d1654adf16c0a24d43bf0b1d122a.tar.gz
Use QColor::fromString instead of some deprecated functions
It's a follow-up of a series changes from 78b6876974d2cea087cb229257097052dad5fcf7 in qtbase. Change-Id: I4ad19b07489630a4648b5d6ca4a8c074ed88827b Reviewed-by: Liang Qi <liang.qi@qt.io> (cherry picked from commit 32d8cb010545f5f221689bd7f9a80281f62ad89d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--examples/wayland/custom-extension/cpp-client/main.cpp8
-rw-r--r--src/client/qwaylandinputmethodcontext.cpp2
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 6b6fa706..d3feae40 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 383725d1..85cd4271 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:
{