本文整理汇总了C++中FileNode::fileInfo方法的典型用法代码示例。如果您正苦于以下问题:C++ FileNode::fileInfo方法的具体用法?C++ FileNode::fileInfo怎么用?C++ FileNode::fileInfo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileNode
的用法示例。
在下文中一共展示了FileNode::fileInfo方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: treeViewContextMenuRequested
void FileSystemWidget::treeViewContextMenuRequested(const QPoint &pos)
{
QMenu *contextMenu = 0;
QModelIndex index = m_tree->indexAt(pos);
if (index.isValid()) {
FileNode *node = m_model->nodeFromIndex(index);
if (node) {
m_contextInfo = node->fileInfo();
m_contextIndex = index;
if (node->isDir()) {
contextMenu = m_folderMenu;
if (m_model->isRootPathNode(node)) {
m_closeFolerAct->setVisible(true);
m_removeFolderAct->setVisible(false);
} else {
m_closeFolerAct->setVisible(false);
m_removeFolderAct->setVisible(true);
}
} else {
contextMenu = m_fileMenu;
}
}
} else {
contextMenu = m_rootMenu;
}
if (contextMenu && contextMenu->actions().count() > 0) {
contextMenu->popup(m_tree->mapToGlobal(pos));
}
}
示例2: pathIndexChanged
void FileSystemWidget::pathIndexChanged(const QModelIndex & index)
{
FileNode *node = m_model->nodeFromIndex(index);
if (node) {
QFileInfo info = node->fileInfo();
QModelIndex newIndex = index;
if (info.isDir()) {
newIndex = index;
} else {
newIndex = index.parent();
}
this->setStartIndex(newIndex);
}
}
示例3: treeViewContextMenuRequested
void FileSystemWidget::treeViewContextMenuRequested(const QPoint &pos)
{
QModelIndex index = m_tree->indexAt(pos);
if (!index.isValid()) {
return;
}
FileNode *node = m_model->nodeFromIndex(index);
if (!node) {
return;
}
m_contextInfo = node->fileInfo();
m_contextIndex = index;
QMenu *contextMenu = 0;
if (node->isDir()) {
contextMenu = m_folderMenu;
} else {
contextMenu = m_fileMenu;
}
if (contextMenu && contextMenu->actions().count() > 0) {
contextMenu->popup(m_tree->mapToGlobal(pos));
}
}