Qt: Unterschied zwischen den Versionen

Aus Info-Theke
Zur Navigation springen Zur Suche springen
Zeile 1: Zeile 1:
[[Kategorie:Sprache]]
[[Kategorie:Sprache]]
== Installation ==
<pre>apt-get install essential cmake gdb
</pre>


== RegExpr ==
== RegExpr ==

Version vom 9. März 2017, 07:27 Uhr


Installation

apt-get install essential cmake gdb

RegExpr

QRegularExpression regExpr("(\\d+)x(\\d+)");
QRegularExpressionMatch match = regExpr.match(line);
if (match.hasMatch()){
   QString width = match.captured(1);
   QString height = match.captured(2);
}

QRegularExpression re("(\\w+)");
QRegularExpressionMatchIterator i = re.globalMatch(line);
while(i.hasNext()){
   QRegularExpressionMatch match = i.next();
   QString word = match.captured(1);
}