Skip to content

Commit 11edb0d

Browse files
committed
Merge pull request #6433
d29ec6c qt: define QT_NO_KEYWORDS (Wladimir J. van der Laan)
2 parents fd5dfda + d29ec6c commit 11edb0d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+184
-184
lines changed

src/Makefile.qt.include

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ RES_MOVIES = $(wildcard qt/res/movies/spinner-*.png)
322322
BITCOIN_RC = qt/res/bitcoin-qt-res.rc
323323

324324
BITCOIN_QT_INCLUDES = -I$(builddir)/qt -I$(srcdir)/qt -I$(srcdir)/qt/forms \
325-
-I$(builddir)/qt/forms
325+
-I$(builddir)/qt/forms -DQT_NO_KEYWORDS
326326

327327
qt_libbitcoinqt_a_CPPFLAGS = $(BITCOIN_INCLUDES) $(BITCOIN_QT_INCLUDES) \
328328
$(QT_INCLUDES) $(QT_DBUS_INCLUDES) $(PROTOBUF_CFLAGS) $(QR_CFLAGS)

src/qt/addressbookpage.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ void AddressBookPage::done(int retval)
254254
// Figure out which address was selected, and return it
255255
QModelIndexList indexes = table->selectionModel()->selectedRows(AddressTableModel::Address);
256256

257-
foreach (const QModelIndex& index, indexes) {
257+
Q_FOREACH (const QModelIndex& index, indexes) {
258258
QVariant address = table->model()->data(index);
259259
returnValue = address.toString();
260260
}

src/qt/addressbookpage.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class AddressBookPage : public QDialog
4545
void setModel(AddressTableModel *model);
4646
const QString &getReturnValue() const { return returnValue; }
4747

48-
public slots:
48+
public Q_SLOTS:
4949
void done(int retval);
5050

5151
private:
@@ -59,7 +59,7 @@ public slots:
5959
QAction *deleteAction; // to be able to explicitly disable it
6060
QString newAddressToSelect;
6161

62-
private slots:
62+
private Q_SLOTS:
6363
/** Delete currently selected address entry */
6464
void on_deleteAddress_clicked();
6565
/** Create a new address for receiving coins and / or add a new address book entry */
@@ -80,7 +80,7 @@ private slots:
8080
/** New entry/entries were added to address table */
8181
void selectNewAddress(const QModelIndex &parent, int begin, int /*end*/);
8282

83-
signals:
83+
Q_SIGNALS:
8484
void sendCoins(QString addr);
8585
};
8686

src/qt/addresstablemodel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,5 +450,5 @@ int AddressTableModel::lookupAddress(const QString &address) const
450450

451451
void AddressTableModel::emitDataChanged(int idx)
452452
{
453-
emit dataChanged(index(idx, 0, QModelIndex()), index(idx, columns.length()-1, QModelIndex()));
453+
Q_EMIT dataChanged(index(idx, 0, QModelIndex()), index(idx, columns.length()-1, QModelIndex()));
454454
}

src/qt/addresstablemodel.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ class AddressTableModel : public QAbstractTableModel
8484
/** Notify listeners that data changed. */
8585
void emitDataChanged(int index);
8686

87-
public slots:
87+
public Q_SLOTS:
8888
/* Update address list from core.
8989
*/
9090
void updateEntry(const QString &address, const QString &label, bool isMine, const QString &purpose, int status);

src/qt/askpassphrasedialog.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class AskPassphraseDialog : public QDialog
4040
WalletModel *model;
4141
bool fCapsLock;
4242

43-
private slots:
43+
private Q_SLOTS:
4444
void textChanged();
4545

4646
protected:

src/qt/bitcoin.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -169,11 +169,11 @@ class BitcoinCore: public QObject
169169
public:
170170
explicit BitcoinCore();
171171

172-
public slots:
172+
public Q_SLOTS:
173173
void initialize();
174174
void shutdown();
175175

176-
signals:
176+
Q_SIGNALS:
177177
void initializeResult(int retval);
178178
void shutdownResult(int retval);
179179
void runawayException(const QString &message);
@@ -216,13 +216,13 @@ class BitcoinApplication: public QApplication
216216
/// Get window identifier of QMainWindow (BitcoinGUI)
217217
WId getMainWinId() const;
218218

219-
public slots:
219+
public Q_SLOTS:
220220
void initializeResult(int retval);
221221
void shutdownResult(int retval);
222222
/// Handle runaway exceptions. Shows a message box with the problem and quits the program.
223223
void handleRunawayException(const QString &message);
224224

225-
signals:
225+
Q_SIGNALS:
226226
void requestedInitialize();
227227
void requestedShutdown();
228228
void stopThread();
@@ -253,7 +253,7 @@ BitcoinCore::BitcoinCore():
253253
void BitcoinCore::handleRunawayException(const std::exception *e)
254254
{
255255
PrintExceptionContinue(e, "Runaway exception");
256-
emit runawayException(QString::fromStdString(strMiscWarning));
256+
Q_EMIT runawayException(QString::fromStdString(strMiscWarning));
257257
}
258258

