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


C++ QWebEngineView::setPage方法代码示例

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


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

示例1: page

QWebEnginePage* QWebEngineView::page() const
{
    Q_D(const QWebEngineView);
    if (!d->page) {
        QWebEngineView *that = const_cast<QWebEngineView*>(this);
        that->setPage(new QWebEnginePage(that));
    }
    return d->page;
}
开发者ID:elProxy,项目名称:qt-labs-qtwebengine,代码行数:9,代码来源:qwebengineview.cpp

示例2: QWebEngineView

QWebEngineView *VUtils::getWebEngineView(QWidget *p_parent)
{
    QWebEngineView *viewer = new QWebEngineView(p_parent);
    VPreviewPage *page = new VPreviewPage(viewer);
    page->setBackgroundColor(Qt::transparent);
    viewer->setPage(page);
    viewer->setZoomFactor(g_config->getWebZoomFactor());

    return viewer;
}
开发者ID:liunianbanbo,项目名称:vnote,代码行数:10,代码来源:vutils.cpp

示例3: main

int main(int argc, char *argv[])
{
    QApplication app(argc, argv);
    app.setQuitOnLastWindowClosed(false);
    app.setApplicationName("electric-webview");
    app.setApplicationVersion("1.0");

    QCommandLineParser cmdParser;
    cmdParser.setSingleDashWordOptionMode(QCommandLineParser::ParseAsCompactedShortOptions);
    cmdParser.setApplicationDescription("Electric WebView is a scriptable WebView for developers.");
    cmdParser.addHelpOption();
    cmdParser.addVersionOption();
    cmdParser.addOption(QCommandLineOption(QStringList() << "t" << "transport", "Command Transport Layer to use.", "tcp|unixsocket|websocket"));
    cmdParser.addOption(QCommandLineOption(QStringList() << "r" << "reverse", "Enable reverse mode. The ID is used to identify your session in the server.", "ID"));
    cmdParser.addOption(QCommandLineOption(QStringList() << "s" << "script", "Script to run.", "path"));
    cmdParser.process(app);

    if (cmdParser.value("transport").isEmpty()) {
        qDebug().noquote() << "You must provide a command transport layer";
        return -1;
    }

    CommandServer *commandServer = new CommandServer();
    commandServer->setTransport(cmdParser.value("transport"));
    commandServer->setReverse(cmdParser.isSet("reverse"));
    commandServer->setReverseId(cmdParser.value("reverse"));
    commandServer->initialize();

    QWebEngineView *webView = new QWebEngineView;
    webView->setPage(new WebPage);

    ElectricWebView::instance()->setWebView(webView);

    ElectricWebView::instance()->initialize();

    QObject::connect(commandServer, &CommandServer::newCommand, ElectricWebView::instance()->commandHandler(), &CommandHandler::processCommand);

    if (cmdParser.isSet("script"))
        ElectricWebView::instance()->runScript(cmdParser.value("transport"), cmdParser.value("script"));

    return app.exec();
}
开发者ID:gustavosbarreto,项目名称:electric-webview,代码行数:42,代码来源:main.cpp


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