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


C++ QTextBrowser::append方法代码示例

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


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

示例1: push_text

void ChatRoom::push_text(const char *from, const char *message, QString &msgid, bool me)
{
	QTextBrowser *text = ui->textBrowser;
	QString author;
	QString msg;
	author.sprintf("%s", from);
	if(!msgid.isEmpty()){
		author += "\tmsgid:" + msgid;
	}
	msg.sprintf("%s",message);
	text->append(author);
	text->append(msg);
}
开发者ID:dormclub,项目名称:tjphone,代码行数:13,代码来源:chatroom.cpp

示例2: main

int main(int argc, char ** argv) {
    using Q = QObject;
    QApplication app{argc, argv};
    QWidget ui;
    QVBoxLayout layout{&ui};
    QTextBrowser log;
    QProgressBar bar;
    QPushButton scan{"Scan localhost"};
    layout.addWidget(&log);
    layout.addWidget(&bar);
    layout.addWidget(&scan);
    bar.setRange(1, 65535);
    ui.show();

    Scanner scanner;
    Q::connect(&scan, &QPushButton::clicked, &scanner, [&]{
        scan.setEnabled(false);
        scanner.start();
    });
    Q::connect(&scanner, &Scanner::hasResult, &log, [&](int port, bool isOpen){
        bar.setValue(port);
        if (!isOpen) return;
        auto color = isOpen ? QStringLiteral("green") : QStringLiteral("red");
        auto state = isOpen ? QStringLiteral("open") : QStringLiteral("closed");
        log.append(QStringLiteral("<font color=\"%1\">Port %2 is %3.</font><br/>").
                   arg(color).arg(port).arg(state));
    });
    Q::connect(&scanner, &Scanner::done, &scan, [&]{
        bar.reset();
        scan.setEnabled(true);
    });
    return app.exec();
}
开发者ID:KubaO,项目名称:stackoverflown,代码行数:33,代码来源:main.cpp

示例3: dmesgTab

void MainWindow::dmesgTab()
{
    QTextBrowser *browser = new QTextBrowser(this);
    int index = ui->tabWidget->addTab(browser, tr("dmesg log"));
    ui->tabWidget->setTabIcon(index, QIcon::fromTheme("text-x-script"));
    ui->tabWidget->setCurrentIndex(index);
    QByteArray data = pro.readAllStandardOutput();
    browser->append(data);
}
开发者ID:,项目名称:,代码行数:9,代码来源:

示例4: on_ShowLog_triggered

void Tray::on_ShowLog_triggered() {
	QMainWindow *mw = new QMainWindow();
	mw->setAttribute(Qt::WA_DeleteOnClose);
	QTextBrowser *tb = new QTextBrowser();
	mw->setCentralWidget(tb);
	mw->setWindowTitle(QString::fromLatin1("Murmur -- %1").arg(MUMBLE_RELEASE));

	connect(le, SIGNAL(newLogEntry(const QString &)), tb, SLOT(append(const QString &)));

	foreach(const QString &m, qlLog)
		tb->append(m);

	mw->show();
}
开发者ID:TomDataworks,项目名称:whisper_client,代码行数:14,代码来源:Tray.cpp

示例5: setCharProperty

  int setCharProperty(GWEN_DIALOG_PROPERTY prop,
                      int index,
                      const char *value,
                      int doSignal) {
    QTextBrowser *qw;
    QString text;

    qw=(QTextBrowser*) GWEN_Widget_GetImplData(_widget, QT4_DIALOG_WIDGET_REAL);
    assert(qw);

    if (value)
      text=QT4_Gui::extractHtml(value);

    switch(prop) {
    case GWEN_DialogProperty_Value:
      qw->setText("");
      qw->append(text);
      return 0;

    case GWEN_DialogProperty_AddValue:
      qw->append(text);
      return 0;

    case GWEN_DialogProperty_ClearValues:
      qw->setText("");
      return 0;

    default:
      break;
    }

    DBG_WARN(GWEN_LOGDOMAIN,
             "Function is not appropriate for this type of widget (%s)",
             GWEN_Widget_Type_toString(GWEN_Widget_GetType(_widget)));
    return GWEN_ERROR_INVALID;
  };
开发者ID:Zauberstuhl,项目名称:gwenhywfar,代码行数:36,代码来源:w_textbrowser.cpp

示例6: doc

void MainWindow::doc()
{
    std::ifstream in;
    std::string s,line;

    in.open("doc/help",ios::in);
    while (getline(in,line)) {
        s += line + "\n";
    }
    in.close();
    QString qstr = QString::fromStdString(s);
    //img_label->setText(qstr);
    
    QTextBrowser *doc = new QTextBrowser();
    doc->append(qstr); 
    doc->show();
    doc->setDocumentTitle(tr("Help"));
}
开发者ID:fei-GitHub,项目名称:opencv_study,代码行数:18,代码来源:main_window.cpp

