Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Add tooltip text to resultformat edit
  • Loading branch information
alwey committed Jan 1, 2022
commit 89e0417ce9824f98f31046170c0f6b4fbd6a678f
18 changes: 18 additions & 0 deletions projects/gui/src/tournamentsettingswidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,24 @@ TournamentSettingsWidget::TournamentSettingsWidget(QWidget *parent)
});

readSettings();

// Build text for tool tip of result formats
QString s("\n\nField tokens:\n ");
for (const QString& token: tournament.resultFieldTokens())
{
s.append(qUtf8Printable(token));
s.append(" ");
}
s.append("\n\nNamed shortcuts:");
const auto& map2(tournament.resultFieldGroups());
for (auto it = map2.constBegin(); it != map2.constEnd(); ++it)
{
s.append("\n");
s.append(qUtf8Printable(it.key()));
s.append("\n ");
s.append(qUtf8Printable(it.value()));
}
ui->m_resultFormatEdit->setToolTip(ui->m_resultFormatEdit->toolTip().append(s));
}

TournamentSettingsWidget::~TournamentSettingsWidget()
Expand Down
3 changes: 3 additions & 0 deletions projects/gui/ui/tournamentsettingswidget.ui
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,9 @@
<height>25</height>
</rect>
</property>
<property name="toolTip">
<string>Format accepts a comma separated list of fields or shortcuts</string>
</property>
<property name="autoFillBackground">
<bool>false</bool>
</property>
Expand Down