mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-06-27 11:39:16 +02:00
Code cleanup
This commit is contained in:
@ -3,7 +3,7 @@
|
||||
|
||||
#include <QGraphicsItem>
|
||||
#include <QList>
|
||||
#include "kv.h"
|
||||
#include "common/kv.h"
|
||||
|
||||
class InfoItem : public QGraphicsItem
|
||||
{
|
||||
|
21
src/GUI/kv.h
21
src/GUI/kv.h
@ -1,21 +0,0 @@
|
||||
#ifndef KV_H
|
||||
#define KV_H
|
||||
|
||||
#include <QString>
|
||||
|
||||
class KV {
|
||||
public:
|
||||
KV(const QString &key, const QString &value) : _key(key), _value(value) {}
|
||||
|
||||
const QString &key() const {return _key;}
|
||||
const QString &value() const {return _value;}
|
||||
|
||||
bool operator==(const KV &other) const
|
||||
{return this->key() == other.key();}
|
||||
|
||||
private:
|
||||
QString _key;
|
||||
QString _value;
|
||||
};
|
||||
|
||||
#endif // KV_H
|
@ -2,8 +2,7 @@
|
||||
|
||||
void ToolTip::insert(const QString &key, const QString &value)
|
||||
{
|
||||
QPair<QString, QString> entry(key, value);
|
||||
_list.append(entry);
|
||||
_list.append(KV(key, value));
|
||||
}
|
||||
|
||||
QString ToolTip::toString()
|
||||
@ -11,8 +10,8 @@ QString ToolTip::toString()
|
||||
QString ret = "<table>";
|
||||
|
||||
for (int i = 0; i < _list.count(); i++)
|
||||
ret += "<tr><td align=\"right\"><b>" + _list.at(i).first
|
||||
+ ": </b></td><td>" + _list.at(i).second + "</td></tr>";
|
||||
ret += "<tr><td align=\"right\"><b>" + _list.at(i).key()
|
||||
+ ": </b></td><td>" + _list.at(i).value() + "</td></tr>";
|
||||
|
||||
ret += "</table>";
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
#include <QString>
|
||||
#include <QList>
|
||||
#include <QPair>
|
||||
#include "common/kv.h"
|
||||
|
||||
class ToolTip
|
||||
{
|
||||
@ -12,7 +12,7 @@ public:
|
||||
QString toString();
|
||||
|
||||
private:
|
||||
QList<QPair<QString, QString> > _list;
|
||||
QList<KV> _list;
|
||||
};
|
||||
|
||||
#endif // TOOLTIP_H
|
||||
|
Reference in New Issue
Block a user