Commit 866e39a0 authored by Friedemann Kleint's avatar Friedemann Kleint

Target dialog: Set a tooltip containing Qt version info.

Introduce verbose flag and display QtVersion tooltip on
checkbox.

Reviewed-by: dt
parent 79c86386
......@@ -593,6 +593,8 @@ void Qt4DefaultTargetSetupWidget::createImportWidget(const BuildConfigurationInf
QCheckBox *checkBox = new QCheckBox;
checkBox->setText(tr("Import build from %1").arg(info.directory));
checkBox->setChecked(m_importEnabled.at(pos));
if (info.version)
checkBox->setToolTip(info.version->toHtml(false));
m_importLayout->addWidget(checkBox, pos, 0, 1, 2);
connect(checkBox, SIGNAL(toggled(bool)),
......@@ -611,6 +613,8 @@ void Qt4DefaultTargetSetupWidget::setupWidgets()
QCheckBox *checkbox = new QCheckBox;
checkbox->setText(displayNameFrom(info));
checkbox->setChecked(m_enabled.at(i));
if (info.version)
checkbox->setToolTip(info.version->toHtml(false));
m_newBuildsLayout->addWidget(checkbox, i * 2, 0);
Utils::PathChooser *pathChooser = new Utils::PathChooser();
......
......@@ -230,7 +230,7 @@ bool QtOptionsPageWidget::eventFilter(QObject *o, QEvent *e)
const int index = indexForTreeItem(item);
if (index == -1)
return false;
const QString tooltip = m_versions.at(index)->toHtml();
const QString tooltip = m_versions.at(index)->toHtml(true);
QToolTip::showText(helpEvent->globalPos(), tooltip, m_ui->qtdirList);
helpEvent->accept();
return true;
......
......@@ -698,7 +698,7 @@ QtVersion::~QtVersion()
{
}
QString QtVersion::toHtml() const
QString QtVersion::toHtml(bool verbose) const
{
QString rc;
QTextStream str(&rc);
......@@ -729,11 +729,13 @@ QString QtVersion::toHtml() const
} // default config.
str << "<tr><td><b>" << QtVersionManager::tr("Version:")
<< "</b></td><td>" << qtVersionString() << "</td></tr>";
const QHash<QString,QString> vInfo = versionInfo();
if (!vInfo.isEmpty()) {
const QHash<QString,QString>::const_iterator vcend = vInfo.constEnd();
for (QHash<QString,QString>::const_iterator it = vInfo.constBegin(); it != vcend; ++it)
str << "<tr><td><pre>" << it.key() << "</pre></td><td>" << it.value() << "</td></tr>";
if (verbose) {
const QHash<QString,QString> vInfo = versionInfo();
if (!vInfo.isEmpty()) {
const QHash<QString,QString>::const_iterator vcend = vInfo.constEnd();
for (QHash<QString,QString>::const_iterator it = vInfo.constBegin(); it != vcend; ++it)
str << "<tr><td><pre>" << it.key() << "</pre></td><td>" << it.value() << "</td></tr>";
}
}
}
str << "</table></body></html>";
......
......@@ -182,7 +182,7 @@ public:
Q_DECLARE_FLAGS(QmakeBuildConfigs, QmakeBuildConfig)
QmakeBuildConfigs defaultBuildConfig() const;
QString toHtml() const;
QString toHtml(bool verbose) const;
bool supportsShadowBuilds() const;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment