Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Qt] Define QT_NO_KEYWORDS #1044

Merged
merged 1 commit into from
Jan 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Makefile.qt.include
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,7 @@ RES_MOVIES = $(wildcard $(srcdir)/qt/res/movies/spinner-*.png)
BITCOIN_RC = qt/res/pivx-qt-res.rc

BITCOIN_QT_INCLUDES = -I$(builddir)/qt -I$(srcdir)/qt -I$(srcdir)/qt/forms \
-I$(builddir)/qt/forms
-I$(builddir)/qt/forms -DQT_NO_KEYWORDS

qt_libbitcoinqt_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(BITCOIN_QT_INCLUDES) \
$(QT_INCLUDES) $(QT_DBUS_INCLUDES) $(PROTOBUF_CFLAGS) $(QR_CFLAGS) $(SVG_CFLAGS) $(CHARTS_CFLAGS)
Expand Down
3 changes: 2 additions & 1 deletion src/qt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,10 @@ find_program(MOC_BIN NAMES moc moc-qt5 qt5-moc
NO_SYSTEM_ENVIRONMENT_PATH)
if (MOC_BIN)
MESSAGE(STATUS "FOUND MOC ${MOC_BIN}")

endif ()

add_compile_options("-DQT_NO_KEYWORDS")

# Why isn't this done automatically??
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(CMAKE_AUTOMOC_MOC_OPTIONS "-DQ_OS_MAC")
Expand Down
2 changes: 1 addition & 1 deletion src/qt/addressbookpage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ void AddressBookPage::done(int retval)
// Figure out which address was selected, and return it
QModelIndexList indexes = table->selectionModel()->selectedRows(AddressTableModel::Address);

foreach (QModelIndex index, indexes) {
Q_FOREACH (QModelIndex index, indexes) {
QVariant address = table->model()->data(index);
returnValue = address.toString();
}
Expand Down
6 changes: 3 additions & 3 deletions src/qt/addressbookpage.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class AddressBookPage : public QDialog
void setModel(AddressTableModel* model);
const QString& getReturnValue() const { return returnValue; }

public slots:
public Q_SLOTS:
void done(int retval);

private:
Expand All @@ -61,7 +61,7 @@ public slots:
QAction* deleteAction; // to be able to explicitly disable it
QString newAddressToSelect;

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

signals:
Q_SIGNALS:
void sendCoins(QString addr);
};

Expand Down
2 changes: 1 addition & 1 deletion src/qt/addresstablemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ QString AddressTableModel::getAddressToShow() const{

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

void AddressTableModel::notifyChange(const QModelIndex &_index) {
Expand Down
2 changes: 1 addition & 1 deletion src/qt/addresstablemodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class AddressTableModel : public QAbstractTableModel
/** Notify listeners that data changed. */
void emitDataChanged(int index);

public slots:
public Q_SLOTS:
/* Update address list from core.
*/
void updateEntry(const QString& address, const QString& label, bool isMine, const QString& purpose, int status);
Expand Down
2 changes: 1 addition & 1 deletion src/qt/askpassphrasedialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class AskPassphraseDialog : public QDialog, public Runnable

void initWatch(QWidget *parent);

private slots:
private Q_SLOTS:
void onWatchClicked();
void textChanged();
void warningMessage();
Expand Down
4 changes: 2 additions & 2 deletions src/qt/bitcoinamountfield.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class AmountSpinBox : public QAbstractSpinBox
void setValue(const CAmount& value)
{
lineEdit()->setText(BitcoinUnits::format(currentUnit, value, false, BitcoinUnits::separatorAlways));
emit valueChanged();
Q_EMIT valueChanged();
}

void stepBy(int steps)
Expand Down Expand Up @@ -175,7 +175,7 @@ class AmountSpinBox : public QAbstractSpinBox
return rv;
}

signals:
Q_SIGNALS:
void valueChanged();
};

Expand Down
4 changes: 2 additions & 2 deletions src/qt/bitcoinamountfield.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class BitcoinAmountField : public QWidget
*/
QWidget* setupTabChain(QWidget* prev);

signals:
Q_SIGNALS:
void valueChanged();

protected:
Expand All @@ -67,7 +67,7 @@ class BitcoinAmountField : public QWidget
AmountSpinBox* amount;
QValueComboBox* unit;

