本文整理汇总了C++中FilePath::toNative方法的典型用法代码示例。如果您正苦于以下问题:C++ FilePath::toNative方法的具体用法?C++ FilePath::toNative怎么用?C++ FilePath::toNative使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FilePath
的用法示例。
在下文中一共展示了FilePath::toNative方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RuntimeError
XmlDomDocument::XmlDomDocument(const QByteArray& xmlFileContent, const FilePath& filepath) throw (Exception) :
mFilePath(filepath), mRootElement(nullptr)
{
QDomDocument doc;
doc.implementation().setInvalidDataPolicy(QDomImplementation::ReturnNullNode);
QString errMsg;
int errLine;
int errColumn;
if (!doc.setContent(xmlFileContent, &errMsg, &errLine, &errColumn))
{
QString line = xmlFileContent.split('\n').at(errLine-1);
throw RuntimeError(__FILE__, __LINE__, QString("%1: %2 [%3:%4] LINE:%5")
.arg(filepath.toStr(), errMsg).arg(errLine).arg(errColumn).arg(line),
QString(tr("Error while parsing XML in file \"%1\": %2 [%3:%4]"))
.arg(filepath.toNative(), errMsg).arg(errLine).arg(errColumn));
}
// check if the root node exists
QDomElement root = doc.documentElement();
if (root.isNull())
{
throw RuntimeError(__FILE__, __LINE__, QString(),
QString(tr("No XML root node found in \"%1\"!")).arg(/*xmlFilePath.toNative()*/QString()));
}
mRootElement = XmlDomElement::fromQDomElement(root, this);
}
示例2: QWizardPage
FirstRunWizardPage_WorkspacePath::FirstRunWizardPage_WorkspacePath(
QWidget* parent) noexcept
: QWizardPage(parent), mUi(new Ui::FirstRunWizardPage_WorkspacePath) {
mUi->setupUi(this);
registerField("CreateWorkspace", mUi->rbtnCreateWs);
registerField("CreateWorkspacePath", mUi->edtCreateWsPath);
registerField("OpenWorkspace", mUi->rbtnOpenWs);
registerField("OpenWorkspacePath", mUi->edtOpenWsPath);
FilePath defaultWsPath =
FilePath(QDir::homePath()).getPathTo("LibrePCB-Workspace");
mUi->edtCreateWsPath->setText(defaultWsPath.toNative());
mUi->edtOpenWsPath->setText(defaultWsPath.toNative());
if (workspace::Workspace::isValidWorkspacePath(defaultWsPath))
mUi->rbtnOpenWs->setChecked(true);
}
示例3: RuntimeError
FileParseError::FileParseError(const char* file, int line,
const FilePath& filePath, int fileLine,
int fileColumn,
const QString& invalidFileContent,
const QString& msg) noexcept
: RuntimeError(file, line,
QString("File parse error: %1\n\nFile: %2\nLine,Column: "
"%3,%4\nInvalid Content: \"%5\"")
.arg(msg)
.arg(filePath.toNative())
.arg(fileLine)
.arg(fileColumn)
.arg(invalidFileContent)) {
}