mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2026-06-11 18:28:55 -04:00
Conversions to QString for user-defined Qt types
This commit is contained in:
+13
-5
@@ -13,6 +13,7 @@
|
||||
#include <QMimeData>
|
||||
#include <QDataStream>
|
||||
#include <QByteArray>
|
||||
#include <QTextStream>
|
||||
#include <QDebug>
|
||||
#include <QDebugStateSaver>
|
||||
|
||||
@@ -26,14 +27,21 @@
|
||||
QDebug operator << (QDebug debug, StationList::Station const& station)
|
||||
{
|
||||
QDebugStateSaver saver {debug};
|
||||
debug.nospace () << "Station("
|
||||
<< station.band_name_ << ", "
|
||||
<< station.offset_ << ", "
|
||||
<< station.antenna_description_ << ')';
|
||||
return debug;
|
||||
return debug.nospace () << station.toString ();
|
||||
}
|
||||
#endif
|
||||
|
||||
QString StationList::Station::toString () const
|
||||
{
|
||||
QString string;
|
||||
QTextStream ots {&string};
|
||||
ots << "Station("
|
||||
<< band_name_ << ", "
|
||||
<< Radio::frequency_MHz_string (offset_) << ", "
|
||||
<< antenna_description_ << ')';
|
||||
return string;
|
||||
}
|
||||
|
||||
QDataStream& operator << (QDataStream& os, StationList::Station const& station)
|
||||
{
|
||||
return os << station.band_name_
|
||||
|
||||
Reference in New Issue
Block a user