diff options
author | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2021-01-21 22:27:28 +0200 |
---|---|---|
committer | William Casarin <jb55@jb55.com> | 2022-02-22 13:50:30 -0800 |
commit | 75832fdc37ea3fe9cf515bd1946e220fe07a440b (patch) | |
tree | 8c9948dc7c4a97d97ab79df95e27b1a18baa2157 /src/qt/bitcoinunits.h | |
parent | 5d254a234d8c1569b0161264cc6d5d8d0ce0d864 (diff) | |
download | bitcoin-75832fdc37ea3fe9cf515bd1946e220fe07a440b.tar.xz |
qt: Use QVariant instead of int for BitcoinUnit in QSettings
This change improves type safety.
Diffstat (limited to 'src/qt/bitcoinunits.h')
-rw-r--r-- | src/qt/bitcoinunits.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/qt/bitcoinunits.h b/src/qt/bitcoinunits.h index 9fedec0d4f..c767d1e322 100644 --- a/src/qt/bitcoinunits.h +++ b/src/qt/bitcoinunits.h @@ -8,6 +8,7 @@ #include <consensus/amount.h> #include <QAbstractListModel> +#include <QDataStream> #include <QString> // U+2009 THIN SPACE = UTF-8 E2 80 89 @@ -45,6 +46,7 @@ public: uBTC, SAT }; + Q_ENUM(Unit) enum class SeparatorStyle { @@ -111,4 +113,7 @@ private: }; typedef BitcoinUnits::Unit BitcoinUnit; +QDataStream& operator<<(QDataStream& out, const BitcoinUnit& unit); +QDataStream& operator>>(QDataStream& in, BitcoinUnit& unit); + #endif // BITCOIN_QT_BITCOINUNITS_H |