Notes

Qt notes

author: Paul Kim

categories: qt

tags: qt

Qt notes

need to organize. either delete links or organize it.

https://stackoverflow.com/questions/7016877/qt-browsing-filesystem-with-qlistview-and-qfilesystemmodel-how-to-higlight-fir

http://blog.davidecoppola.com/2016/11/howto-embed-database-in-application-with-sqlite-and-qt/

connect(model, SIGNAL(directoryLoaded(QString)), this, SLOT(directoryLoaded(QString)));

QFileSystemModel *model = new QFileSystemModel;
connect(model, SIGNAL(directoryLoaded(QString)), this, SLOT(directoryLoaded(QString)));

model->setRootPath(QDir::currentPath());
QModelIndex parentIndex = model->index(QDir::currentPath());
int numRows = model->rowCount(parentIndex);
qInfo("num rows: %d", numRows);
for (int row = 0; row < numRows; ++row) {
    QModelIndex childIndex = model->index(row, 0, parentIndex);
    QString path = model->data(childIndex, Qt::DisplayRole).toString();
    qInfo(qUtf8Printable(path));
}

Qt Creator

Qt Creator

Qt Maintenance Tool

Qt Maintenance Tool

Creating Qt Widget Application

  1. Create a new project create new project
  2. Choose "Qt Widget Application" choose qt widget application
  3. Name the project name the project
  4. Select Kits select kits
  5. Specify class information specify class information
  6. Finish creating project finish creating project

ChromeEdgeFirefoxOpera

© 2021 paulkode.com. All rights reserved.