Qt 文件对话框渲染不正确并崩溃 [英] Qt File Dialog Rendered Incorrectly and Crashes

查看:50
本文介绍了Qt 文件对话框渲染不正确并崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 QFileDialog::getOpenFileName 函数来打开一个文件.但是,在运行 Windows 7 的客户端计算机上,这要么显示已损坏的打开文件对话框(如屏幕截图所示),要么使整个应用程序崩溃.

I am using the QFileDialog::getOpenFileName function to get a file to open. However, on a client's computer running Windows 7 this either displays a corrupted open file dialog as shown in the screenshot, or crashes the entire application.

我用来打开文件对话框的代码是:

The code I use to open the file dialog is:

void MainWindow::on_action_triggered() {
    auto filename = QFileDialog::getSaveFileName(this, "Generate Report", "", "CSV files (*.csv)");

    if (filename.isEmpty()) {
        return;
    }

    // Do operations on filename...
}

我在 Visual Studio 2013 中使用 Qt 5.5.

I am using Qt 5.5 with Visual Studio 2013.

推荐答案

这种特殊情况下的问题最终是 Qt 与安装在客户端计算机上的戴尔备份和恢复软件不兼容,其中包括不兼容的外壳扩展.我使用的解决方案是删除备份和恢复软件,但听起来命名空间 Qt 也是一种替代方法.QTBUG-41416 中提供了更多信息.

The issue in this particular case ended up being an incompatibility between Qt and the Dell Backup and Recovery software installed on the client's computer, which included an incompatible shell extension. The solution I used was to remove the backup and recovery software, but it sounds like namespacing Qt is also an alternative. More information is available in QTBUG-41416.

这篇关于Qt 文件对话框渲染不正确并崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