Extending Qt Creator Manual | FolderNode

Extending Qt Creator Manual 4.5.2

# FolderNode Class

(ProjectExplorer::FolderNode)

Header: | #include <FolderNode>
Inherits: | ProjectExplorer::Node
Inherited By: | ProjectExplorer::ProjectNode and ProjectExplorer::VirtualFolderNode

- List of all members, including inherited members

## Public Types

class | AddNewInformation
class | LocationInfo

## Public Functions

| FolderNode(const Utils::FileName &folderPath, NodeType nodeType = NodeType::Folder, const QString &displayName = QString(), const QByteArray &id = {})
| ~FolderNode() override
virtual QString | addFileFilter() const
virtual bool | addFiles(const QStringList &filePaths, QStringList *notAdded = 0)
void | addNestedNode(FileNode *fileNode, const Utils::FileName &overrideBaseDir = Utils::FileName(), const FolderNodeFactory &factory = []( const Utils::FileName & fn ) { return new FolderNode( fn ) ; })
void | addNestedNodes(const QList<FileNode *> &files, const Utils::FileName &overrideBaseDir = Utils::FileName(), const FolderNodeFactory &factory = []( const Utils::FileName & fn ) { return new FolderNode( fn ) ; })
virtual AddNewInformation | addNewInformation(const QStringList &files, Node *context) const
void | addNode(Node *node)
virtual bool | canRenameFile(const QString &filePath, const QString &newFilePath)
void | compress()
virtual bool | deleteFiles(const QStringList &filePaths)
FileNode * | fileNode(const Utils::FileName &file) const
QList<FileNode *> | fileNodes() const
Node * | findNode(const std::function<bool( Node * ) > &filter)
QList<Node *> | findNodes(const std::function<bool( Node * ) > &filter)
QList<FolderNode *> | folderNodes() const
void | forEachGenericNode(const std::function<void( Node * ) > &genericTask) const
void | forEachNode(const std::function<void( FileNode * ) > &fileTask, const std::function<void( FolderNode * ) > &folderTask = {}, const std::function<bool( const FolderNode * ) > &folderFilterTask = {}) const
QIcon | icon() const
bool | isAncesterOf(Node *n)
bool | isEmpty() const
const QList<LocationInfo> | locationInfo() const
const QList<Node *> | nodes() const
virtual bool | removeFiles(const QStringList &filePaths, QStringList *notRemoved = 0)
void | removeNode(Node *node)
virtual bool | renameFile(const QString &filePath, const QString &newFilePath)
bool | replaceSubtree(Node *oldNode, Node *newNode)
void | setDisplayName(const QString &name)
void | setIcon(const QIcon &icon)
void | setLocationInfo(const QList<LocationInfo> &info)
virtual bool | showInSimpleTree() const
virtual bool | showWhenEmpty() const

## Reimplemented Public Functions

virtual FolderNode * | asFolderNode() override
virtual const FolderNode * | asFolderNode() const override
virtual QString | displayName() const override
virtual bool | supportsAction(ProjectAction action, const Node *node) const override

- 27 public functions inherited from ProjectExplorer::Node

### Additional Inherited Members

- 3 static public members inherited from ProjectExplorer::Node
- 2 protected functions inherited from ProjectExplorer::Node

## Detailed Description

In-memory presentation of a folder. Note that the node itself + all children (files and folders) are "managed" by the owning project.

See also ProjectExplorer::FileNode and ProjectExplorer::ProjectNode.

## Member Function Documentation

### FolderNode::FolderNode(const Utils::FileName &folderPath, NodeType nodeType = NodeType::Folder, const QString &displayName = QString(), const QByteArray &id = {})

Default constructs an instance of FolderNode.

### FolderNode::~FolderNode()

Destroys the instance of FolderNode.

### `[virtual]` QString FolderNode::addFileFilter() const

### `[virtual]` bool FolderNode::addFiles(const QStringList &filePaths, QStringList *notAdded = 0)

### void FolderNode::addNestedNode(FileNode *fileNode, const Utils::FileName &overrideBaseDir = Utils::FileName(), const FolderNodeFactory &factory = []( const Utils::FileName & fn ) { return new FolderNode( fn ) ; })

### void FolderNode::addNestedNodes(const QList<FileNode *> &files, const Utils::FileName &overrideBaseDir = Utils::FileName(), const FolderNodeFactory &factory = []( const Utils::FileName & fn ) { return new FolderNode( fn ) ; })

### `[virtual]` AddNewInformation FolderNode::addNewInformation(const QStringList &files, Node *context) const

### void FolderNode::addNode(Node *node)

Adds a node specified by node to the internal list of nodes.

### `[override virtual]` FolderNode *FolderNode::asFolderNode()

### `[override virtual]` const FolderNode *FolderNode::asFolderNode() const

### `[virtual]` bool FolderNode::canRenameFile(const QString &filePath, const QString &newFilePath)

### void FolderNode::compress()

### `[virtual]` bool FolderNode::deleteFiles(const QStringList &filePaths)

### `[override virtual]` QString FolderNode::displayName() const

Reimplemented from Node::displayName().

Contains the display name that should be used in a view.

See also setDisplayName() and setFolderName().

### FileNode *FolderNode::fileNode(const Utils::FileName &file) const

### QList<FileNode *> FolderNode::fileNodes() const

### Node *FolderNode::findNode(const std::function<bool( Node * ) > &filter)

### QList<Node *> FolderNode::findNodes(const std::function<bool( Node * ) > &filter)

### QList<FolderNode *> FolderNode::folderNodes() const

### void FolderNode::forEachGenericNode(const std::function<void( Node * ) > &genericTask) const

### void FolderNode::forEachNode(const std::function<void( FileNode * ) > &fileTask, const std::function<void( FolderNode * ) > &folderTask = {}, const std::function<bool( const FolderNode * ) > &folderFilterTask = {}) const

### QIcon FolderNode::icon() const

Contains the icon that should be used in a view. Default is the directory icon (QStyle::S_PDirIcon). ssetIcon()

See also setIcon().

### bool FolderNode::isAncesterOf(Node *n)

### bool FolderNode::isEmpty() const

### const QList<LocationInfo> FolderNode::locationInfo() const

See also setLocationInfo().

### const QList<Node *> FolderNode::nodes() const

### `[virtual]` bool FolderNode::removeFiles(const QStringList &filePaths, QStringList *notRemoved = 0)

### void FolderNode::removeNode(Node *node)

Removes a node specified by node from the internal list of nodes. The node object itself is not deleted.

### `[virtual]` bool FolderNode::renameFile(const QString &filePath, const QString &newFilePath)

### bool FolderNode::replaceSubtree(Node *oldNode, Node *newNode)

### void FolderNode::setDisplayName(const QString &name)

See also displayName().

### void FolderNode::setIcon(const QIcon &icon)

See also icon().

### void FolderNode::setLocationInfo(const QList<LocationInfo> &info)

See also locationInfo().

### `[virtual]` bool FolderNode::showInSimpleTree() const

### `[virtual]` bool FolderNode::showWhenEmpty() const

### `[override virtual]` bool FolderNode::supportsAction(ProjectAction action, const Node *node) const