blob: 4ebbb10bd0a2d60ad7d78b97d406e1e17c641393 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include <QDir>
#include <iostream>
int main(int argc, char *argv[])
{
QDir directory("Documents/Letters");
QString path = directory.filePath("contents.txt");
QString absolutePath = directory.absoluteFilePath("contents.txt");
std::cout << qPrintable(directory.dirName()) << std::endl;
std::cout << qPrintable(path) << std::endl;
std::cout << qPrintable(absolutePath) << std::endl;
return 0;
}
|