private slots:
private Q_SLOTS:
void unitChanged(int idx);
};

Expand Down
12 changes: 6 additions & 6 deletions src/qt/clientmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,10 @@ void ClientModel::updateTimer()
prevAttempt = masternodeSync.RequestedMasternodeAttempt;
prevAssets = masternodeSync.RequestedMasternodeAssets;

emit numBlocksChanged(newNumBlocks);
Q_EMIT numBlocksChanged(newNumBlocks);
}

emit bytesChanged(getTotalBytesRecv(), getTotalBytesSent());
Q_EMIT bytesChanged(getTotalBytesRecv(), getTotalBytesSent());
}

void ClientModel::updateMnTimer()
Expand All @@ -172,13 +172,13 @@ void ClientModel::updateMnTimer()
if (cachedMasternodeCountString != newMasternodeCountString) {
cachedMasternodeCountString = newMasternodeCountString;

emit strMasternodesChanged(cachedMasternodeCountString);
Q_EMIT strMasternodesChanged(cachedMasternodeCountString);
}
}

void ClientModel::updateNumConnections(int numConnections)
{
emit numConnectionsChanged(numConnections);
Q_EMIT numConnectionsChanged(numConnections);
}

void ClientModel::updateAlert(const QString& hash, int status)
Expand All @@ -189,11 +189,11 @@ void ClientModel::updateAlert(const QString& hash, int status)
hash_256.SetHex(hash.toStdString());
CAlert alert = CAlert::getAlertByHash(hash_256);
if (!alert.IsNull()) {
emit message(tr("Network Alert"), QString::fromStdString(alert.strStatusBar), CClientUIInterface::ICON_ERROR);
Q_EMIT message(tr("Network Alert"), QString::fromStdString(alert.strStatusBar), CClientUIInterface::ICON_ERROR);
}
}

emit alertsChanged(getStatusBarWarnings());
Q_EMIT alertsChanged(getStatusBarWarnings());
}

bool ClientModel::inInitialBlockDownload() const
Expand Down
4 changes: 2 additions & 2 deletions src/qt/clientmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class ClientModel : public QObject
void subscribeToCoreSignals();
void unsubscribeFromCoreSignals();

signals:
Q_SIGNALS:
void numConnectionsChanged(int count);
void numBlocksChanged(int count);
void strMasternodesChanged(const QString& strMasternodes);
Expand All @@ -112,7 +112,7 @@ class ClientModel : public QObject
// Show progress dialog e.g. for verifychain
void showProgress(const QString& title, int nProgress);

public slots:
public Q_SLOTS:
void updateTimer();
void updateMnTimer();
void updateNumConnections(int numConnections);
Expand Down
2 changes: 1 addition & 1 deletion src/qt/coincontroldialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ void CoinControlDialog::updateLabels(WalletModel* model, QDialog* dialog)
CAmount nPayAmount = 0;
bool fDust = false;
CMutableTransaction txDummy;
foreach (const CAmount& amount, CoinControlDialog::payAmounts) {
Q_FOREACH (const CAmount& amount, CoinControlDialog::payAmounts) {
nPayAmount += amount;

if (amount > 0) {
Expand Down
2 changes: 1 addition & 1 deletion src/qt/coincontroldialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class CoinControlDialog : public QDialog
};
friend class CCoinControlWidgetItem;

private slots:
private Q_SLOTS:
void showMenu(const QPoint&);
void copyAmount();
void copyLabel();
Expand Down
2 changes: 1 addition & 1 deletion src/qt/editaddressdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class EditAddressDialog : public QDialog
QString getAddress() const;
void setAddress(const QString& address);

public slots:
public Q_SLOTS:
void accept();

private:
Expand Down
2 changes: 1 addition & 1 deletion src/qt/guiutil.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ class TableViewLastColumnResizingFixer : public QObject
void setViewHeaderResizeMode(int logicalIndex, QHeaderView::ResizeMode resizeMode);
void resizeColumn(int nColumnIndex, int width);

private slots:
private Q_SLOTS:
void on_sectionResized(int logicalIndex, int oldSize, int newSize);
void on_geometriesChanged();
};
Expand Down
10 changes: 5 additions & 5 deletions src/qt/intro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ class FreespaceChecker : public QObject
ST_ERROR
};

public slots:
public Q_SLOTS:
void check();

signals:
Q_SIGNALS:
void reply(int status, const QString& message, quint64 available);

