c++ - QFileDialog 在重启后只工作一次(否则打印错误)

标签 c++ qt qfiledialog

问题

我使用 QFileDialog。它运行良好,突然我的问题出现了。

重新启动后,下面给出的代码按预期工作。然后,如果我关闭应用程序并重新启动它,模式窗口需要很长时间才能出现并且从不显示文件夹。

一段时间后(5-10 秒)出现一个弹出窗口,内容如下:“[错误] 处理文件协议(protocol)的进程意外停止”(我的是用法语写的)

有人遇到过吗?

编辑:错误前的最后一行调试

当它工作时(重启后)我启动应用程序,当我退出它时,调试读取

Cancelled FAM (Req 2) for "/media/Donnees/Videos_tmp"
Cancelled FAM (Req 1) for "/media/Donnees"

我认为问题出在这两行。

系统

ArchLinux 3.16.1

代码示例:

int main(int argc, char *argv[])
{
    QApplication app(argc, argv);
    MainWindow l_mainWindow;
    l_mainWindow.show();
    QString l_folder = QFileDialog::getOpenFileName();
    qDebug() << l_folder;
    return app.exec();
}

控制台信息

QInotifyFileSystemWatcherEngine::addPaths: inotify_add_watch failed: Aucun fichier ou dossier de ce type
QObject::connect: No such signal org::freedesktop::UPower::DeviceAdded(QString)
QObject::connect: No such signal org::freedesktop::UPower::DeviceRemoved(QString)
"L'URL ne peut être listée
trash:/"
"L'URL ne peut être listée
trash:/"
Added Dir "/media/Donnees/Documents/Projets/" for "" ["KDirWatch-1"]
 Setup FAM (Req 1) for "/media/Donnees/Documents/Projets/"
Added Dir "/media/Donnees/Documents/Projets/subfold" for "" ["KDirWatch-1"]
 Setup FAM (Req 2) for "/media/Donnees/Documents/Projets/subfold"
Cancelled FAM (Req 1) for "/media/Donnees/Documents/Projets/"
QFileInfo::absolutePath: Constructed with empty filename
QFileInfo::absolutePath: Constructed with empty filename
QFileInfo::absolutePath: Constructed with empty filename
QFileInfo::absolutePath: Constructed with empty filename
QFileInfo::absolutePath: Constructed with empty filename
QFileInfo::absolutePath: Constructed with empty filename
QFileInfo::absolutePath: Constructed with empty filename
QFileInfo::absolutePath: Constructed with empty filename
QFileInfo::absolutePath: Constructed with empty filename
Trying to open ksycoca from "/home/olivier/.cache/ksycoca5"
KServiceTypeTrader: serviceType "KNotify/NotifyMethod" not found
Got configs "knotifications5/plasma_workspace.notifyrc" "plasma_workspace.notifyrc"
Got groups ()
Got notification " "messageCritical" " with actions: ""
QFileInfo::absolutePath: Constructed with empty filename
QFileInfo::absolutePath: Constructed with empty filename
QFileInfo::absolutePath: Constructed with empty filename
QFileInfo::absolutePath: Constructed with empty filename
QFileInfo::absolutePath: Constructed with empty filename
QFileInfo::absolutePath: Constructed with empty filename

最佳答案

好吧,就是这样......

我的 kf5 (=kde5) 和 kde4 有冲突。由于我删除了kf5框架,错误消失了。

谢谢大家抽出时间

关于c++ - QFileDialog 在重启后只工作一次(否则打印错误),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25720988/

相关文章:

c++ - 为什么我得到输出空白?

c++ - (C++) 序列化我的客户数据库的最佳方式?

c++ - Qt 文件对话框在重新启动项目后不记得最后一个目录

c++ - WHOIS 中的奇怪网络路径

c++ - 非常基本的文件输入/输出

qt - 使用 Qt 压缩文件夹/文件

qt - 自定义 QTreeView 项目的复选框

C++/QT - QFileDialog::getOpenFileName 过滤器 *.xml 禁用名称中包含日文字符的文件

qt - QFileDialog : how to set option to show content of folder in getExistingDirectory()

c++ - 使用 at<float>(i, j) 访问 cv::Mat 的元素。是 (x,y) 还是 (row,col)?