English 中文(简体)
2. 与Qt[复制]建造FS道路的交叉途径
原标题:Cross-platform way of constructing an FS path with Qt [duplicate]
This question already has an answer here:
Closed 10 years ago.

Possible Duplicate:
Qt equivalent of PathAppend?

短篇故事:Qt 4是否具有类似于os.path.join?

长期故事: 我需要在申请目录上添加一条相对的道路,QCoreApplication:applicationDirPath() in the Right Way (TM),从而使该代码不取决于档案系统目录的特性。

是否只是加入QString,使用“/”作为分离者,这是一个好的解决办法?

最佳回答

您可以使用“/”直接使用或使用QDir:separator(。 但一般使用(将“/”翻译到平台上,供您使用)。

问题回答

https://doc.qt.io/archives/4.6/qdir.html#details”rel=“noreferer”QDir 文件

www.un.org/Depts/DGACM/index_spanish.htm Qt使用“/”作为通用名录,其方式与“/”作为在URLs的一条道路分离器。 如果你总是使用“/”作为名录分离器,Qt将翻译你的道路,使之符合基本的操作系统。

因此,我猜测<代码>QDir将有助于你。

Just use "/" when staying in the Qt world. To convert the path for non-Qt classes and functions etc., use QDir::toNativeSeparators( path ).





相关问题
Undefined reference

I m getting this linker error. I know a way around it, but it s bugging me because another part of the project s linking fine and it s designed almost identically. First, I have namespace LCD. Then I ...

C++ Equivalent of Tidy

Is there an equivalent to tidy for HTML code for C++? I have searched on the internet, but I find nothing but C++ wrappers for tidy, etc... I think the keyword tidy is what has me hung up. I am ...

Template Classes in C++ ... a required skill set?

I m new to C++ and am wondering how much time I should invest in learning how to implement template classes. Are they widely used in industry, or is this something I should move through quickly?

Print possible strings created from a Number

Given a 10 digit Telephone Number, we have to print all possible strings created from that. The mapping of the numbers is the one as exactly on a phone s keypad. i.e. for 1,0-> No Letter for 2->...

typedef ing STL wstring

Why is it when i do the following i get errors when relating to with wchar_t? namespace Foo { typedef std::wstring String; } Now i declare all my strings as Foo::String through out the program, ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

Window iconification status via Xlib

Is it possible to check with the means of pure X11/Xlib only whether the given window is iconified/minimized, and, if it is, how?

热门标签