本文整理汇总了C++中QTextBrowser::setHorizontalScrollBarPolicy方法的典型用法代码示例。如果您正苦于以下问题:C++ QTextBrowser::setHorizontalScrollBarPolicy方法的具体用法?C++ QTextBrowser::setHorizontalScrollBarPolicy怎么用?C++ QTextBrowser::setHorizontalScrollBarPolicy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QTextBrowser
的用法示例。
在下文中一共展示了QTextBrowser::setHorizontalScrollBarPolicy方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QWidget
TmainHelp::TmainHelp(QWidget* parent) :
QWidget(parent)
{
int pixSize = getPixSize();
QString bbrEnd = QLatin1String("</b><br>");
QString nbsp3 = QLatin1String(" ");
QString helpTxt = QLatin1String("<br><b>") + QApplication::translate("TmainHelp", "Using Nootka may be divided into three stages:", "Don't try to translate the entries in this context/section too strict, rather use some nice words into your language to describe it. The statements like '%1' are images(icons) inside the text");
helpTxt += QLatin1String("</b><table><tr><td> </td><td><hr><b>");
helpTxt += QApplication::translate("TmainHelp", "I. Discovering") + bbrEnd;
helpTxt += QApplication::translate("TmainHelp", "Exploring the interface of Nootka and how musical scores work. Just click on elements of the interface to see and get to know Nootka. Also, you can play or sing if you have a mic or web-cam.") + "<br>";
helpTxt += QApplication::translate("TmainHelp", "Press %1 buttons to see help and %2 button to adjust Nootka to your preference.").
arg(nbsp3 + pixToHtml(Tpath::img("logo"), pixSize * 2.2) + QLatin1String(" <span style=\"font-size: x-large;\"> + </span> ")
+ pixToHtml(Tpath::img("help"), pixSize) + nbsp3).
arg(nbsp3 + pixToHtml(Tpath::img("systemsettings"), pixSize) + nbsp3);
helpTxt += ThelpDialogBase::onlineDocP("getting-started");
helpTxt += "<hr><b>" + QApplication::translate("TmainHelp", "II. Exercises and exams") + bbrEnd;
helpTxt += exerciseAndExamText();
helpTxt += ThelpDialogBase::onlineDocP("exercises");
helpTxt += QLatin1String("<hr><b>") + QApplication::translate("TmainHelp", "III. Analyzing") + bbrEnd;
#if defined (Q_OS_ANDROID)
helpTxt += QLatin1String("This feature isn't ready yet in Android version.<br><b>You may transfer Nootka files to desktop computer and see the results in Nootka version there.");
#else
helpTxt += QApplication::translate("TmainHelp", "Nootka will tell you about what you've been thinking for so long... and about the progress you've been making so far....<br>Press %1 button to see and to analyze the results of your exams, find your weak points, and improve.").
arg(nbsp3 + pixToHtml(Tpath::img("charts"), pixSize) + nbsp3);
#endif
helpTxt += ThelpDialogBase::onlineDocP("analyze");
helpTxt += QLatin1String("</td></tr></table>");
helpTxt += QLatin1String("<hr><b><span style=\"font-size: xx-large;\"> ")
+ QApplication::translate("TmainHelp", "Have fun!") + QLatin1String("</span></b>");
QTextBrowser *helpEdit = new QTextBrowser(this);
helpEdit->setHtml(helpTxt);
helpEdit->setReadOnly(true);
helpEdit->setOpenExternalLinks(true);
helpEdit->setTextInteractionFlags(Qt::LinksAccessibleByKeyboard | Qt::LinksAccessibleByMouse);
QScroller::grabGesture(helpEdit->viewport(), QScroller::LeftMouseButtonGesture);
#if defined (Q_OS_ANDROID)
helpEdit->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
helpEdit->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
#endif
// qDebug() << helpEdit->toHtml();
auto lay = new QVBoxLayout;
lay->addWidget(helpEdit);
setLayout(lay);
}
示例2: strProduct
AboutDialog::AboutDialog(QWidget *parent)
: QDialog(parent)
{
QLabel* labelIcon = new QLabel(this);
labelIcon->setPixmap(qApp->windowIcon().pixmap(QSize(58, 58)));
#if defined Q_OS_MAC
QString strProduct("<span style=\"font-weight:bold;font-size:14px\">WizNote for Mac</span>");
#elif defined Q_OS_LINUX
QString strProduct("<span style=\"font-weight:bold;font-size:14px\">WizNote for Linux</span>");
#else
QString strProduct("<span style=\"font-weight:bold;font-size:14px\">WizNote for Windows</span>");
#endif
QLabel* labelProduct = new QLabel(this);
labelProduct->setText(strProduct);
QString strPath = QApplication::applicationDirPath();
QFileInfo fi(strPath);
QDateTime t = fi.lastModified();
QString strBuildNumber("(%1.%2.%3 %4:%5)");
strBuildNumber = strBuildNumber.\
arg(t.date().year()).\
arg(t.date().month()).\
arg(t.date().day()).\
arg(t.time().hour()).\
arg(t.time().minute());
QString strInfo = QString(tr("<span style=\"font-size:11px\">Version %2 %3</span>")).arg(WIZ_CLIENT_VERSION, strBuildNumber);
QLabel* labelBuild = new QLabel(this);
labelBuild->setText(strInfo);
QTextBrowser* textCredits = new QTextBrowser(this);
textCredits->setOpenExternalLinks(true);
textCredits->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
QString strHtml;
QFile file(":/credits.html");
if (file.open(QIODevice::ReadOnly | QIODevice::Text)) {
QTextStream stream(&file);
strHtml = stream.readAll();
file.close();
}
//Utils::Misc::loadUnicodeTextFromFile(":/credits.html", strHtml);
textCredits->setHtml(strHtml);
QLabel* labelCopyright = new QLabel(this);
labelCopyright->setText(tr("<span style=\"font-size:10px\">Copy Right 2013 Wiz inc. All rights reserved</span>"));
QVBoxLayout* layout = new QVBoxLayout(this);
layout->setContentsMargins(0, 10, 0, 10);
layout->addWidget(labelIcon);
layout->addWidget(labelProduct);
layout->addWidget(labelBuild);
layout->addWidget(textCredits);
layout->addWidget(labelCopyright);
layout->setAlignment(labelIcon, Qt::AlignCenter);
layout->setAlignment(labelProduct, Qt::AlignCenter);
layout->setAlignment(labelBuild, Qt::AlignCenter);
layout->setAlignment(textCredits, Qt::AlignCenter);
layout->setAlignment(labelCopyright, Qt::AlignCenter);
setWindowTitle(tr("About WizNote"));
}