示例7: JmriJFrame


//.........这里部分代码省略.........
//                Desktop.getDesktop().open(new java.io.File(profile));
//            } catch (java.io.IOException e) {
//                XmlFileLocationAction.log.error("Error when opening profile location: " + e);
//            } catch (UnsupportedOperationException e) {
//                XmlFileLocationAction.log.error("Error when opening profile location: " + e);
//            }
//        }
//    });
    connect(b, SIGNAL(clicked(bool)), this, SLOT(on_openProfileButton()));
    b = new QPushButton("Open Settings Location");
    buttons->layout()->addWidget(b);
//    b.addActionListener(new ActionListener() {
//        @Override
//        /*public*/ void actionPerformed(ActionEvent event) {
//            try {
//                Desktop.getDesktop().open(new java.io.File(settings));
//            } catch (java.io.IOException e) {
//                XmlFileLocationAction.log.error("Error when opening settings location: " + e);
//            } catch (UnsupportedOperationException e) {
//                XmlFileLocationAction.log.error("Error when opening settings location: " + e);
//            }
//        }
//    });
    connect(b, SIGNAL(clicked(bool)), this, SLOT(on_openSettingsButton()));
    b = new QPushButton("Open Scripts Location");
    buttons->layout()->addWidget(b);
//    b.addActionListener(new ActionListener() {
//        @Override
//        /*public*/ void actionPerformed(ActionEvent event) {
//            try {
//                Desktop.getDesktop().open(new java.io.File(scripts));
//            } catch (java.io.IOException e) {
//                XmlFileLocationAction.log.error("Error when opening scripts location: " + e);
//            } catch (UnsupportedOperationException e) {
//                XmlFileLocationAction.log.error("Error when opening scripts location: " + e);
//            }
//        }
//    });
    connect(b, SIGNAL(clicked(bool)), this, SLOT(on_openScriptsButton(ActionEvent*)));
    b = new QPushButton("Open Program Location");
    buttons->layout()->addWidget(b);
//    b.addActionListener(new ActionListener() {
//        @Override
//        /*public*/ void actionPerformed(ActionEvent event) {
//            try {
//                Desktop.getDesktop().open(new java.io.File(prog));
//            } catch (java.io.IOException e) {
//                XmlFileLocationAction.log.error("Error when opening program location: " + e);
//            } catch (UnsupportedOperationException e) {
//                XmlFileLocationAction.log.error("Error when opening program location: " + e);
//            }
//        }
//    });
    connect(b, SIGNAL(clicked(bool)), this, SLOT(on_openProgramButton()));
    b = new QPushButton("Open Log Files Location");
    buttons->layout()->addWidget(b);
//    b.addActionListener(new ActionListener() {
//        @Override
//        /*public*/ void actionPerformed(ActionEvent event) {
//            try {
//                Desktop.getDesktop().open(new java.io.File(log));
//            } catch (java.io.IOException e) {
//                XmlFileLocationAction.log.error("Error when opening log files location: " + e);
//            } catch (UnsupportedOperationException e) {
//                XmlFileLocationAction.log.error("Error when opening log files location: " + e);
//            }
//        }
//    });
    connect(b, SIGNAL(clicked(bool)), this, SLOT(on_openLogFilesButton()));

    //QScrollArea* scroll = new JScrollPane(pane);
    //frame.getContentPane().add(scroll);
    //QVBoxLayout* thisLayout = new QVBoxLayout(frame->getContentPane());

    QTextBrowser* textPane = new QTextBrowser();
    //textPane->setEditable(false);
    pane->layout()->addWidget(textPane);
    frame->getContentPane()->layout()->addWidget(pane);

    textPane->append("User Files Location: " + user + "\n");

    textPane->append("Roster Location: " + roster + "\n");

    textPane->append("Profile Location: " + profile + "\n");

    textPane->append("Settings Location: " + settings + "\n");

    textPane->append("Current Config file: " + configName + "\n");

    textPane->append("Scripts Location: " + scripts + "\n");

    textPane->append("Program Location: " + prog + "\n");

    textPane->append("Log Files Location: " + log + "\n");

    addLogFiles(textPane, log);

    frame->adjustSize();
    frame->setVisible(true);
}
开发者ID:allenck,项目名称:DecoderPro_app,代码行数:101,代码来源:xmlfilelocationaction.cpp

示例8: print

void ConsoleOutput::print(QString msg, QString programTitle)
{
	QTextBrowser* browser = tab(programTitle);
	browser->append(msg);
}
开发者ID:CBRUhelsinki,项目名称:CENTplatform,代码行数:5,代码来源:ConsoleOutput.cpp


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