diff options
author | Liang Qi <liang.qi@qt.io> | 2017-02-16 21:46:20 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2017-02-16 21:51:11 +0100 |
commit | c577f6edafef7c40a5f78092ec4fcd78bb820b2c (patch) | |
tree | 9ca3819e5cca9b7e61f305a874b682e5a2085e83 /examples/opengl | |
parent | 99ce1d3d97c0423c3ee63ccf58deed964db0770e (diff) | |
parent | de225ccdf95efb57866d62bc80872c1a2ab99703 (diff) |
Merge remote-tracking branch 'origin/5.8' into 5.9
Conflicts:
src/corelib/plugin/qlibrary_unix.cpp
src/plugins/platforms/xcb/qxcbconnection.cpp
tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp
Change-Id: I632c400d909f8c204f55743aadc7886af2f15dfb
Diffstat (limited to 'examples/opengl')
-rw-r--r-- | examples/opengl/legacy/grabber/mainwindow.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/examples/opengl/legacy/grabber/mainwindow.cpp b/examples/opengl/legacy/grabber/mainwindow.cpp index da022adcdf..6ea6a28051 100644 --- a/examples/opengl/legacy/grabber/mainwindow.cpp +++ b/examples/opengl/legacy/grabber/mainwindow.cpp @@ -203,10 +203,11 @@ QSize MainWindow::getSize() if (!ok) return QSize(); - QRegExp regExp(tr("([0-9]+) *x *([0-9]+)")); - if (regExp.exactMatch(text)) { - int width = regExp.cap(1).toInt(); - int height = regExp.cap(2).toInt(); + QRegularExpression regExp(tr("^([0-9]+) *x *([0-9]+)$")); + QRegularExpressionMatch match = regExp.match(text); + if (match.hasMatch()) { + int width = match.captured(1).toInt(); + int height = match.captured(2).toInt(); if (width > 0 && width < 2048 && height > 0 && height < 2048) return QSize(width, height); } |