Qt
Installation
Ubuntu: apt install libgl1-mesa-dev
apt-get install essential cmake gdb qt-unified-linux-x64-2.0.5-online.run #Benutzer: qt.io <at> h*.de ln -s /opt/Qt/5.8/gcc_64/bin /usr/lib/x86_64-linux-gnu/qt5
Links
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); }
File Handling
QFile output(fileName); if( ! output.open(QIODevice::WriteOnly) ) { error(); } else { QTextStream os(&output); os << "Hi world!\n"; output.close(); }
Datum/Zeit
QDateTime::currentDateTime().toString("yyyy.MM.dd hh:mm:ss");
QString/QByteArray
QString::fromUtf8(const QByteArray &str); QByteArray data = message.toUtf8();
QMap
for (i = map.constBegin(); i != map.constEnd(); ++i) cout << i.key() << ": " << i.value() << endl;
UI
- Alle Widgets auf dem Container herrichten. Widgets selektieren: Rechtsklick: Layout
- Layout in der obersten Ebene eines Containers (auch Mainwindow): Rechtsklick auf Containergrund: Layout