C++ Qt 49 - QFileSystemModel a simple file explorer example

VoidRealms · 96K views · 2011 · 8:41

Open on YouTube

C, C++, Rust, Go & systems languagesSoftware architecture & designtutorial

Why Stack Overflow recommends it

Stack Overflow users link it when someone needs a working example of QFileSystemModel with tree and list views, including in PyQt and PySide questions where the C++ version is used as a reference.

Recommended by 5 people across 5 different months, 2012 to 2023.

What it is

A short Qt C++ tutorial from VoidRealms' Qt series that builds a simple file explorer using QFileSystemModel, with a QTreeView for folders and a second view for the files in the selected folder. It is a screencast walkthrough aimed at beginners learning Qt model/view programming.

What people said

Recommends phyatt · 2013-03 · Stack Overflow · on “I have 4 days, should I learn QT or Java swing?”

Qt is my vote, too. The examples and info in the links below should get you well on your way to your solution. [this video] [LINK] [LINK] PS, After installing Qt and Qt Creator, it has fantastic documentation and great examples and tutorials easily accessed from the IDE, on the Welcome tab.

Recommends NG_ · 2014-04 · Stack Overflow · on “Is there an alternative to Cocoa Sourceview for Qt on Mac?”

In general case you must understand that SourceView is program written using Objective-C/Cocoa. So you can't find exactly same program written using C++/Qt. But, if you reduce your requirements, you can find some components and even programs written using C++/Qt that can fit your needs. As quick answer, I say that you need to write all by hand. But you can find lot of ready to use components and source code snippets. Take a look at Qt Model/View programming [LINK] approach. There is QFileSystemModel [LINK] . Dig in that direction. Also, there are lot of resources to read about such kind of programming: Simple file explorer using the QFilesystemModel along with a QTreeview and a QListview [VI

Recommends IAmInPLS · 2016-04 · Stack Overflow · on “Custom file system implementation in Qt”

This video might be convenient for you : [this video] It basically explains how to build your own QFileSystemModel [LINK] .

Recommends Ervin Szilagyi · 2017-03 · Stack Overflow · on “How to upload Mp3 files on Qt (QMediaPlayer)?”

QMediaPlayer has a setMedia method which can accept a path to you local .mp3 file. It can be used like this. QMediaPlayer *player = new QMediaPlayer; player->setMedia(QUrl::fromLocalFile("C:\mycoolsong.mp3")); I guess you want to build something like a file explorer from where the user can select from multiple songs. There is a great tutorial for this here: C++ Qt 49 - QFileSystemModel a simple file explorer example [this video]

Recommends Bilal Can · 2023-02 · Stack Overflow · on “Use QListWidget frontend with QTreeWidget backend PyQt”

You can have a look at this video [this video] This is very helpful and the exact answer. This is just in cpp but the implementation should be 90% the same.

Cites mozzbozz · 2012-02 · Stack Overflow · on “Simple File browser / file chooser in Python program with Qt-GUI?”

I'm currently trying to implement some kind of file browser / "explorer" into a programme... I'm using Python and PySide in connection with the Qt-window-toolkit. More or less this youtube-video [this video] shows the behaviour I want to have at the end. However, this tutorial used C++ as programming language and I haven't been able yet to reason the right python code from the C++ example. Basically, my problem is to get the right column (file view) showing the content of the folder clicked in the left column (tree-style folder view). #!/usr/bin/env python # -*- coding: utf-8 -*- import sys from PySide import QtGui, QtCore class MainWindow(QtGui.QMainWindow): def __init__(self): QtGui.QMainWindow

Cites pureooze · 2013-01 · Stack Overflow · on “Qt: Display Filesystem in A Customized Way inside QTreeView”

Forgive me if I misunderstood your question, but I think you are looking for something similar to this [this video]

Cites beneminzl · 2014-09 · Stack Overflow · on “PyQt5 Filebrowser Signal-Slot: connecting QTreeView to QColumnview”

I want to create a little Filebrowser as described here, but by using PyQt5: [this video] So far the Layout is working fine. Now I would like to implement the function that the files show up on the left QColumnView. Meaning the files of the clicked folder in the QTreeView can be seen on the right File-QColumnView. I don't get the point of how to create the right signal to set the pathindex for the QFileSystemModel of the QColumnView. Besides, it would be nicer if i could only show one (the name) column of the Folder-QTreeView. Here is the code for the Browser: from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5.QtWidgets import QTreeView, QFileSystemModel, QApplication, QColumnView, QDockWidget