本文整理汇总了C++中QTextBrowser::setFrameStyle方法的典型用法代码示例。如果您正苦于以下问题:C++ QTextBrowser::setFrameStyle方法的具体用法?C++ QTextBrowser::setFrameStyle怎么用?C++ QTextBrowser::setFrameStyle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QTextBrowser
的用法示例。
在下文中一共展示了QTextBrowser::setFrameStyle方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QDialog
/*!
Constructs a new about box on top of given \a parent window.
*/
AboutBox::AboutBox(QWidget * parent) : QDialog(parent)
{
setWindowTitle("About MaxCalc");
tstring labelText = _T("MaxCalc v");
labelText += Constants::VERSION;
labelText += _T(" (");
labelText += _T("built: ");
tstring date = stringToWideString(__DATE__);
labelText += date;
labelText += _T(")<br>");
labelText += Constants::COPYRIGHT;
labelText += _T("<br><a href='");
labelText += Constants::WEBSITE;
labelText += _T("'>");
labelText += Constants::WEBSITE;
labelText += _T("</a>");
QTextBrowser * label = new QTextBrowser;
label->setHtml(QString::fromWCharArray(labelText.c_str()));
label->setOpenExternalLinks(true);
label->setFrameStyle(QFrame::NoFrame);
QPalette p;
p.setColor(QPalette::Base, p.color(QPalette::Background));
label->setPalette(p);
label->setLineWrapMode(QTextEdit::NoWrap);
label->document()->adjustSize();
label->setMinimumSize(label->document()->size().toSize());
label->setMaximumSize(label->document()->size().toSize());
QPushButton * closeButton = new QPushButton;
closeButton->setText(tr("&Close"));
QGridLayout * layout = new QGridLayout;
layout->addWidget(label, 1, 0, 1, -1);
layout->addItem(new QSpacerItem(20, 10, QSizePolicy::Minimum,
QSizePolicy::Fixed), 2, 1, 1, 1);
layout->addItem(new QSpacerItem(20, 20,
QSizePolicy::Expanding), 3, 0, 1, 1);
layout->addWidget(closeButton, 3, 1, 1, 1);
layout->addItem(new QSpacerItem(20, 20,
QSizePolicy::Expanding), 3, 2, 1, 1);
setLayout(layout);
setMaximumSize(sizeHint());
setMinimumSize(sizeHint());
connect(closeButton, SIGNAL(clicked()), this, SLOT(close()));
}