Requst payment dialog
This commit is contained in:
@@ -16,6 +16,7 @@
|
|||||||
#include "turnstile.h"
|
#include "turnstile.h"
|
||||||
#include "senttxstore.h"
|
#include "senttxstore.h"
|
||||||
#include "connection.h"
|
#include "connection.h"
|
||||||
|
#include "requestdialog.h"
|
||||||
#include "websockets.h"
|
#include "websockets.h"
|
||||||
|
|
||||||
using json = nlohmann::json;
|
using json = nlohmann::json;
|
||||||
@@ -45,6 +46,11 @@ MainWindow::MainWindow(QWidget *parent) :
|
|||||||
rpc->checkForUpdate(false);
|
rpc->checkForUpdate(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Request zcash
|
||||||
|
QObject::connect(ui->actionRequest_zcash, &QAction::triggered, [=]() {
|
||||||
|
RequestDialog::showRequestZcash(this);
|
||||||
|
});
|
||||||
|
|
||||||
// Pay Zcash URI
|
// Pay Zcash URI
|
||||||
QObject::connect(ui->actionPay_URI, &QAction::triggered, [=] () {
|
QObject::connect(ui->actionPay_URI, &QAction::triggered, [=] () {
|
||||||
payZcashURI();
|
payZcashURI();
|
||||||
@@ -1505,6 +1511,9 @@ MainWindow::~MainWindow()
|
|||||||
delete rpc;
|
delete rpc;
|
||||||
delete labelCompleter;
|
delete labelCompleter;
|
||||||
|
|
||||||
|
delete amtValidator;
|
||||||
|
delete feesValidator;
|
||||||
|
|
||||||
delete loadingMovie;
|
delete loadingMovie;
|
||||||
delete logger;
|
delete logger;
|
||||||
|
|
||||||
|
|||||||
@@ -42,6 +42,9 @@ public:
|
|||||||
void updateLabelsAutoComplete();
|
void updateLabelsAutoComplete();
|
||||||
RPC* getRPC() { return rpc; }
|
RPC* getRPC() { return rpc; }
|
||||||
|
|
||||||
|
QCompleter* getLabelCompleter() { return labelCompleter; }
|
||||||
|
QRegExpValidator* getAmountValidator() { return amtValidator; }
|
||||||
|
|
||||||
QString doSendTxValidations(Tx tx);
|
QString doSendTxValidations(Tx tx);
|
||||||
void setDefaultPayFrom();
|
void setDefaultPayFrom();
|
||||||
|
|
||||||
@@ -126,8 +129,10 @@ private:
|
|||||||
WSServer* wsserver = nullptr;
|
WSServer* wsserver = nullptr;
|
||||||
WormholeClient* wormhole = nullptr;
|
WormholeClient* wormhole = nullptr;
|
||||||
|
|
||||||
RPC* rpc = nullptr;
|
RPC* rpc = nullptr;
|
||||||
QCompleter* labelCompleter = nullptr;
|
QCompleter* labelCompleter = nullptr;
|
||||||
|
QRegExpValidator* amtValidator = nullptr;
|
||||||
|
QRegExpValidator* feesValidator = nullptr;
|
||||||
|
|
||||||
QMovie* loadingMovie;
|
QMovie* loadingMovie;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QTabWidget" name="tabWidget">
|
<widget class="QTabWidget" name="tabWidget">
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>2</number>
|
<number>1</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="tab">
|
<widget class="QWidget" name="tab">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
@@ -1058,6 +1058,7 @@
|
|||||||
<property name="title">
|
<property name="title">
|
||||||
<string>&File</string>
|
<string>&File</string>
|
||||||
</property>
|
</property>
|
||||||
|
<addaction name="actionRequest_zcash"/>
|
||||||
<addaction name="actionPay_URI"/>
|
<addaction name="actionPay_URI"/>
|
||||||
<addaction name="separator"/>
|
<addaction name="separator"/>
|
||||||
<addaction name="actionImport_Private_Key"/>
|
<addaction name="actionImport_Private_Key"/>
|
||||||
@@ -1183,19 +1184,24 @@
|
|||||||
<string>Ctrl+M</string>
|
<string>Ctrl+M</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
|
<action name="actionRequest_zcash">
|
||||||
|
<property name="text">
|
||||||
|
<string>Request zcash...</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
</widget>
|
</widget>
|
||||||
<layoutdefault spacing="6" margin="11"/>
|
<layoutdefault spacing="6" margin="11"/>
|
||||||
<customwidgets>
|
<customwidgets>
|
||||||
<customwidget>
|
|
||||||
<class>QRCodeLabel</class>
|
|
||||||
<extends>QLabel</extends>
|
|
||||||
<header>qrcodelabel.h</header>
|
|
||||||
</customwidget>
|
|
||||||
<customwidget>
|
<customwidget>
|
||||||
<class>AddressCombo</class>
|
<class>AddressCombo</class>
|
||||||
<extends>QComboBox</extends>
|
<extends>QComboBox</extends>
|
||||||
<header>addresscombo.h</header>
|
<header>addresscombo.h</header>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
|
<customwidget>
|
||||||
|
<class>QRCodeLabel</class>
|
||||||
|
<extends>QLabel</extends>
|
||||||
|
<header>qrcodelabel.h</header>
|
||||||
|
</customwidget>
|
||||||
<customwidget>
|
<customwidget>
|
||||||
<class>FilledIconLabel</class>
|
<class>FilledIconLabel</class>
|
||||||
<extends>QLabel</extends>
|
<extends>QLabel</extends>
|
||||||
|
|||||||
@@ -1,27 +1,35 @@
|
|||||||
#include "memoedit.h"
|
#include "memoedit.h"
|
||||||
|
|
||||||
MemoEdit::MemoEdit(QWidget* parent) : QPlainTextEdit(parent) {
|
MemoEdit::MemoEdit(QWidget* parent) : QPlainTextEdit(parent) {
|
||||||
QObject::connect(this, &QPlainTextEdit::textChanged, [=]() {
|
QObject::connect(this, &QPlainTextEdit::textChanged, this, &MemoEdit::updateDisplay);
|
||||||
QString txt = this->toPlainText();
|
}
|
||||||
if (lenDisplayLabel)
|
|
||||||
lenDisplayLabel->setText(QString::number(txt.toUtf8().size()) + "/" + QString::number(maxlen));
|
|
||||||
|
|
||||||
if (txt.toUtf8().size() <= maxlen) {
|
void MemoEdit::updateDisplay() {
|
||||||
// Everything is fine
|
QString txt = this->toPlainText();
|
||||||
|
if (lenDisplayLabel)
|
||||||
|
lenDisplayLabel->setText(QString::number(txt.toUtf8().size()) + "/" + QString::number(maxlen));
|
||||||
|
|
||||||
|
if (txt.toUtf8().size() <= maxlen) {
|
||||||
|
// Everything is fine
|
||||||
|
if (acceptButton)
|
||||||
acceptButton->setEnabled(true);
|
acceptButton->setEnabled(true);
|
||||||
|
|
||||||
|
if (lenDisplayLabel)
|
||||||
lenDisplayLabel->setStyleSheet("");
|
lenDisplayLabel->setStyleSheet("");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Overweight
|
// Overweight
|
||||||
|
if (acceptButton)
|
||||||
acceptButton->setEnabled(false);
|
acceptButton->setEnabled(false);
|
||||||
|
|
||||||
|
if (lenDisplayLabel)
|
||||||
lenDisplayLabel->setStyleSheet("color: red;");
|
lenDisplayLabel->setStyleSheet("color: red;");
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MemoEdit::setMaxLen(int len) {
|
void MemoEdit::setMaxLen(int len) {
|
||||||
this->maxlen = len;
|
this->maxlen = len;
|
||||||
|
updateDisplay();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MemoEdit::setLenDisplayLabel(QLabel* label) {
|
void MemoEdit::setLenDisplayLabel(QLabel* label) {
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ public:
|
|||||||
void setLenDisplayLabel(QLabel* label);
|
void setLenDisplayLabel(QLabel* label);
|
||||||
void setAcceptButton(QPushButton* button);
|
void setAcceptButton(QPushButton* button);
|
||||||
void includeReplyTo(QString replyToAddress);
|
void includeReplyTo(QString replyToAddress);
|
||||||
|
void updateDisplay();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int maxlen = 512;
|
int maxlen = 512;
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
#include "requestdialog.h"
|
#include "requestdialog.h"
|
||||||
#include "ui_requestdialog.h"
|
#include "ui_requestdialog.h"
|
||||||
|
#include "settings.h"
|
||||||
|
#include "addressbook.h"
|
||||||
|
|
||||||
RequestDialog::RequestDialog(QWidget *parent) :
|
RequestDialog::RequestDialog(QWidget *parent) :
|
||||||
QDialog(parent),
|
QDialog(parent),
|
||||||
@@ -12,3 +14,50 @@ RequestDialog::~RequestDialog()
|
|||||||
{
|
{
|
||||||
delete ui;
|
delete ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Static method that shows the request dialog
|
||||||
|
void RequestDialog::showRequestZcash(MainWindow* main) {
|
||||||
|
QDialog d(main);
|
||||||
|
Ui_RequestDialog req;
|
||||||
|
req.setupUi(&d);
|
||||||
|
Settings::saveRestore(&d);
|
||||||
|
|
||||||
|
// Setup the Label completer for the Address
|
||||||
|
req.txtFrom->setCompleter(main->getLabelCompleter());
|
||||||
|
QObject::connect(req.txtFrom, &QLineEdit::textChanged, [=] (auto text) {
|
||||||
|
auto addr = AddressBook::addressFromAddressLabel(text);
|
||||||
|
if (!Settings::getInstance()->isSaplingAddress(addr)) {
|
||||||
|
req.lblSaplingWarning->setText(tr("Can only request from Sapling addresses"));
|
||||||
|
req.buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
|
||||||
|
} else {
|
||||||
|
req.lblSaplingWarning->setText("");
|
||||||
|
req.buttonBox->button(QDialogButtonBox::Ok)->setEnabled(true);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Wire up AddressBook button
|
||||||
|
QObject::connect(req.btnAddressBook, &QPushButton::clicked, [=] () {
|
||||||
|
AddressBook::open(main, req.txtFrom);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Amount textbox
|
||||||
|
req.txtAmount->setValidator(main->getAmountValidator());
|
||||||
|
QObject::connect(req.txtAmount, &QLineEdit::textChanged, [=] (auto text) {
|
||||||
|
req.txtAmountUSD->setText(Settings::getUSDFormat(text.toDouble()));
|
||||||
|
});
|
||||||
|
req.txtAmountUSD->setText(Settings::getUSDFormat(req.txtAmount->text().toDouble()));
|
||||||
|
|
||||||
|
req.txtMemo->setAcceptButton(req.buttonBox->button(QDialogButtonBox::Ok));
|
||||||
|
req.txtMemo->setLenDisplayLabel(req.lblMemoLen);
|
||||||
|
req.txtMemo->setMaxLen(400);
|
||||||
|
|
||||||
|
req.txtFrom->setFocus();
|
||||||
|
|
||||||
|
if (d.exec() == QDialog::Accepted) {
|
||||||
|
// Construct a zcash Payment URI with the data and pay it immediately.
|
||||||
|
QString paymentURI = "zcash:" + AddressBook::addressFromAddressLabel(req.txtFrom->text())
|
||||||
|
+ "?amt=" + Settings::getDecimalString(req.txtAmount->text().toDouble())
|
||||||
|
+ "&memo=" + QUrl::toPercentEncoding(req.txtMemo->toPlainText());
|
||||||
|
main->payZcashURI(paymentURI);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,6 +2,7 @@
|
|||||||
#define REQUESTDIALOG_H
|
#define REQUESTDIALOG_H
|
||||||
|
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
|
#include "mainwindow.h"
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class RequestDialog;
|
class RequestDialog;
|
||||||
@@ -15,6 +16,8 @@ public:
|
|||||||
explicit RequestDialog(QWidget *parent = nullptr);
|
explicit RequestDialog(QWidget *parent = nullptr);
|
||||||
~RequestDialog();
|
~RequestDialog();
|
||||||
|
|
||||||
|
static void showRequestZcash(MainWindow* main);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::RequestDialog *ui;
|
Ui::RequestDialog *ui;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -6,45 +6,92 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>544</width>
|
<width>714</width>
|
||||||
<height>450</height>
|
<height>524</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Dialog</string>
|
<string>Dialog</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<item row="1" column="1" colspan="3">
|
<item row="8" column="1" colspan="3">
|
||||||
|
<widget class="MemoEdit" name="txtMemo"/>
|
||||||
|
</item>
|
||||||
|
<item row="5" column="1" colspan="3">
|
||||||
<widget class="QLineEdit" name="txtAmount">
|
<widget class="QLineEdit" name="txtAmount">
|
||||||
<property name="alignment">
|
<property name="alignment">
|
||||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
</property>
|
</property>
|
||||||
<property name="placeholderText">
|
<property name="placeholderText">
|
||||||
<string>amount in ZEC</string>
|
<string>Amount</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="1" colspan="3">
|
<item row="0" column="2" colspan="2">
|
||||||
<widget class="QLabel" name="txtAmountUSD">
|
<widget class="QLabel" name="lblSaplingWarning">
|
||||||
|
<property name="styleSheet">
|
||||||
|
<string notr="true">color: red;</string>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Amount USD</string>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
<property name="alignment">
|
<property name="alignment">
|
||||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
<item row="11" column="2" colspan="2">
|
||||||
<widget class="QLabel" name="label_2">
|
<widget class="QDialogButtonBox" name="buttonBox">
|
||||||
<property name="text">
|
<property name="orientation">
|
||||||
<string>Amount</string>
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="standardButtons">
|
||||||
|
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="1" colspan="3">
|
<item row="9" column="2" colspan="2">
|
||||||
<widget class="QTextEdit" name="txtMemo"/>
|
<widget class="QLabel" name="lblMemoLen">
|
||||||
|
<property name="text">
|
||||||
|
<string notr="true">0 / 512</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="1" colspan="3">
|
<item row="8" column="0">
|
||||||
|
<widget class="QLabel" name="label_3">
|
||||||
|
<property name="text">
|
||||||
|
<string>Memo</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="3">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="btnAddressBook">
|
||||||
|
<property name="text">
|
||||||
|
<string>AddressBook</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1" colspan="3">
|
||||||
<widget class="QLineEdit" name="txtFrom">
|
<widget class="QLineEdit" name="txtFrom">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||||
@@ -60,32 +107,46 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="0">
|
<item row="1" column="0">
|
||||||
<widget class="QLabel" name="label_3">
|
|
||||||
<property name="text">
|
|
||||||
<string>Memo</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QLabel" name="label">
|
<widget class="QLabel" name="label">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Request From</string>
|
<string>Request From</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="2" colspan="2">
|
<item row="6" column="1" colspan="3">
|
||||||
<widget class="QDialogButtonBox" name="buttonBox">
|
<widget class="QLabel" name="txtAmountUSD">
|
||||||
|
<property name="text">
|
||||||
|
<string>Amount USD</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="5" column="0">
|
||||||
|
<widget class="QLabel" name="label_2">
|
||||||
|
<property name="text">
|
||||||
|
<string>Amount in ZEC</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="10" column="0" colspan="4">
|
||||||
|
<widget class="Line" name="line">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="standardButtons">
|
|
||||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
<customwidgets>
|
||||||
|
<customwidget>
|
||||||
|
<class>MemoEdit</class>
|
||||||
|
<extends>QPlainTextEdit</extends>
|
||||||
|
<header>memoedit.h</header>
|
||||||
|
</customwidget>
|
||||||
|
</customwidgets>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections>
|
<connections>
|
||||||
<connection>
|
<connection>
|
||||||
|
|||||||
@@ -12,7 +12,8 @@ using json = nlohmann::json;
|
|||||||
|
|
||||||
void MainWindow::setupSendTab() {
|
void MainWindow::setupSendTab() {
|
||||||
// Create the validator for send to/amount fields
|
// Create the validator for send to/amount fields
|
||||||
auto amtValidator = new QRegExpValidator(QRegExp("[0-9]{0,8}\\.?[0-9]{0,8}"));
|
amtValidator = new QRegExpValidator(QRegExp("[0-9]{0,8}\\.?[0-9]{0,8}"));
|
||||||
|
|
||||||
ui->Amount1->setValidator(amtValidator);
|
ui->Amount1->setValidator(amtValidator);
|
||||||
|
|
||||||
// Send button
|
// Send button
|
||||||
@@ -72,8 +73,9 @@ void MainWindow::setupSendTab() {
|
|||||||
ui->lblMinerFeeUSD->setText(Settings::getUSDFormat(txt.toDouble()));
|
ui->lblMinerFeeUSD->setText(Settings::getUSDFormat(txt.toDouble()));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
//Fees validator
|
//Fees validator
|
||||||
auto feesValidator = new QRegExpValidator(QRegExp("[0-9]{0,8}\\.?[0-9]{0,8}"));
|
feesValidator = new QRegExpValidator(QRegExp("[0-9]{0,8}\\.?[0-9]{0,8}"));
|
||||||
ui->minerFeeAmt->setValidator(feesValidator);
|
ui->minerFeeAmt->setValidator(feesValidator);
|
||||||
|
|
||||||
// Font for the first Memo label
|
// Font for the first Memo label
|
||||||
@@ -243,8 +245,8 @@ void MainWindow::addAddressSection() {
|
|||||||
Amount1->setObjectName(QString("Amount") % QString::number(itemNumber));
|
Amount1->setObjectName(QString("Amount") % QString::number(itemNumber));
|
||||||
Amount1->setBaseSize(QSize(200, 0));
|
Amount1->setBaseSize(QSize(200, 0));
|
||||||
Amount1->setAlignment(Qt::AlignRight);
|
Amount1->setAlignment(Qt::AlignRight);
|
||||||
|
|
||||||
// Create the validator for send to/amount fields
|
// Create the validator for send to/amount fields
|
||||||
auto amtValidator = new QRegExpValidator(QRegExp("[0-9]{0,8}\\.?[0-9]{0,8}"));
|
|
||||||
Amount1->setValidator(amtValidator);
|
Amount1->setValidator(amtValidator);
|
||||||
QObject::connect(Amount1, &QLineEdit::textChanged, [=] (auto text) {
|
QObject::connect(Amount1, &QLineEdit::textChanged, [=] (auto text) {
|
||||||
this->amountChanged(itemNumber, text);
|
this->amountChanged(itemNumber, text);
|
||||||
|
|||||||
Reference in New Issue
Block a user