Skip to content

Commit f3c7603

Browse files
committed
qt, refactor: Convert SendCoinsEntry to a sub-QWidget
It is no longer needed to derive the `SendCoinsEntry` class from the `QStackedWidget` one.
1 parent 6420fb2 commit f3c7603

File tree

3 files changed

+5
-14
lines changed

3 files changed

+5
-14
lines changed

src/qt/forms/sendcoinsentry.ui

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<ui version="4.0">
33
<class>SendCoinsEntry</class>
4-
<widget class="QStackedWidget" name="SendCoinsEntry">
4+
<widget class="QWidget" name="SendCoinsEntry">
55
<property name="geometry">
66
<rect>
77
<x>0</x>
@@ -16,10 +16,6 @@
1616
<property name="autoFillBackground">
1717
<bool>false</bool>
1818
</property>
19-
<widget class="QFrame" name="SendCoins">
20-
<property name="frameShape">
21-
<enum>QFrame::NoFrame</enum>
22-
</property>
2319
<layout class="QGridLayout" name="gridLayout">
2420
<property name="topMargin">
2521
<number>8</number>
@@ -218,7 +214,6 @@
218214
</widget>
219215
</item>
220216
</layout>
221-
</widget>
222217
</widget>
223218
<customwidgets>
224219
<customwidget>

src/qt/sendcoinsentry.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#include <QClipboard>
2121

2222
SendCoinsEntry::SendCoinsEntry(const PlatformStyle *_platformStyle, QWidget *parent) :
23-
QStackedWidget(parent),
23+
QWidget(parent),
2424
ui(new Ui::SendCoinsEntry),
2525
model(nullptr),
2626
platformStyle(_platformStyle)
@@ -31,8 +31,6 @@ SendCoinsEntry::SendCoinsEntry(const PlatformStyle *_platformStyle, QWidget *par
3131
ui->pasteButton->setIcon(platformStyle->SingleColorIcon(":/icons/editpaste"));
3232
ui->deleteButton->setIcon(platformStyle->SingleColorIcon(":/icons/remove"));
3333

34-
setCurrentWidget(ui->SendCoins);
35-
3634
if (platformStyle->getUseExtraSpacing())
3735
ui->payToLayout->setSpacing(4);
3836

@@ -227,7 +225,7 @@ void SendCoinsEntry::changeEvent(QEvent* e)
227225
ui->deleteButton->setIcon(platformStyle->SingleColorIcon(QStringLiteral(":/icons/remove")));
228226
}
229227

230-
QStackedWidget::changeEvent(e);
228+
QWidget::changeEvent(e);
231229
}
232230

233231
bool SendCoinsEntry::updateLabel(const QString &address)

src/qt/sendcoinsentry.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
#include <qt/sendcoinsrecipient.h>
99

10-
#include <QStackedWidget>
10+
#include <QWidget>
1111

1212
class WalletModel;
1313
class PlatformStyle;
@@ -22,10 +22,8 @@ namespace Ui {
2222

2323
/**
2424
* A single entry in the dialog for sending bitcoins.
25-
* Stacked widget, with different UIs for payment requests
26-
* with a strong payee identity.
2725
*/
28-
class SendCoinsEntry : public QStackedWidget
26+
class SendCoinsEntry : public QWidget
2927
{
3028
Q_OBJECT
3129

0 commit comments

Comments
 (0)