From 7dff4b921b0111c9ebe392ab1c168aaeff3d2605 Mon Sep 17 00:00:00 2001 From: Samuel Gaist Date: Sat, 21 Jan 2017 00:41:45 +0100 Subject: Example: migrate flightinfo to QRegularExpression Update the flightinfo example to use the new QRegularExpression class in place of the deprecated QRegExp. Change-Id: I2395b37170565e922500e675210c400e90ae0f73 Reviewed-by: Sze Howe Koh --- examples/embedded/flightinfo/flightinfo.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'examples') diff --git a/examples/embedded/flightinfo/flightinfo.cpp b/examples/embedded/flightinfo/flightinfo.cpp index 8ad1e5c0c0..e91277db58 100644 --- a/examples/embedded/flightinfo/flightinfo.cpp +++ b/examples/embedded/flightinfo/flightinfo.cpp @@ -239,9 +239,9 @@ private: int i = data.indexOf("a href=\"?view=detail"); if (i > 0) { QString href = data.mid(i, data.indexOf('\"', i + 8) - i + 1); - QRegExp regex("dpap=([A-Za-z0-9]+)"); - regex.indexIn(href); - QString airport = regex.cap(1); + QRegularExpression regex("dpap=([A-Za-z0-9]+)"); + QRegularExpressionMatch match = regex.match(href); + QString airport = match.captured(1); QUrlQuery query(m_url); query.addQueryItem("dpap", airport); m_url.setQuery(query); -- cgit v1.2.3