Skip to content

Instantly share code, notes, and snippets.

@Atsushi4
Created October 29, 2012 12:57
Show Gist options
  • Save Atsushi4/3973376 to your computer and use it in GitHub Desktop.
Save Atsushi4/3973376 to your computer and use it in GitHub Desktop.
QFileSystemModelをQListViewで表示するサンプル
#include <QtGui>
int main(int argc, char **argv)
{
QApplication app(argc, argv);
QListView view;
QFileSystemModel *model = new QFileSystemModel(&view);
model->setRootPath("~/");
view.setModel(model);
view.connect(&view, SIGNAL(clicked(QModelIndex)), SLOT(setRootIndex(QModelIndex)));
view.show();
return app.exec();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment