当前位置: 首页>>代码示例>>C++>>正文


C++ QDir::separator方法代码示例

本文整理汇总了C++中QDir::separator方法的典型用法代码示例。如果您正苦于以下问题:C++ QDir::separator方法的具体用法?C++ QDir::separator怎么用?C++ QDir::separator使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QDir的用法示例。


在下文中一共展示了QDir::separator方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: checkDirWritable

bool MainWindow::checkDirWritable( const QDir &d )
{
    QMessageBox *mb = new QMessageBox;
    if( !d.exists() )
    {
        mb->setText( "The directory you have chosen doesn't exist.");
        mb->show();
        return false;
    }

    QTemporaryFile tf( d.absolutePath() + d.separator() + "fbp_test_XXXXXX" );
    if( !tf.open() )
    {
        mb->setText( "The directory you have chosen does not seem to be writable.");
        mb->show();
        return false;
    }

    tf.remove();
    return true;
}
开发者ID:Jille,项目名称:FBP,代码行数:21,代码来源:mainwindow.cpp

示例2: loadSettings


//.........这里部分代码省略.........
    if (!mainSettings->contains("browser/startup_load_delayed")) {
        mainSettings->setValue("browser/startup_load_delayed", true);
    }
    if (!mainSettings->contains("browser/startup_load_delay")) {
        mainSettings->setValue("browser/startup_load_delay", 100);
    }

    if (!mainSettings->contains("browser/disable_hotkeys")) {
        mainSettings->setValue("browser/disable_hotkeys", false);
    }


    if (!mainSettings->contains("signals/enable")) {
        mainSettings->setValue("signals/enable", true);
    }
    if (!mainSettings->contains("signals/SIGUSR1")) {
        mainSettings->setValue("signals/SIGUSR1", "");
    }
    if (!mainSettings->contains("signals/SIGUSR2")) {
        mainSettings->setValue("signals/SIGUSR2", "");
    }


    if (!mainSettings->contains("inspector/enable")) {
        mainSettings->setValue("inspector/enable", false);
    }
    if (!mainSettings->contains("inspector/visible")) {
        mainSettings->setValue("inspector/visible", false);
    }


    if (!mainSettings->contains("event-sounds/enable")) {
        mainSettings->setValue("event-sounds/enable", false);
    }
    if (!mainSettings->contains("event-sounds/window-clicked")) {
        mainSettings->setValue("event-sounds/window-clicked", RESOURCES"window-clicked.ogg");
    }
    if (!mainSettings->contains("event-sounds/link-clicked")) {
        mainSettings->setValue("event-sounds/link-clicked", RESOURCES"window-clicked.ogg");
    }

    if (!mainSettings->contains("cache/enable")) {
        mainSettings->setValue("cache/enable", false);
    }
    if (!mainSettings->contains("cache/location")) {
#ifdef QT5
        QString location = QStandardPaths::writableLocation(QStandardPaths::CacheLocation);
#else
        QString location = QDesktopServices::storageLocation(QDesktopServices::CacheLocation);
#endif
        QDir d = QDir(location);
        location += d.separator();
        location += mainSettings->value("application/name").toString();
        d.setPath(location);
        mainSettings->setValue("cache/location", d.absolutePath());
    }
    if (!mainSettings->contains("cache/size")) {
        mainSettings->setValue("cache/size", 100*1000*1000);
    }
    if (!mainSettings->contains("cache/clear-on-start")) {
        mainSettings->setValue("cache/clear-on-start", false);
    }
    if (!mainSettings->contains("cache/clear-on-exit")) {
        mainSettings->setValue("cache/clear-on-exit", false);
    }

    if (!mainSettings->contains("printing/enable")) {
        mainSettings->setValue("printing/enable", false);
    }
    if (!mainSettings->contains("printing/show-printer-dialog")) {
        mainSettings->setValue("printing/show-printer-dialog", false);
    }
    if (!mainSettings->contains("printing/printer")) {
        mainSettings->setValue("printing/printer", "default");
    }
    if (!mainSettings->contains("printing/page_margin_left")) {
        mainSettings->setValue("printing/page_margin_left", 5);
    }
    if (!mainSettings->contains("printing/page_margin_top")) {
        mainSettings->setValue("printing/page_margin_top", 5);
    }
    if (!mainSettings->contains("printing/page_margin_right")) {
        mainSettings->setValue("printing/page_margin_right", 5);
    }
    if (!mainSettings->contains("printing/page_margin_bottom")) {
        mainSettings->setValue("printing/page_margin_bottom", 5);
    }

    if (!mainSettings->contains("attach/javascripts")) {
        mainSettings->setValue("attach/javascripts", "");
    }
    if (!mainSettings->contains("attach/styles")) {
        mainSettings->setValue("attach/styles", "");
    }
    if (!mainSettings->contains("view/hide_mouse_cursor")) {
        mainSettings->setValue("view/hide_mouse_cursor", false);
    }

    mainSettings->sync();
}
开发者ID:noname007,项目名称:qt-webkit-kiosk,代码行数:101,代码来源:mainwindow.cpp


注:本文中的QDir::separator方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。