private:
Expand Down Expand Up @@ -100,7 +100,7 @@ void FreespaceChecker::check()
replyStatus = ST_ERROR;
replyMessage = tr("Cannot create data directory here.");
}
emit reply(replyStatus, replyMessage, freeBytesAvailable);
Q_EMIT reply(replyStatus, replyMessage, freeBytesAvailable);
}


Expand Down Expand Up @@ -139,7 +139,7 @@ Intro::~Intro()
{
delete ui;
/* Ensure thread is finished before it is deleted */
emit stopThread();
Q_EMIT stopThread();
thread->wait();
}

Expand Down Expand Up @@ -304,7 +304,7 @@ void Intro::checkPath(const QString& dataDir)
pathToCheck = dataDir;
if (!signalled) {
signalled = true;
emit requestCheck();
Q_EMIT requestCheck();
}
mutex.unlock();
}
Expand Down
6 changes: 3 additions & 3 deletions src/qt/intro.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ class Intro : public QDialog
*/
static QString getDefaultDataDirectory();

signals:
Q_SIGNALS:
void requestCheck();
void stopThread();

public slots:
public Q_SLOTS:
void setStatus(int status, const QString& message, quint64 bytesAvailable);

private slots:
private Q_SLOTS:
void on_dataDirectory_textChanged(const QString& arg1);
void on_ellipsisButton_clicked();
void on_dataDirDefault_clicked();
Expand Down
2 changes: 1 addition & 1 deletion src/qt/macdockiconhandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class MacDockIconHandler : public QObject
static void cleanup();
void handleDockIconClickEvent();

signals:
Q_SIGNALS:
void dockIconClicked();

private:
Expand Down
2 changes: 1 addition & 1 deletion src/qt/macdockiconhandler.mm
Original file line number Diff line number Diff line change
Expand Up @@ -124,5 +124,5 @@ void setupDockClickHandler() {
this->mainWindow->show();
}

emit this->dockIconClicked();
Q_EMIT this->dockIconClicked();
}
2 changes: 1 addition & 1 deletion src/qt/notificator.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class Notificator : public QObject
Critical /**< An error occurred */
};

public slots:
public Q_SLOTS:
/** Show notification message.
@param[in] cls general message class
@param[in] title title shown with message
Expand Down
4 changes: 2 additions & 2 deletions src/qt/openuridialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ class OpenURIDialog : public QDialog
QString getURI();
void showEvent(QShowEvent *event) override;

protected slots:
protected Q_SLOTS:
void accept() override;

private slots:
private Q_SLOTS:
void on_selectFileButton_clicked();

private:
Expand Down
4 changes: 2 additions & 2 deletions src/qt/optionsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ OptionsDialog::OptionsDialog(QWidget* parent, bool enableWallet) : QDialog(paren
/* Language selector */
QDir translations(":translations");
ui->lang->addItem(QString("(") + tr("default") + QString(")"), QVariant(""));
foreach (const QString& langStr, translations.entryList()) {
Q_FOREACH (const QString& langStr, translations.entryList()) {
QLocale locale(langStr);

/** check if the locale name consists of 2 parts (language_country) */
Expand Down Expand Up @@ -343,7 +343,7 @@ bool OptionsDialog::eventFilter(QObject* object, QEvent* event)
{
if (event->type() == QEvent::FocusOut) {
if (object == ui->proxyIp || object == ui->proxyPort) {
emit proxyIpChecks(ui->proxyIp, ui->proxyPort);
Q_EMIT proxyIpChecks(ui->proxyIp, ui->proxyPort);
}
}
return QDialog::eventFilter(object, event);
Expand Down
4 changes: 2 additions & 2 deletions src/qt/optionsdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class OptionsDialog : public QDialog
protected:
bool eventFilter(QObject* object, QEvent* event);

private slots:
private Q_SLOTS:
/* enable OK button */
void enableOkButton();
/* disable OK button */
Expand All @@ -54,7 +54,7 @@ private slots:
void clearStatusLabel();
void doProxyIpChecks(QValidatedLineEdit* pUiProxyIp, QLineEdit* pUiProxyPort);

signals:
Q_SIGNALS:
void proxyIpChecks(QValidatedLineEdit* pUiProxyIp, QLineEdit* pUiProxyPort);

private:
Expand Down
Loading