Error[8]: Undefined offset: 4, File: /www/wwwroot/outofmemory.cn/tmp/plugin_ss_superseo_model_superseo.php, Line: 121
File: /www/wwwroot/outofmemory.cn/tmp/plugin_ss_superseo_model_superseo.php, Line: 473, decode(

概述我有getSaveFileName和一些过滤器,我想在用户打开“保存”对话框时选择其中一个. Qt文档说明如下: The default filter can be chosen by setting selectedFilter to the desired value. 我尝试以下变体:QString selFilter='All files (*.

我有getSavefilename和一些过滤器,我想在用户打开“保存”对话框时选择其中一个. Qt文档说明如下:

The default filter can be chosen by setting selectedFilter to the desired value.

我尝试以下变体:

QString selFilter="All files (*.*)";QfileDialog::getSavefilename(this,"Save file",QDir::currentPath(),"Text files (*.txt);;All files (*.*)",&selFilter);

但是当对话框出现时,会选择“文本文件”过滤器(通常情况下,列表中的第一个过滤器).我也尝试了以下所有方法:

selFilter="All files";selFilter="All files (*.*)\n";selFilter="All files (*.*);;";selFilter="All files (*.*)"Images (*.png *.xpm *.jpg);;Text files (*.txt);;XML files (*.xml)"";

和这些变体的不同混合物.我的代码中的过滤器列表的格式是根据文档(来自Qt docs的示例行)完成的:

#include 

请注意,输出到selFilter变量的工作正常:用户按OK后,selFilter变量包含用户选择的过滤器.

平台:linux(OpenSUSE 12.1),Qt 4.7.4,gcc 4.6.2.

那么如何设置默认过滤器?!

最佳答案您可以尝试此示例应用程序并验证,如果它有任何区别.在这种情况下使用直接对话框构造时,您可以更好地控制对象.

[+++]

通常这种行为是内存损坏的标志.但是,我已经用valgrind检查过了(我有Qt 4.8.1)并且FontConfig只有一些误报. 总结

以上是内存溢出为你收集整理的c – QFileDialog :: getSaveFileName和默认的selectedFilter全部内容,希望文章能够帮你解决c – QFileDialog :: getSaveFileName和默认的selectedFilter所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

)
File: /www/wwwroot/outofmemory.cn/tmp/route_read.php, Line: 126, InsideLink()
File: /www/wwwroot/outofmemory.cn/tmp/index.inc.php, Line: 166, include(/www/wwwroot/outofmemory.cn/tmp/route_read.php)
File: /www/wwwroot/outofmemory.cn/index.php, Line: 30, include(/www/wwwroot/outofmemory.cn/tmp/index.inc.php)
c–QFileDialog :: getSaveFileName和默认的selectedFilter_系统运维_内存溢出

c–QFileDialog :: getSaveFileName和默认的selectedFilter

c–QFileDialog :: getSaveFileName和默认的selectedFilter,第1张

概述我有getSaveFileName和一些过滤器,我想在用户打开“保存”对话框时选择其中一个. Qt文档说明如下: The default filter can be chosen by setting selectedFilter to the desired value. 我尝试以下变体:QString selFilter='All files (*.

我有getSavefilename和一些过滤器,我想在用户打开“保存”对话框时选择其中一个. Qt文档说明如下:

The default filter can be chosen by setting selectedFilter to the desired value.

我尝试以下变体:

QString selFilter="All files (*.*)";QfileDialog::getSavefilename(this,"Save file",QDir::currentPath(),"Text files (*.txt);;All files (*.*)",&selFilter);

但是当对话框出现时,会选择“文本文件”过滤器(通常情况下,列表中的第一个过滤器).我也尝试了以下所有方法:

selFilter="All files";selFilter="All files (*.*)\n";selFilter="All files (*.*);;";selFilter="All files (*.*)"Images (*.png *.xpm *.jpg);;Text files (*.txt);;XML files (*.xml)"";

和这些变体的不同混合物.我的代码中的过滤器列表的格式是根据文档(来自Qt docs的示例行)完成的:

#include 

请注意,输出到selFilter变量的工作正常:用户按OK后,selFilter变量包含用户选择的过滤器.

平台:linux(OpenSUSE 12.1),Qt 4.7.4,gcc 4.6.2.

那么如何设置默认过滤器?!

最佳答案您可以尝试此示例应用程序并验证,如果它有任何区别.在这种情况下使用直接对话框构造时,您可以更好地控制对象.

通常这种行为是内存损坏的标志.但是,我已经用valgrind检查过了(我有Qt 4.8.1)并且FontConfig只有一些误报. 总结

以上是内存溢出为你收集整理的c – QFileDialog :: getSaveFileName和默认的selectedFilter全部内容,希望文章能够帮你解决c – QFileDialog :: getSaveFileName和默认的selectedFilter所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/1048651.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-25
下一篇 2022-05-25

发表评论

登录后才能评论

评论列表(0条)