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

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 ...@@ -593,6 +593,8 @@ void Qt4DefaultTargetSetupWidget::createImportWidget(const BuildConfigurationInf
QCheckBox *checkBox = new QCheckBox; QCheckBox *checkBox = new QCheckBox;
checkBox->setText(tr("Import build from %1").arg(info.directory)); checkBox->setText(tr("Import build from %1").arg(info.directory));
checkBox->setChecked(m_importEnabled.at(pos)); checkBox->setChecked(m_importEnabled.at(pos));
if (info.version)
checkBox->setToolTip(info.version->toHtml(false));
m_importLayout->addWidget(checkBox, pos, 0, 1, 2); m_importLayout->addWidget(checkBox, pos, 0, 1, 2);
connect(checkBox, SIGNAL(toggled(bool)), connect(checkBox, SIGNAL(toggled(bool)),
...@@ -611,6 +613,8 @@ void Qt4DefaultTargetSetupWidget::setupWidgets() ...@@ -611,6 +613,8 @@ void Qt4DefaultTargetSetupWidget::setupWidgets()
QCheckBox *checkbox = new QCheckBox; QCheckBox *checkbox = new QCheckBox;
checkbox->setText(displayNameFrom(info)); checkbox->setText(displayNameFrom(info));
checkbox->setChecked(m_enabled.at(i)); checkbox->setChecked(m_enabled.at(i));
if (info.version)
checkbox->setToolTip(info.version->toHtml(false));
m_newBuildsLayout->addWidget(checkbox, i * 2, 0); m_newBuildsLayout->addWidget(checkbox, i * 2, 0);
Utils::PathChooser *pathChooser = new Utils::PathChooser(); Utils::PathChooser *pathChooser = new Utils::PathChooser();
......
...@@ -230,7 +230,7 @@ bool QtOptionsPageWidget::eventFilter(QObject *o, QEvent *e) ...@@ -230,7 +230,7 @@ bool QtOptionsPageWidget::eventFilter(QObject *o, QEvent *e)
const int index = indexForTreeItem(item); const int index = indexForTreeItem(item);
if (index == -1) if (index == -1)
return false; 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); QToolTip::showText(helpEvent->globalPos(), tooltip, m_ui->qtdirList);
helpEvent->accept(); helpEvent->accept();
return true; return true;
......
...@@ -698,7 +698,7 @@ QtVersion::~QtVersion() ...@@ -698,7 +698,7 @@ QtVersion::~QtVersion()
{ {
} }
QString QtVersion::toHtml() const QString QtVersion::toHtml(bool verbose) const
{ {
QString rc; QString rc;
QTextStream str(&rc); QTextStream str(&rc);
...@@ -729,11 +729,13 @@ QString QtVersion::toHtml() const ...@@ -729,11 +729,13 @@ QString QtVersion::toHtml() const
} // default config. } // default config.
str << "<tr><td><b>" << QtVersionManager::tr("Version:") str << "<tr><td><b>" << QtVersionManager::tr("Version:")
<< "</b></td><td>" << qtVersionString() << "</td></tr>"; << "</b></td><td>" << qtVersionString() << "</td></tr>";
const QHash<QString,QString> vInfo = versionInfo(); if (verbose) {
if (!vInfo.isEmpty()) { const QHash<QString,QString> vInfo = versionInfo();
const QHash<QString,QString>::const_iterator vcend = vInfo.constEnd(); if (!vInfo.isEmpty()) {
for (QHash<QString,QString>::const_iterator it = vInfo.constBegin(); it != vcend; ++it) const QHash<QString,QString>::const_iterator vcend = vInfo.constEnd();
str << "<tr><td><pre>" << it.key() << "</pre></td><td>" << it.value() << "</td></tr>"; 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>"; str << "</table></body></html>";
......
...@@ -182,7 +182,7 @@ public: ...@@ -182,7 +182,7 @@ public:
Q_DECLARE_FLAGS(QmakeBuildConfigs, QmakeBuildConfig) Q_DECLARE_FLAGS(QmakeBuildConfigs, QmakeBuildConfig)
QmakeBuildConfigs defaultBuildConfig() const; QmakeBuildConfigs defaultBuildConfig() const;
QString toHtml() const; QString toHtml(bool verbose) const;
bool supportsShadowBuilds() const; bool supportsShadowBuilds() const;
......
Supports Markdown
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