重启后QFileDialog只工作一次(否则会输出错误)

och*_*aud 5 c++ qt qfiledialog

问题

我使用QFileDialog.它工作得非常好,突然出现了我的问题.

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

片刻之后(5-10秒)会出现一个弹出窗口,其中显示的内容如下:"[错误]处理文件协议的过程意外停止"(我用法语写的)

有没有人经历过这个?

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

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

Cancelled FAM (Req 2) for "/media/Donnees/Videos_tmp"
Cancelled FAM (Req 1) for "/media/Donnees"
Run Code Online (Sandbox Code Playgroud)

我认为问题在于这两行.

系统

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();
}
Run Code Online (Sandbox Code Playgroud)

控制台信息

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
Run Code Online (Sandbox Code Playgroud)

och*_*aud 0

好吧,就是这样……

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

谢谢大家抽出时间