本文整理汇总了C++中TextArea::setHtml方法的典型用法代码示例。如果您正苦于以下问题:C++ TextArea::setHtml方法的具体用法?C++ TextArea::setHtml怎么用?C++ TextArea::setHtml使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextArea
的用法示例。
在下文中一共展示了TextArea::setHtml方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: img
TupCrashWidget::TupCrashWidget(int sig) : QDialog(0), m_sig(sig)
{
setModal(true);
setWindowTitle(CHANDLER->title());
setWindowIcon(QPixmap(THEME_DIR + "icons/skull.png"));
m_layout = new QVBoxLayout(this);
m_tabber = new QTabWidget(this);
m_layout->addWidget(m_tabber);
QWidget *page1 = new QWidget;
QVBoxLayout *page1layout = new QVBoxLayout(page1);
QLabel *message = new QLabel("<font color="+CHANDLER->messageColor().name()+">"+ CHANDLER->message()+"</color>");
page1layout->addWidget(message);
QHBoxLayout *hbox = new QHBoxLayout;
QString text = CHANDLER->defaultText();
QImage img(CHANDLER->defaultImage());
if (CHANDLER->containsSignalEntry(sig)) {
text = CHANDLER->signalText(sig);
img = QImage(CHANDLER->signalImage(sig));
}
QLabel *sigImg = new QLabel;
sigImg->setPixmap(QPixmap::fromImage(img));
hbox->addWidget(sigImg);
TextArea *sigText = new TextArea();
sigText->setHtml(text);
hbox->addWidget(sigText);
page1layout->addLayout(hbox);
m_tabber->addTab(page1, tr("What's happening?"));
QPushButton *launch = new QPushButton(CHANDLER->launchButtonLabel(),this);
connect(launch, SIGNAL(clicked()), SLOT(restart()));
m_layout->addWidget(launch);
QPushButton *end = new QPushButton(CHANDLER->closeButtonLabel(),this);
connect(end, SIGNAL(clicked()), SLOT(exit()));
m_layout->addWidget(end);
setLayout(m_layout);
}
示例2: addBacktracePage
void TupCrashWidget::addBacktracePage(const QString &execInfo, const QString &backtrace)
{
#ifdef K_DEBUG
T_FUNCINFO << execInfo << " " << backtrace;
#endif
QWidget *btPage = new QWidget;
QVBoxLayout *layout = new QVBoxLayout(btPage);
layout->addWidget(new QLabel(tr("Executable information")));
TextArea *fileInfo = new TextArea;
fileInfo->setHtml(execInfo);
layout->addWidget(fileInfo);
layout->addWidget(new QLabel(tr("Backtrace")));
TextArea *btInfo = new TextArea;
btInfo->setHtml(backtrace);
layout->addWidget(btInfo);
m_tabber->addTab(btPage, tr("Backtrace"));
}