首页
学习
活动
专区
圈层
工具
发布
    • 综合排序
    • 最热优先
    • 最新优先
    时间不限
  • 来自专栏嵌入式项目开发

    QT软件开发: 获取下载、桌面、临时文件....等系统默认目录

    QT版本: 5.12.6 头文件: #include <QStandardPaths> 示例代码: qDebug()<<"系统字体目录路径:"<<QStandardPaths::standardLocations (QStandardPaths::FontsLocation); qDebug()<<"系统桌面目录路径:"<<QStandardPaths::standardLocations(QStandardPaths ()<<"用户图片目录路径:"<<QStandardPaths::standardLocations(QStandardPaths::PicturesLocation); qDebug()<<" 系统临时文件目录路径:"<<QStandardPaths::standardLocations(QStandardPaths::TempLocation); qDebug()<<"系统缓存目录路径 :"<<QStandardPaths::standardLocations(QStandardPaths::CacheLocation); qDebug()<<"系统下载目录路径:"<<QStandardPaths

    2.3K20编辑于 2022-01-12
  • 来自专栏Qt6 研发工程师

    Qt | 目录和文件路径常用函数大全

    03 QStandardPaths 是 Qt 框架中用于获取系统标准路径的类,它可以帮助你访问常见的系统目录(如文档、下载、配置等),跨平台兼容(Windows、Linux、macOS、Android/ ::StandardLocation>(); for(int i=0; i < m.keyCount(); ++i) { QStandardPaths::StandardLocation location = QStandardPaths::StandardLocation(m.value(i)); // 返回给定位置类型的本地化显示名称,如果找不到相关位置,则返回空QString paths << QPair<QString, QString>(m.valueToKey(m.value(i)), QStandardPaths::displayName(location)); paths << QPair<QString, QString>(m.valueToKey(m.value(i)), QStandardPaths::writableLocation(location)

    90510编辑于 2025-03-04
  • 来自专栏Linux驱动

    QT-QAxObject快速写入EXCEL示例

    4.写代码 #include <QApplication> #include "widget.h" #include <QtGui> #include <QAxObject> #include <QStandardPaths = 9 }; QString saveas() { QString file; QString filter; //如果版本低于QT5,则需要将: // QStandardPaths ::writableLocation(QStandardPaths::DesktopLocation), //改为:QDesktopServices::storageLocation(QDesktopServices ( NULL, //父组件 "另存为", //标题 QStandardPaths ::writableLocation(QStandardPaths::DesktopLocation), //设置路径, .表示当前路径,.

    6K10发布于 2019-05-24
  • 来自专栏Base_CDNKevin

    [Qt] 基于 Qt 的文件选择与图片显示功能实现

    ::writableLocation 获取系统中常用路径 lastPath = QStandardPaths::writableLocation(QStandardPaths::PicturesLocation QStandardPaths::writableLocation() 用于获取操作系统中特定类型的文件夹,例如图片、文档等。在这里当用户第一次打开程序时,程序会自动使用系统的图片目录作为初始路径。 ").toString(); // 如果没有上次记录的路径,使用系统默认的图片目录 if (lastPath.isEmpty()) { lastPath = QStandardPaths ::writableLocation(QStandardPaths::PicturesLocation); } // 打开文件选择对话框,初始路径设置为 lastPath QString ::writableLocation(QStandardPaths::PicturesLocation); } // 打开文件选择对话框,初始路径设置为 lastPath QString

    1.6K10编辑于 2024-10-06
  • 【图像区域识别改名】JPG的图片和扫描件如何区域识别重命名,并将区域内容保存为表格,基于QT和腾讯API的实现方案

    include <QFile> #include <QFileDialog> #include <QTableWidget> #include <QTableWidgetItem> #include <QStandardPaths QPushButton::clicked, [=]() { QStringList filePaths = QFileDialog::getOpenFileNames(this, "选择图片", QStandardPaths ::writableLocation(QStandardPaths::PicturesLocation), "JPEG Images (*.jpg)"); for (const QString void MainWindow::saveTableToCSV() { QString filePath = QFileDialog::getSaveFileName(this, "保存表格", QStandardPaths ::writableLocation(QStandardPaths::DocumentsLocation), "CSV Files (*.csv)"); if (!

    86410编辑于 2026-02-22
  • 来自专栏C++ 动态新闻推送

    C++ 中文周刊 第90期

    (this); nam->setStrictTransportSecurityEnabled(true); nam->enableStrictTransportSecurityStore(true, QStandardPaths ::writableLocation(QStandardPaths::CacheLocation) + QLatin1String("/hsts/")); SSL错误处理 QNetworkReply * QNetworkAccessManager(this); auto diskCache = new QNetworkDiskCache(nam); diskCache->setCacheDirectory(QStandardPaths ::writableLocation(QStandardPaths::CacheLocation) + QLatin1String("/http/")); nam->setCache(diskCache

    77320编辑于 2022-12-01
  • 来自专栏全栈程序员必看

    linux中如何杀掉一个进程_linux系统杀死所有进程命令

    sudo netease-cloud-music QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to ‘/tmp/runtime-root’ 05 sudo netease-cloud-music QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to ‘/tmp/runtime-root’ 05 Error ] [ 0] Player opening 已杀死 方法三: sudo pkill -9 netease-cloud 这个是方法二的延伸版本 sudo netease-cloud-music QStandardPaths

    3.7K10编辑于 2022-11-10
  • 来自专栏hank

    【分享】在MPSoC ZCU106单板的HDMI-Tx上基于eglfs_kms的运行QT应用程序

    错误1 QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/var/volatile/tmp/runtime-root' Setting framebuffer screen HDMI1 (Invalid argument) Could not queue DRM page flip on screen HDMI1 (Invalid argument) 错误2 QStandardPaths

    2.4K20发布于 2021-09-26
  • 来自专栏c++ 学习分享

    被QT5 抛弃的函数和用法

    member of  'QDesktopServices' error :  'DataLocation' is not a member of  'QDesktopServices' 使用QStandardPaths storageLocation ( QDesktopServices ::DataLocation ) ). toString ( ) ; 为 QString path  = s. value ( "db.path" ,QStandardPaths  :: standardLocations (QStandardPaths ::DataLocation ) ). toString ( ) ; QtMutimedia替换了Phonon 音频、

    1.1K30编辑于 2023-07-06
  • 来自专栏技术之路

    将某个Qt4项目升级到Qt5遇到的问题[转]

    以前使用QDesktopServices::storageLocation(QDesktopServices::xxxx)来获取一些系统目录,现在则要改成 QStandardPaths::writableLocation (QStandardPaths::xxxx) 7. 

    2.1K90发布于 2018-01-31
  • 来自专栏嵌入式项目开发

    QT应用编程: 导出QTableWidget数据写入到Execl表格

    )return; //获取保存的文件路径 QString filepath = QFileDialog::getSaveFileName(this, "选择保存文件名称", QStandardPaths ::writableLocation(QStandardPaths::DocumentsLocation), "Excel 文件(*.xls *.xlsx

    2.1K20编辑于 2022-01-07
  • 来自专栏hank

    【分享】在MPSoC上运行基于eglfs_kms的QT应用程序

    /textures QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/var/volatile/tmp/runtime-root' Setting /textures QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/var/volatile/tmp/runtime-root' Setting /textures QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/var/volatile/tmp/runtime-root' Setting /textures QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/var/volatile/tmp/runtime-root' Setting /textures QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/var/volatile/tmp/runtime-root' Setting

    7.2K31发布于 2020-12-16
  • 来自专栏生信菜鸟团

    从零开始用 PyQt5 写一个 scihub 下载器(二)

    self.ui.textEdit.setText(self.cb.text()) def buttClicked(self): try: curPath = QStandardPaths.writableLocation (QStandardPaths.DocumentsLocation) # 默认保存在 ~/Documents pdf_name = "/paper.pdf" # 默认文件名为 paper.pdf •踩过的坑:在 Qt 中, 当我们需要不调用 QFileDialog 保存文件时,得用 QStandardPaths 指定路径,否则打包出来的软件没法保存。

    1.2K10发布于 2020-11-03
  • 来自专栏Linux驱动

    53.Qt-QPdfWriter绘制PDF,支持表单输出

    //父组件 "另存为", //标题 QString("%1/%2").arg(QStandardPaths ::writableLocation(QStandardPaths::DesktopLocation)).arg(""+fileName+".pdf"),

    3.6K30发布于 2020-04-08
  • 来自专栏Qt6 研发工程师

    Qt | windows视频播放器小项目

    fileDialog.setMimeTypeFilters(supportedMimeTypes); // 设置MIME类型过滤 // 设置默认打开目录为视频目录或用户主目录 fileDialog.setDirectory(QStandardPaths ::standardLocations(QStandardPaths::MoviesLocation).value(0, QDir::homePath())); if (fileDialog.exec

    1.3K00编辑于 2024-10-28
  • 来自专栏python3

    Python3网络爬虫实战-11、爬虫框

    28.571306 [-] Xvfb is started: ['Xvfb', ':1599197258', '-screen', '0', '1024x768x24', '-nolisten', 'tcp'] QStandardPaths

    77500发布于 2020-01-03
  • 来自专栏嵌入式项目开发

    设计一款照片一键加水印的小工具

    LogSend(QString)),this,SLOT(Image_Log_Display(QString))); //获取系统图片目录的路径 QStringList dir_list=QStandardPaths ::standardLocations(QStandardPaths::PicturesLocation); if(dir_list.size()>0) { ui->lineEdit

    1.2K30编辑于 2022-04-08
  • 来自专栏技术之路

    Qt5 新特性

    QStandardPaths QStandardPaths 是 Qt4 的 QDesktopServices 的增强版,其 API 大部分基于 KDE4 的 KStandardDirs 。

    9.2K80发布于 2018-01-31
  • 来自专栏FPGA/ARM/DSP技术专栏

    创龙 瑞芯微 RK3562 国产 2GHz 四核A53 工业开发板—Qt工程编译说明

    备注:若打印警告信息"QStandardPaths: runtime directory…",忽略该信息即可,不影响程序运行。 Target# ./image_display .

    47510编辑于 2025-07-02
  • 来自专栏又见苍岚

    异常检测工具包 Anomalib

    it/s]QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root' failed to get the current

    5.7K20编辑于 2022-09-27
领券