mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-05-17 05:30:43 +02:00
qt: Add GUIUtil::AddButtonShortcut
Co-authored-by: Jarol Rodriguez <jarolrod@tutanota.com>
This commit is contained in:
parent
4ee9ee7236
commit
a2e122f0fe
@ -29,6 +29,7 @@
|
|||||||
#include <shlwapi.h>
|
#include <shlwapi.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <QAbstractButton>
|
||||||
#include <QAbstractItemView>
|
#include <QAbstractItemView>
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QClipboard>
|
#include <QClipboard>
|
||||||
@ -119,6 +120,11 @@ void setupAddressWidget(QValidatedLineEdit *widget, QWidget *parent)
|
|||||||
widget->setCheckValidator(new BitcoinAddressCheckValidator(parent));
|
widget->setCheckValidator(new BitcoinAddressCheckValidator(parent));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AddButtonShortcut(QAbstractButton* button, const QKeySequence& shortcut)
|
||||||
|
{
|
||||||
|
QObject::connect(new QShortcut(shortcut, button), &QShortcut::activated, [button]() { button->animateClick(); });
|
||||||
|
}
|
||||||
|
|
||||||
bool parseBitcoinURI(const QUrl &uri, SendCoinsRecipient *out)
|
bool parseBitcoinURI(const QUrl &uri, SendCoinsRecipient *out)
|
||||||
{
|
{
|
||||||
// return if URI is not valid or is no bitcoin: URI
|
// return if URI is not valid or is no bitcoin: URI
|
||||||
|
@ -31,10 +31,12 @@ namespace interfaces
|
|||||||
}
|
}
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
class QAbstractButton;
|
||||||
class QAbstractItemView;
|
class QAbstractItemView;
|
||||||
class QAction;
|
class QAction;
|
||||||
class QDateTime;
|
class QDateTime;
|
||||||
class QFont;
|
class QFont;
|
||||||
|
class QKeySequence;
|
||||||
class QLineEdit;
|
class QLineEdit;
|
||||||
class QMenu;
|
class QMenu;
|
||||||
class QPoint;
|
class QPoint;
|
||||||
@ -60,6 +62,14 @@ namespace GUIUtil
|
|||||||
// Set up widget for address
|
// Set up widget for address
|
||||||
void setupAddressWidget(QValidatedLineEdit *widget, QWidget *parent);
|
void setupAddressWidget(QValidatedLineEdit *widget, QWidget *parent);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Connects an additional shortcut to a QAbstractButton. Works around the
|
||||||
|
* one shortcut limitation of the button's shortcut property.
|
||||||
|
* @param[in] button QAbstractButton to assign shortcut to
|
||||||
|
* @param[in] shortcut QKeySequence to use as shortcut
|
||||||
|
*/
|
||||||
|
void AddButtonShortcut(QAbstractButton* button, const QKeySequence& shortcut);
|
||||||
|
|
||||||
// Parse "bitcoin:" URI into recipient object, return true on successful parsing
|
// Parse "bitcoin:" URI into recipient object, return true on successful parsing
|
||||||
bool parseBitcoinURI(const QUrl &uri, SendCoinsRecipient *out);
|
bool parseBitcoinURI(const QUrl &uri, SendCoinsRecipient *out);
|
||||||
bool parseBitcoinURI(QString uri, SendCoinsRecipient *out);
|
bool parseBitcoinURI(QString uri, SendCoinsRecipient *out);
|
||||||
|
Loading…
Reference in New Issue
Block a user