本文整理汇总了C++中QLabel::setOpenExternalLinks方法的典型用法代码示例。如果您正苦于以下问题:C++ QLabel::setOpenExternalLinks方法的具体用法?C++ QLabel::setOpenExternalLinks怎么用?C++ QLabel::setOpenExternalLinks使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QLabel
的用法示例。
在下文中一共展示了QLabel::setOpenExternalLinks方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QVBoxLayout
AboutWidget::AboutWidget(QWidget *parent):QWidget(parent){
QVBoxLayout *mainLayout = new QVBoxLayout();
mainLayout->addWidget(new QLabel(tr("UDJ Player Client Version 0.5.0")));
mainLayout->addSpacing(1);
mainLayout->addWidget(new QLabel(tr("Written By Kurtis Nusbaum")));
mainLayout->addSpacing(1);
QLabel *issuesLabel = new QLabel(tr("Please report all bugs to the <a href=\"https://github.com/klnusbaum/UDJ-Desktop-Client/issues\" >UDJ issue tracker</a>"));
issuesLabel->setOpenExternalLinks(true);
mainLayout->addWidget(issuesLabel);
setLayout(mainLayout);
}
示例2: QLabel
//! @return The widget contained by the tab "Contributions"
QWidget *AboutQUCS::contributorsTab() const
{
QLabel *contributors = new QLabel();
// addAuthor(contributors, "Name Lastname", "[email protected]", tr("Whatever"));
contributors->setAlignment(Qt::AlignCenter);
contributors->setOpenExternalLinks(true);
contributors->setTextFormat(Qt::RichText);
return contributors;
}
示例3: Url
AboutDialog::AboutDialog(QWidget *parent) :
QDialog(parent)
{
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
setWindowTitle("About");
QGridLayout* layout = new QGridLayout(this);
layout->setSizeConstraint(QLayout::SetFixedSize);
const int SPACER_SIZE = 8;
const QString Url("<a href=\"%2\">%1</a>");
QLabel* iconLabel = new QLabel(this);
iconLabel->setPixmap(QPixmap(":/icons/icon64.png"));
iconLabel->setFixedSize(64 + 4, 64 + 4);
QLabel* applicationNameLabel = getLabel(AppInfo::name, 16, true, Qt::AlignLeft);
QLabel* versionLabel = getLabel(QString("version %1").arg(AppInfo::version), 8, false, Qt::AlignLeft);
QLabel* buildDateLabel = getLabel(QString("Build date: %1").arg(AppInfo::buildDate), 8, false, Qt::AlignLeft);
QLabel* iconsSourceLabel = getLabel(QString("%1 %2").arg("This application uses").arg(Url.arg("FatCow icons").arg("http://www.fatcow.com/free-icons")), 8, false, Qt::AlignLeft);
iconsSourceLabel->setOpenExternalLinks(true);
QLabel* licenseLabel = getLabel(QString("License: %1").arg(AppInfo::license), 8, false, Qt::AlignLeft);
QLabel* copyrightLabel = getLabel(QString("(c) %1, %2").arg(AppInfo::years).arg(Url.arg(AppInfo::author).arg(AppInfo::Url)), 8, false, Qt::AlignCenter);
copyrightLabel->setOpenExternalLinks(true);
layout->addWidget(iconLabel, 0, 0, 3, 1);
layout->addWidget(applicationNameLabel, 0, 1, 1, 2);
layout->addWidget(versionLabel, 1, 1, 1, 2);
layout->addWidget(buildDateLabel, 2, 1, 1, 2);
layout->addItem(new QSpacerItem(SPACER_SIZE, SPACER_SIZE), 3, 2, 1, 1);
layout->addWidget(iconsSourceLabel, 4, 0, 1, 3);
layout->addItem(new QSpacerItem(SPACER_SIZE, SPACER_SIZE), 5, 2, 1, 1);
layout->addWidget(licenseLabel, 6, 0, 1, 3);
layout->addItem(new QSpacerItem(SPACER_SIZE, SPACER_SIZE), 7, 2, 1, 1);
layout->addWidget(copyrightLabel, 8, 0, 1, 3);
}
示例4: createLink
QLabel* createLink(QString path)
{
QLabel *label = new QLabel();
label->setTextFormat(Qt::RichText);
label->setTextInteractionFlags(Qt::TextBrowserInteraction);
label->setOpenExternalLinks(true);
QString link("<a href=" + path + ">" + path + "</a>");
label->setText(link);
return label;
}
示例5: PopupWidget
LongMessageWidget::LongMessageWidget( QWidget *anchor, const QString &message,
Amarok::Logger::MessageType type )
: PopupWidget( anchor )
, m_counter( 0 )
, m_timeout( 6000 )
{
DEBUG_BLOCK
Q_UNUSED( type )
setFrameStyle( QFrame::StyledPanel | QFrame::Raised );
setContentsMargins( 4, 4, 4, 4 );
setMinimumWidth( 26 );
setMinimumHeight( 26 );
setSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding );
QPalette p = QToolTip::palette();
setPalette( p );
KHBox *hbox = new KHBox( this );
layout()->addWidget( hbox );
hbox->setSpacing( 12 );
m_countdownFrame = new CountdownFrame( hbox );
m_countdownFrame->setObjectName( "counterVisual" );
m_countdownFrame->setFixedWidth( fontMetrics().width( "X" ) );
m_countdownFrame->setFrameStyle( QFrame::Plain | QFrame::Box );
QPalette pal;
pal.setColor( m_countdownFrame->foregroundRole(), p.dark().color() );
m_countdownFrame->setPalette( pal );
QLabel *alabel = new QLabel( message, hbox );
alabel->setWordWrap( true );
alabel->setOpenExternalLinks( true );
alabel->setObjectName( "label" );
alabel->setTextFormat( Qt::RichText );
alabel->setSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::Preferred );
alabel->setPalette( p );
hbox = new KHBox( this );
layout()->addWidget( hbox );
KPushButton *button = new KPushButton( KStandardGuiItem::close(), hbox );
button->setObjectName( "closeButton" );
connect( button, SIGNAL( clicked() ), SLOT( close() ) );
reposition();
show();
m_timerId = startTimer( m_timeout / m_countdownFrame->height() );
}
示例6: releaseDate
MantidAbout::MantidAbout(QWidget *parent) : MantidQt::API::MantidDialog(parent)
{
m_uiForm.setupUi(this);
QLabel* releasedate = m_uiForm.release_datevalue;
QString releaseDate(Mantid::Kernel::MantidVersion::releaseDate());
releasedate->setText(releaseDate);
QString version(Mantid::Kernel::MantidVersion::version());
QLabel* releaseversion = m_uiForm.release_versionvalue;
releaseversion->setText(version);
QString release(Mantid::Kernel::MantidVersion::revision());
release.insert(0, "<p>");
release.append(" (<a href=\"http://github.com/mantidproject/mantid/commit/");
release.append(Mantid::Kernel::MantidVersion::revisionFull());
release.append("\">on github</a>)</p>");
QLabel* releaselabel = m_uiForm.revision_value;
releaselabel->setText(release);
releaselabel->setOpenExternalLinks(true);
QLabel* builtusing_labelvalue = m_uiForm.builtusing_labelvalue;
QString builtusing = "QtiPlot " + QString::number(maj_version) + "." + QString::number(min_version)
+ "." + QString::number(patch_version) + extra_version + " ";
builtusing += "Released: " + QString(release_date) + "<br>";
builtusing += QString(copyright_string);
builtusing_labelvalue->setText(builtusing);
QString mantidurl =
"<p><a href = http://www.mantidproject.org/Main_Page>http://www.mantidproject.org</a></p>";
QLabel* url = m_uiForm.mantidurl;
url->setText(mantidurl);
url->setOpenExternalLinks(true);
QString mantidDOI = QString::fromStdString("<p><a href = " +\
Mantid::Kernel::MantidVersion::doi() + ">" +\
Mantid::Kernel::MantidVersion::doi() + "</a></p>");
m_uiForm.mantiddoi->setText(mantidDOI);
m_uiForm.mantiddoi->setOpenExternalLinks(true);
}
示例7: QWidget
MainWidget::MainWidget(QWidget *parent)
: QWidget(parent)
{
QCoreApplication::setApplicationName(tr("HypnoVocabulary"));
QCoreApplication::setApplicationVersion(VERSION);
this->setWindowFlags(Qt::WindowTitleHint | Qt::WindowCloseButtonHint);
stripe_ = new Stripe;
buttonFont_ = new QPushButton(tr("Choose font"));
buttonFontColor_ = new QPushButton(tr("Choose font color"));
buttonBackgroundColor_ = new QPushButton(tr("Choose background color"));
QHBoxLayout *hl1 = new QHBoxLayout;
buttonOpenDictionary_ = new QPushButton(tr("Open dictionary"));
buttonReloadDictionary_= new QPushButton(tr("✅"));
hl1->addWidget(buttonOpenDictionary_);
hl1->addWidget(buttonReloadDictionary_);
QHBoxLayout *hl2 = new QHBoxLayout;
spinboxInterval_ = new QSpinBox();
spinboxInterval_->setValue(stripe_->interval());
spinboxInterval_->setRange(1,86400);
hl2->addWidget(new QLabel(tr("Interval (sec.)")));
hl2->addWidget(spinboxInterval_);
QFrame *f = new QFrame();
f->setFrameShape(QFrame::HLine);
QLabel *l = new QLabel(tr("HypnoVocabulary")+" "+QString("(%1)").arg(VERSION)+"<br><a href='http://github.com/rokashevich/hypnovocabulary'>github.com/rokashevich/hypnovocabulary</a>");
l->setOpenExternalLinks(true);
QVBoxLayout *vl = new QVBoxLayout;
vl->addWidget(buttonFont_);
vl->addWidget(buttonFontColor_);
vl->addWidget(buttonBackgroundColor_);
vl->addLayout(hl1);
vl->addLayout(hl2);
vl->addWidget(f);
vl->addWidget(l);
this->setLayout(vl);
tray_ = new QSystemTrayIcon();
tray_->setIcon(QIcon(":/hypnovocabulary.ico"));
tray_->show();
connect(buttonFont_, SIGNAL(clicked()), this, SLOT(onButtonFontClicked_()));
connect(buttonFontColor_, SIGNAL(clicked()), this, SLOT(onButtonFontColorClicked_()));
connect(buttonBackgroundColor_, SIGNAL(clicked()), this, SLOT(onButtonBackgroundColorClicked_()));
connect(buttonOpenDictionary_, SIGNAL(clicked()), this, SLOT(onButtonOpenDictionary_()));
connect(buttonReloadDictionary_, SIGNAL(clicked()), this, SLOT(onButtonReloadDictionary_()));
connect(tray_,SIGNAL(activated(QSystemTrayIcon::ActivationReason)),this,SLOT(toggle(QSystemTrayIcon::ActivationReason)));
connect(spinboxInterval_,SIGNAL(valueChanged(int)),this,SLOT(onIntervalClicked_(int)));
}
示例8: scmVersion
AboutDialog::AboutDialog(QWidget *parent)
: QDialog(parent
#ifdef Q_WS_MAC
, Qt::Tool
#endif
)
{
QGridLayout *layout = new QGridLayout(this);
QLabel *label = new QLabel(this);
QLabel *lbl = new QLabel(this);
QPushButton *cmd = new QPushButton(tr("OK"), this);
QPixmap logo = QPixmap(":/icons/avogadro.png");
label->setPixmap(logo.scaled(256, 256,
Qt::KeepAspectRatio,
Qt::SmoothTransformation));
lbl->setWordWrap(true);
lbl->setOpenExternalLinks(true);
// Build up the SCM revision numbers if present
QString scmVersion(SCM_REVISION);
QString appVersion(VERSION);
QLatin1String obVersion(BABEL_VERSION);
QLatin1String qtVersion(QT_VERSION_STR);
if (scmVersion.length())
appVersion += ' ' + QString(tr("(Git revision: %1)", "%1 is the Git revision number.")).arg(scmVersion);
QString libVersion(Library::version());
if (Library::scmRevision().length())
libVersion += ' ' + QString(tr("(Git revision: %1)", "%1 is the Git revision number.")).arg(Library::scmRevision());
lbl->setText(
tr("<h3>%1</h3>"
"<br/><br/>Application Version: %2"
"<br/><br/>Library Version: %3"
"<br/><br/>Open Babel Version: %4").arg(tr("Avogadro")).arg(appVersion).arg(libVersion).arg(obVersion) +
tr("<br/><br/>Qt Version: %1"
"<br/><br/>For more information check the <a href=\"http://avogadro.openmolecules.net/\">Avogadro homepage</a>."
"<br/><br/>The program is provided AS IS with NO WARRANTY OF ANY KIND,"
" INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A"
" PARTICULAR PURPOSE.<br/>"
).arg(qtVersion));
cmd->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
cmd->setDefault(true);
connect(cmd, SIGNAL(clicked()),
this, SLOT(reject()));
layout->addWidget(label, 0, 0, 1, 1);
layout->addWidget(lbl, 0, 1, 4, 4);
layout->addWidget(cmd, 4, 2, 1, 1);
}
示例9: QLabel
QWidget * Label::createQtWidget(Proxy *proxy, UIProxy *uiproxy, QWidget *parent)
{
QLabel *label = new QLabel(QString::fromStdString(text), parent);
label->setEnabled(enabled);
label->setVisible(visible);
label->setStyleSheet(QString::fromStdString(style));
label->setWordWrap(wordWrap);
label->setOpenExternalLinks(false);
QObject::connect(label, &QLabel::linkActivated, uiproxy, &UIProxy::onLinkActivated);
setQWidget(label);
setProxy(proxy);
return label;
}
示例10: QLabel
void ContactInfoDialog::Private::addInfoRow(InfoRowIndex index, const QString &value)
{
InfoRow *row = &InfoRows[index];
// I18N_NOOP only marks the string for translation, the actual lookup of
// translated row->title happens here
QLabel *descriptionLabel = new QLabel(i18n(row->title), q);
QFont font = descriptionLabel->font();
font.setBold(true);
descriptionLabel->setFont(font);
if (editable) {
if (index == Birthday) {
KDateComboBox *combo = new KDateComboBox(q);
combo->setOptions(KDateComboBox::EditDate | KDateComboBox::SelectDate | KDateComboBox::DatePicker);
combo->setMinimumWidth(200);
combo->setDate(QDate::fromString(value));
connect(combo, SIGNAL(dateChanged(QDate)), q, SLOT(onInfoDataChanged()));
infoValueWidgets.insert(index, combo);
} else {
QLineEdit *edit = new QLineEdit(q);
edit->setMinimumWidth(200);
edit->setText(value);
connect(edit, SIGNAL(textChanged(QString)), q, SLOT(onInfoDataChanged()));
infoValueWidgets.insert(index, edit);
}
} else {
QLabel *label = new QLabel(q);
label->setOpenExternalLinks(true);
label->setTextInteractionFlags(Qt::TextSelectableByMouse | Qt::LinksAccessibleByMouse);
if (index == Email) {
label->setText(QString::fromLatin1("<a href=\"mailto:%1\">%1</a>").arg(value));
} else if (index == Homepage) {
QString format;
if (!value.startsWith(QLatin1String("http"), Qt::CaseInsensitive)) {
format = QLatin1String("<a href=\"http://%1\">%1</a>");
} else {
format = QLatin1String("<a href=\"%1\">%1</a>");
}
label->setText(format.arg(value));
} else {
label->setText(value);
}
infoValueWidgets.insert(index, label);
}
infoLayout->addRow(descriptionLabel, infoValueWidgets.value(index));
}
示例11: about
void RoadGraphPlugin::about()
{
QDialog dlg( mQGisIface->mainWindow() );
dlg.setWindowFlags( dlg.windowFlags() | Qt::MSWindowsFixedSizeDialogHint );
dlg.setWindowFlags( dlg.windowFlags() &~ Qt::WindowContextHelpButtonHint );
dlg.setWindowTitle( tr( "About RoadGraph" ) );
QVBoxLayout *lines = new QVBoxLayout( &dlg );
QLabel *title = new QLabel( "<b>RoadGraph plugin</b>" );
title->setAlignment( Qt::AlignHCenter | Qt::AlignVCenter );
QLabel *version = new QLabel( sPluginVersion );
version->setAlignment( Qt::AlignHCenter | Qt::AlignVCenter );
lines->addWidget( title );
lines->addWidget( version );
lines->addWidget( new QLabel( tr( "Find shortest path on road's graph" ) ) );
lines->addWidget( new QLabel( tr( "<b>Developers:</b>" ) ) );
lines->addWidget( new QLabel( " Sergey Yakushev" ) );
lines->addWidget( new QLabel( tr( "<b>Homepage:</b>" ) ) );
QSettings settings;
QString localeFullName, localeShortName;
bool overrideLocale = settings.value( "locale/overrideFlag", QVariant( false ) ).toBool();
if ( !overrideLocale )
{
localeFullName = QLocale().system().name();
}
else
{
localeFullName = settings.value( "locale/userLocale", QVariant( "" ) ).toString();
}
localeShortName = localeFullName.left( 2 );
QLabel *link = new QLabel();
if ( localeShortName == "ru" || localeShortName == "uk" )
{
link->setText( "<a href=\"http://gis-lab.info/qa/road-graph.html\">http://gis-lab.info/qa/road-graph.html</a>" );
}
else
{
link->setText( "<a href=\"http://gis-lab.info/qa/road-graph-eng.html\">http://gis-lab.info/qa/road-graph-eng.html</a>" );
}
link->setOpenExternalLinks( true );
lines->addWidget( link );
QPushButton *btnClose = new QPushButton( tr( "Close" ) );
lines->addWidget( btnClose );
QObject::connect( btnClose, SIGNAL( clicked() ), &dlg, SLOT( close() ) );
dlg.exec();
} //RoadGraphPlugin::about()
示例12: QDialog
AboutDialog::AboutDialog(QWidget *parent)
: QDialog(parent)
{
setWindowIcon(GuiRegistry::instance().mainWindowIcon());
setWindowTitle("About Robomongo");
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
QGridLayout *layout = new QGridLayout(this);
layout->setSizeConstraint(QLayout::SetFixedSize);
QString version = AppRegistry::instance().version();
const QString description = tr(
"<h3>Robomongo %1</h3>"
"Shell-centric MongoDB management tool."
"<br/>"
"<br/>"
"Visit Robomongo website: <a href=\"www.robomongo.org\">www.robomongo.org</a> <br/>"
"<br/>"
"<a href=\"https://github.com/paralect/robomongo\">Fork</a> project or <a href=\"https://github.com/paralect/robomongo/issues\">submit</a> issues/proposals on GitHub. <br/>"
"<br/>"
"Copyright 2013 <a href=\"http://www.paralect.com\">Paralect</a>. All rights reserved.<br/>"
"<br/>"
"The program is provided AS IS with NO WARRANTY OF ANY KIND, "
"INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A "
"PARTICULAR PURPOSE.<br/>")
.arg(version);
QLabel *copyRightLabel = new QLabel(description);
copyRightLabel->setWordWrap(true);
copyRightLabel->setOpenExternalLinks(true);
copyRightLabel->setTextInteractionFlags(Qt::TextBrowserInteraction);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close);
QPushButton *closeButton = buttonBox->button(QDialogButtonBox::Close);
buttonBox->addButton(closeButton, QDialogButtonBox::ButtonRole(QDialogButtonBox::RejectRole | QDialogButtonBox::AcceptRole));
connect(buttonBox , SIGNAL(rejected()), this, SLOT(reject()));
QIcon icon = GuiRegistry::instance().mainWindowIcon();
QPixmap iconPixmap = icon.pixmap(48, 48);
QLabel *logoLabel = new QLabel;
logoLabel->setPixmap(iconPixmap);
layout->addWidget(logoLabel , 0, 0, 1, 1);
layout->addWidget(copyRightLabel, 0, 1, 4, 4);
layout->addWidget(buttonBox, 4, 0, 1, 5);
}
示例13: QLabel
OAuthFirstPage::OAuthFirstPage(QWidget* parent) :
QWizardPage(parent)
{
setTitle(tr("Welcome to Pumpa!"));
QVBoxLayout* layout = new QVBoxLayout(this);
QLabel* infoLabel =
new QLabel(tr("<p>In order to use pump.io you need to first register an "
"account with a pump.io server. If you haven't done this yet "
"you can do it now by trying out one of the existing public "
"servers: <br /><a href=\"http://pump.io/tryit.html\">"
"http://pump.io/tryit.html</a>.</p>"
"<p>When you are done enter your new pump.io account id "
"below in the form of <b>[email protected]</b>.</p>"),
this);
infoLabel->setOpenExternalLinks(true);
infoLabel->setTextInteractionFlags(Qt::TextSelectableByMouse |
Qt::LinksAccessibleByMouse);
infoLabel->setWordWrap(true);
layout->addWidget(infoLabel);
layout->addStretch();
m_messageLabel = new QLabel(this);
layout->addWidget(m_messageLabel);
QLabel* accountIdLabel =
new QLabel(tr("<b>Your pump.io account id:</b>"), this);
QLineEdit* accountIdEdit = new QLineEdit(EXAMPLE_ACCOUNT_ID, this);
accountIdLabel->setBuddy(accountIdEdit);
connect(accountIdEdit, SIGNAL(textEdited(const QString&)),
this, SIGNAL(completeChanged()));
QCheckBox* sslCheckBox =
new QCheckBox(tr("Use secure connection (recommended)"), this);
sslCheckBox->setChecked(true);
layout->addWidget(accountIdLabel);
layout->addWidget(accountIdEdit);
layout->addWidget(sslCheckBox);
registerField("accountId*", accountIdEdit);
registerField("useSsl*", sslCheckBox);
setButtonText(QWizard::CommitButton, tr("Next"));
setCommitPage(true);
setLayout(layout);
}
示例14: options
QWidget* StorageNotesPlugin::options()
{
if (!enabled) {
return 0;
}
QWidget *optionsWid = new QWidget();
QVBoxLayout *vbox= new QVBoxLayout(optionsWid);
QLabel *wikiLink = new QLabel(tr("<a href=\"http://psi-plus.com/wiki/plugins#storage_notes_plugin\">Wiki (Online)</a>"),optionsWid);
wikiLink->setOpenExternalLinks(true);
vbox->addWidget(wikiLink);
vbox->addStretch();
return optionsWid;
}
示例15: headline
void
WarningDialog::addWarning(Message message)
{
QWidget *tab = new QWidget;
QVBoxLayout *layout = new QVBoxLayout;
layout->setAlignment(Qt::AlignTop);
tab->setLayout(layout);
QLabel *text = new QLabel(message.first.first);
text->setWordWrap(true);
layout->addWidget(text);
QLabel *informativeText = new QLabel(message.first.second);
informativeText->setWordWrap(true);
layout->addWidget(informativeText);
informativeText->setOpenExternalLinks(true);
QIcon icon = IconLoader().load("warning");
QString headline(tr("Warning"));
switch (message.second) {
case Midi:
icon = IconLoader().load("midi-nok");
headline = tr("MIDI");
break;
case Audio:
icon = IconLoader().load("audio-nok");
headline = tr("Audio");
break;
case Timer:
icon = IconLoader().load("timer-nok");
headline = tr("System timer");
break;
case Info:
icon = IconLoader().load("messagebox-information");
headline = tr("Information");
break;
case Other:
default:
// icon and text were initialized suitable for this case, so there's
// nothing to do here
break;
}
m_tabWidget->addTab(tab, icon, headline);
}