259259
void BitcoinCore::initialize()
@@ -269,7 +269,7 @@ void BitcoinCore::initialize()
269269
*/
270270
StartDummyRPCThread();
271271
}
272-
emit initializeResult(rv);
272+
Q_EMIT initializeResult(rv);
273273
} catch (const std::exception& e) {
274274
handleRunawayException(&e);
275275
} catch (...) {
@@ -286,7 +286,7 @@ void BitcoinCore::shutdown()
286286
threadGroup.join_all();
287287
Shutdown();
288288
qDebug() << __func__ << ": Shutdown finished";
289-
emit shutdownResult(1);
289+
Q_EMIT shutdownResult(1);
290290
} catch (const std::exception& e) {
291291
handleRunawayException(&e);
292292
} catch (...) {
@@ -315,7 +315,7 @@ BitcoinApplication::~BitcoinApplication()
315315
if(coreThread)
316316
{
317317
qDebug() << __func__ << ": Stopping thread";
318-
emit stopThread();
318+
Q_EMIT stopThread();
319319
coreThread->wait();
320320
qDebug() << __func__ << ": Stopped thread";
321321
}
@@ -386,7 +386,7 @@ void BitcoinApplication::requestInitialize()
386386
{
387387
qDebug() << __func__ << ": Requesting initialize";
388388
startThread();
389-
emit requestedInitialize();
389+
Q_EMIT requestedInitialize();
390390
}
391391

392392
void BitcoinApplication::requestShutdown()
@@ -409,7 +409,7 @@ void BitcoinApplication::requestShutdown()
409409
ShutdownWindow::showShutdownWindow(window);
410410

411411
// Request shutdown from core thread
412-
emit requestedShutdown();
412+
Q_EMIT requestedShutdown();
413413
}
414414

415415
void BitcoinApplication::initializeResult(int retval)
@@ -449,7 +449,7 @@ void BitcoinApplication::initializeResult(int retval)
449449
{
450450
window->show();
451451
}
452-
emit splashFinished(window);
452+
Q_EMIT splashFinished(window);
453453

454454
#ifdef ENABLE_WALLET
455455
// Now that initialization/startup is done, process any command-line

src/qt/bitcoinamountfield.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class AmountSpinBox: public QAbstractSpinBox
6161
void setValue(const CAmount& value)
6262
{
6363
lineEdit()->setText(BitcoinUnits::format(currentUnit, value, false, BitcoinUnits::separatorAlways));
64-
emit valueChanged();
64+
Q_EMIT valueChanged();
6565
}
6666

6767
void stepBy(int steps)
@@ -184,7 +184,7 @@ class AmountSpinBox: public QAbstractSpinBox
184184
return rv;
185185
}
186186

187-
signals:
187+
Q_SIGNALS:
188188
void valueChanged();
189189
};
190190

src/qt/bitcoinamountfield.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class BitcoinAmountField: public QWidget
5656
*/
5757
QWidget *setupTabChain(QWidget *prev);
5858

59-
signals:
59+
Q_SIGNALS:
6060
void valueChanged();
6161

6262
protected:
@@ -67,7 +67,7 @@ class BitcoinAmountField: public QWidget
6767
AmountSpinBox *amount;
6868
QValueComboBox *unit;
6969

70-
private slots:
70+
private Q_SLOTS:
7171
void unitChanged(int idx);
7272

7373
};

src/qt/bitcoingui.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,7 @@ void BitcoinGUI::openClicked()
600600
OpenURIDialog dlg(this);
601601
if(dlg.exec())
602602
{
603-
emit receivedURI(dlg.getURI());
603+
Q_EMIT receivedURI(dlg.getURI());
604604
}
605605
}
606606

@@ -886,9 +886,9 @@ void BitcoinGUI::dropEvent(QDropEvent *event)
886886
{
887887
if(event->mimeData()->hasUrls())
888888
{
889-
foreach(const QUrl &uri, event->mimeData()->urls())
889+
Q_FOREACH(const QUrl &uri, event->mimeData()->urls())
890890
{
891-
emit receivedURI(uri.toString());
891+
Q_EMIT receivedURI(uri.toString());
892892
}
893893
}
894894
event->acceptProposedAction();
@@ -1050,7 +1050,7 @@ UnitDisplayStatusBarControl::UnitDisplayStatusBarControl() :
10501050
QList<BitcoinUnits::Unit> units = BitcoinUnits::availableUnits();
10511051
int max_width = 0;
10521052
const QFontMetrics fm(font());
1053-
foreach (const BitcoinUnits::Unit unit, units)
1053+
Q_FOREACH (const BitcoinUnits::Unit unit, units)
10541054
{
10551055
max_width = qMax(max_width, fm.width(BitcoinUnits::name(unit)));
10561056
}
@@ -1069,7 +1069,7 @@ void UnitDisplayStatusBarControl::mousePressEvent(QMouseEvent *event)
10691069
void UnitDisplayStatusBarControl::createContextMenu()
10701070
{
10711071
menu = new QMenu();
1072-
foreach(BitcoinUnits::Unit u, BitcoinUnits::availableUnits())
1072+
Q_FOREACH(BitcoinUnits::Unit u, BitcoinUnits::availableUnits())
10731073
{
10741074
QAction *menuAction = new QAction(QString(BitcoinUnits::name(u)), this);
10751075
menuAction->setData(QVariant(u));

0 commit comments

Comments
 (0)