Freeciv21
Develop your civilization from humble roots to a global empire
tooltips.h
Go to the documentation of this file.
1 /**************************************************************************
2  Copyright (c) 1996-2020 Freeciv21 and Freeciv contributors. This file is
3  part of Freeciv21. Freeciv21 is free software: you can redistribute it
4  and/or modify it under the terms of the GNU General Public License as
5  published by the Free Software Foundation, either version 3 of the
6  License, or (at your option) any later version. You should have received
7  a copy of the GNU General Public License along with Freeciv21. If not,
8  see https://www.gnu.org/licenses/.
9 **************************************************************************/
10 #pragma once
11 
12 #include <QObject>
13 
14 class QString;
15 class QVariant;
16 
17 QString get_tooltip(const QVariant &qvar);
18 QString get_tooltip_improvement(const impr_type *building,
19  struct city *pcity = nullptr,
20  bool ext = false);
21 QString get_tooltip_unit(const struct unit_type *utype, bool ext = false);
22 QString bold(const QString &text);
23 
24 class fc_tooltip : public QObject {
25  Q_OBJECT
26 
27 public:
28  explicit fc_tooltip(QObject *parent = nullptr) : QObject(parent) {}
29 
30 protected:
31  bool eventFilter(QObject *obj, QEvent *event) override;
32 };
fc_tooltip(QObject *parent=nullptr)
Definition: tooltips.h:28
bool eventFilter(QObject *obj, QEvent *event) override
Event filter for catching tooltip events.
Definition: tooltips.cpp:34
enum event_type event
Definition: events.cpp:68
Definition: city.h:291
QString get_tooltip_improvement(const impr_type *building, struct city *pcity=nullptr, bool ext=false)
Returns improvement properties to append in tooltip ext is used to get extra info from help.
Definition: tooltips.cpp:82
QString bold(const QString &text)
'text' is assumed to have already been HTML-escaped if necessary
Definition: tooltips.cpp:76
QString get_tooltip_unit(const struct unit_type *utype, bool ext=false)
Returns unit properties to append in tooltip ext is used to get extra info from help.
Definition: tooltips.cpp:144
QString get_tooltip(const QVariant &qvar)
Returns shortened help for given universal ( stored in qvar )
Definition: tooltips.cpp:215