summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiDe Zhang <zhangjide@uniontech.com>2022-07-02 13:08:21 +0800
committerLiang Qi <liang.qi@qt.io>2022-07-05 05:05:36 +0000
commit32d8cb010545f5f221689bd7f9a80281f62ad89d (patch)
tree511f1e7d6ca72772874a736684a2042e9ebb3949
parent354d9c40314c1d5d9db73e1e11c1f43ca654f00a (diff)
Use QColor::fromString instead of some deprecated functionsHEADdev
It's a follow-up of a series changes from 78b6876974d2cea087cb229257097052dad5fcf7 in qtbase. Pick-to: 6.4 Change-Id: I4ad19b07489630a4648b5d6ca4a8c074ed88827b Reviewed-by: Liang Qi <liang.qi@qt.io>
-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:
{