Skip to content

Commit 620444b

Browse files
committed
Fix broken q4 test build
Error reported by Patrick Strateman <[email protected]> bitcoin/bitcoin#10420 (comment)
1 parent 4314544 commit 620444b

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/qt/test/wallettests.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,17 @@ QModelIndex FindTx(const QAbstractItemModel& model, const uint256& txid)
9090
return {};
9191
}
9292

93+
//! Request context menu (call method that is public in qt5, but protected in qt4).
94+
void RequestContextMenu(QWidget* widget)
95+
{
96+
class Qt4Hack : public QWidget
97+
{
98+
public:
99+
using QWidget::customContextMenuRequested;
100+
};
101+
static_cast<Qt4Hack*>(widget)->customContextMenuRequested({});
102+
}
103+
93104
//! Invoke bumpfee on txid and check results.
94105
void BumpFee(TransactionView& view, const uint256& txid, bool expectDisabled, std::string expectError, bool cancel)
95106
{
@@ -102,7 +113,7 @@ void BumpFee(TransactionView& view, const uint256& txid, bool expectDisabled, st
102113
QAction* action = view.findChild<QAction*>("bumpFeeAction");
103114
table->selectionModel()->select(index, QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows);
104115
action->setEnabled(expectDisabled);
105-
table->customContextMenuRequested({});
116+
RequestContextMenu(table);
106117
QCOMPARE(action->isEnabled(), !expectDisabled);
107118

108119
action->setEnabled(true);

0 commit comments

Comments
 (0)