Category Archives: Featured

Most exclusive posts will be listed here

Qt Code Example: MessageBox

  QMessageBox::about(this, tr("About Syntax Highlighter"), tr("<p>The <b>Syntax Highlighter</b> example shows how " \ "to perform simple syntax highlighting by subclassing " \ "the QSyntaxHighlighter class and describing " \ "highlighting rules using regular expressions.</p>"));

Posted in Featured, Qt Tagged ,

Qt Code Example : Open File

void MainWindow::openFile(const QString &path) { QString fileName = path;   if (fileName.isNull()) fileName = QFileDialog::getOpenFileName(this, tr("Open File"), "", "C++ Files (*.cpp *.h)");   if (!fileName.isEmpty()) { QFile file(fileName); if (file.open(QFile::ReadOnly | QFile::Text)) editor->setPlainText(file.readAll());   } }

Posted in Featured, Qt Tagged