forked from Public/monero-gui
save qrcode to file
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#include "Wallet.h"
|
||||
#include "wallet/wallet2_api.h"
|
||||
#include "zxcvbn-c/zxcvbn.h"
|
||||
#include "QRCodeImageProvider.h"
|
||||
#include <QFile>
|
||||
#include <QFileInfo>
|
||||
#include <QDir>
|
||||
@@ -291,6 +292,13 @@ double WalletManager::getPasswordStrength(const QString &password) const
|
||||
return e;
|
||||
}
|
||||
|
||||
bool WalletManager::saveQrCode(const QString &code, const QString &path) const
|
||||
{
|
||||
QSize size;
|
||||
// 240 <=> mainLayout.qrCodeSize (Receive.qml)
|
||||
return QRCodeImageProvider::genQrImage(code, &size).scaled(size.expandedTo(QSize(240, 240)), Qt::KeepAspectRatio).save(path, "PNG", 100);
|
||||
}
|
||||
|
||||
WalletManager::WalletManager(QObject *parent) : QObject(parent)
|
||||
{
|
||||
m_pimpl = Monero::WalletManagerFactory::getWalletManager();
|
||||
|
||||
Reference in New Issue
Block a user