1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-02-21 19:19:26 +02:00

Disable emit macro from Qt to fix Qt-tbb conflict

This commit is contained in:
Ivan Savenko 2024-12-21 15:36:36 +00:00
parent a432009841
commit e2e5fce3b5
11 changed files with 22 additions and 20 deletions

View File

@ -273,6 +273,9 @@ using TLockGuardRec = std::lock_guard<std::recursive_mutex>;
#define VCMI_LIB_WRAP_NAMESPACE(x) ::x
#endif
// Qt defines 'emit' as macros, which conflicts with TBB definition of method with same name
#define QT_NO_EMIT
/* ---------------------------------------------------------------------------- */
/* VCMI standard library */
/* ---------------------------------------------------------------------------- */

View File

@ -122,7 +122,7 @@ void CDownloadManager::downloadFinished(QNetworkReply * reply)
}
if(downloadComplete)
emit finished(successful, failed, encounteredErrors);
finished(successful, failed, encounteredErrors);
file.reply->deleteLater();
file.reply = nullptr;
@ -149,7 +149,7 @@ void CDownloadManager::downloadProgressChanged(qint64 bytesReceived, qint64 byte
if(received > total)
total = received;
emit downloadProgress(received, total);
downloadProgress(received, total);
}
bool CDownloadManager::downloadInProgress(const QUrl & url) const

View File

@ -824,7 +824,7 @@ void CModListView::installFiles(QStringList files)
while(futureExtract.wait_for(std::chrono::milliseconds(10)) != std::future_status::ready)
{
emit extractionProgress(static_cast<int>(prog * 1000.f), 1000);
extractionProgress(static_cast<int>(prog * 1000.f), 1000);
qApp->processEvents();
}

View File

@ -214,7 +214,7 @@ bool ModStateController::doInstallMod(QString modname, QString archivePath)
while(futureExtract.wait_for(std::chrono::milliseconds(10)) != std::future_status::ready)
{
emit extractionProgress(filesCounter, filesToExtract.size());
extractionProgress(filesCounter, filesToExtract.size());
qApp->processEvents();
}

View File

@ -206,7 +206,7 @@ void ModStateItemModel::modChanged(QString modID)
int index = modNameToID.indexOf(modID);
QModelIndex parent = this->parent(createIndex(0, 0, index));
int row = modIndex[modIndexToName(parent)].indexOf(modID);
emit dataChanged(createIndex(row, 0, index), createIndex(row, 4, index));
dataChanged(createIndex(row, 0, index), createIndex(row, 4, index));
}
void ModStateItemModel::endResetModel()

View File

@ -10,7 +10,6 @@
#pragma once
#include "../Global.h"
#include <tbb/concurrent_hash_map.h> // Workaround for Qt / tbb name clash
#define VCMI_EDITOR_NAME "VCMI Map Editor"

View File

@ -23,7 +23,7 @@ ArtifactWidget::ArtifactWidget(CArtifactFittingSet & fittingSet, QWidget * paren
connect(ui->saveButton, &QPushButton::clicked, this, [this]()
{
emit saveArtifact(ui->artifact->currentData().toInt(), ArtifactPosition(ui->possiblePositions->currentData().toInt()));
saveArtifact(ui->artifact->currentData().toInt(), ArtifactPosition(ui->possiblePositions->currentData().toInt()));
close();
});
connect(ui->cancelButton, &QPushButton::clicked, this, &ArtifactWidget::close);

View File

@ -428,8 +428,8 @@ bool QuestDelegate::eventFilter(QObject * object, QEvent * event)
return false;
if(event->type() == QEvent::Close)
{
emit commitData(ed);
emit closeEditor(ed);
commitData(ed);
closeEditor(ed);
return true;
}
}

View File

@ -60,7 +60,7 @@ void RumorSettings::on_add_clicked()
item->setData(Qt::UserRole, QVariant(""));
item->setFlags(item->flags() | Qt::ItemIsEditable);
ui->rumors->addItem(item);
emit ui->rumors->itemActivated(item);
ui->rumors->itemActivated(item);
}
void RumorSettings::on_remove_clicked()

View File

@ -47,7 +47,7 @@ void MinimapView::mouseMoveEvent(QMouseEvent *mouseEvent)
auto pos = mapToScene(mouseEvent->pos());
pos *= 32;
emit cameraPositionChanged(pos);
cameraPositionChanged(pos);
}
void MinimapView::mousePressEvent(QMouseEvent* event)
@ -90,7 +90,7 @@ void MapView::mouseMoveEvent(QMouseEvent *mouseEvent)
if(tile == tilePrev) //do not redraw
return;
emit currentCoordinates(tile.x, tile.y);
currentCoordinates(tile.x, tile.y);
switch(selectionTool)
{
@ -563,7 +563,7 @@ void MapView::mouseReleaseEvent(QMouseEvent *event)
auto selection = sc->selectionObjectsView.getSelection();
if(selection.size() == 1)
{
emit openObjectProperties(*selection.begin(), tab);
openObjectProperties(*selection.begin(), tab);
}
break;
}
@ -618,7 +618,7 @@ void MapView::dropEvent(QDropEvent * event)
{
auto * obj = sc->selectionObjectsView.newObject;
controller->commitObjectCreate(sc->level);
emit openObjectProperties(obj, false);
openObjectProperties(obj, false);
}
else
{
@ -736,13 +736,13 @@ void MapScene::updateViews()
void MapScene::terrainSelected(bool anythingSelected)
{
isTerrainSelected = anythingSelected;
emit selected(isTerrainSelected || isObjectSelected);
selected(isTerrainSelected || isObjectSelected);
}
void MapScene::objectSelected(bool anythingSelected)
{
isObjectSelected = anythingSelected;
emit selected(isTerrainSelected || isObjectSelected);
selected(isTerrainSelected || isObjectSelected);
}
MinimapScene::MinimapScene(int lvl):

View File

@ -182,14 +182,14 @@ void ObjectPickerLayer::select(const CGObjectInstance * obj)
if(obj && possibleObjects.count(obj))
{
clear();
emit selectionMade(obj);
selectionMade(obj);
}
}
void ObjectPickerLayer::discard()
{
clear();
emit selectionMade(nullptr);
selectionMade(nullptr);
}
SelectionTerrainLayer::SelectionTerrainLayer(MapSceneBase * s): AbstractLayer(s)
@ -277,7 +277,7 @@ const std::set<int3> & SelectionTerrainLayer::selection() const
void SelectionTerrainLayer::onSelection()
{
emit selectionMade(!area.empty());
selectionMade(!area.empty());
}
@ -610,7 +610,7 @@ void SelectionObjectsLayer::clear()
void SelectionObjectsLayer::onSelection()
{
emit selectionMade(!selectedObjects.empty());
selectionMade(!selectedObjects.empty());
}
void SelectionObjectsLayer::setLockObject(const CGObjectInstance * object, bool lock)