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


C++ QPlainTextEdit::show方法代码示例

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


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

示例1: test_answer

void Authorization::test_answer(QNetworkReply *reply)
{
    QStringList html;
    while (!reply->atEnd())
        html << QString(reply->readLine());
    QPlainTextEdit *text = new QPlainTextEdit();
    text->appendPlainText(html.join('\n'));
    QStringList headers;
    QList<QByteArray> headerList = reply->request().rawHeaderList();
    foreach (QByteArray header, headerList)
        headers << QString(header+"\t"+reply->request().rawHeader(header));

    text->appendPlainText(headers.join('\n'));

    headerList = reply->rawHeaderList();
    foreach (QByteArray header, headerList)
        headers << QString(header+"\t"+reply->rawHeader(header));

    text->appendPlainText(headers.join('\n'));

    text->appendPlainText(reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toString());
    text->appendPlainText(reply->errorString());
    text->show();

    if (reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt() == 302) {
        QNetworkAccessManager *manager = new QNetworkAccessManager(this);
        QNetworkRequest request(QUrl(reply->rawHeader("Location")));
        request.setHeader(QNetworkRequest::CookieHeader, reply->header(QNetworkRequest::SetCookieHeader));
        manager->get(request);
        connect(manager, SIGNAL(finished(QNetworkReply*)), SLOT(test_answer(QNetworkReply*)));
        connect(manager, SIGNAL(finished(QNetworkReply*)), manager, SLOT(deleteLater()));
    }
}
开发者ID:codingworkshopru,项目名称:qt-projects,代码行数:33,代码来源:authorization.cpp

示例2: main

//! [46]
int main(int argc, char **argv)
{
    QApplication app(argc, argv);

    QScriptEngine eng;
    QPlainTextEdit edit;

    QScriptValue fun = eng.newFunction(myPrintFunction);
    fun.setData(eng.newQObject(&edit));
    eng.globalObject().setProperty("print", fun);

    eng.evaluate("print('hello', 'world')");

    edit.show();
    return app.exec();
}
开发者ID:NikhilNJ,项目名称:screenplay-dx,代码行数:17,代码来源:doc_src_qtscript.cpp

示例3: main

int main(int argc, char ** argv) {
   QApplication app{argc, argv};
   WhatsThisSignaler sig;
   QPlainTextEdit w;
   w.setWindowFlags(Qt::WindowContextHelpButtonHint | Qt::WindowCloseButtonHint);
   w.setMinimumSize(200, 200);
   w.setReadOnly(true);
   w.show();
   sig.installOn(&w);
   QObject::connect(&sig, &WhatsThisSignaler::whatsThisEvent, &w, [&w](QWidget*widget, QEvent*ev){
      w.appendPlainText(QStringLiteral("%1(0x%2) \"%3\" QEvent::%4")
                        .arg(widget->metaObject()->className())
                        .arg((uintptr_t)widget, 0, 16)
                        .arg(widget->objectName())
                        .arg(toName(ev->type())));
   });
   return app.exec();
}
开发者ID:KubaO,项目名称:stackoverflown,代码行数:18,代码来源:main.cpp


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