Skip to content

Commit b054aa6

Browse files
committed
Drag'n'Drop is denied when app is running
1 parent a931332 commit b054aa6

File tree

5 files changed

+10
-4
lines changed

5 files changed

+10
-4
lines changed

src/core/gui/dataview/core_dataviewmodel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ QVariant mbCoreDataViewModel::headerData(int section, Qt::Orientation orientatio
5858
return QVariant();
5959
}
6060

61-
int mbCoreDataViewModel::columnCount(const QModelIndex &parent) const
61+
int mbCoreDataViewModel::columnCount(const QModelIndex &/*parent*/) const
6262
{
6363
return m_dataView->getColumnCount();
6464
}

src/core/gui/dialogs/core_dialogdataviewitem.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ void mbCoreDialogDataViewItem::fillFormEditInner(const MBSETTINGS &/*settings*/)
543543
// base implementation do nothing
544544
}
545545

546-
void mbCoreDialogDataViewItem::fillFormNewInner(const MBSETTINGS &settings)
546+
void mbCoreDialogDataViewItem::fillFormNewInner(const MBSETTINGS &/*settings*/)
547547
{
548548
// base implementation do nothing
549549
}

src/core/gui/project/core_projecttreeview.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
#include <QMouseEvent>
66
#include <QDrag>
77

8+
#include <core.h>
9+
810
mbCoreProjectTreeView::mbCoreProjectTreeView(QWidget *parent) : QTreeView(parent)
911
{
1012

@@ -19,6 +21,8 @@ void mbCoreProjectTreeView::mousePressEvent(QMouseEvent *event)
1921

2022
void mbCoreProjectTreeView::mouseMoveEvent(QMouseEvent *event)
2123
{
24+
if (mbCore::globalCore()->isRunning())
25+
return;
2226
if (!(event->buttons() & Qt::LeftButton))
2327
return;
2428
if ((event->pos() - m_dragStartPosition).manhattanLength() < QApplication::startDragDistance())
@@ -39,6 +43,8 @@ void mbCoreProjectTreeView::mouseMoveEvent(QMouseEvent *event)
3943

4044
void mbCoreProjectTreeView::dropEvent(QDropEvent *event)
4145
{
46+
if (mbCore::globalCore()->isRunning())
47+
return;
4248
QModelIndex index = indexAt(event->pos());
4349
if (index.isValid())
4450
model()->dropMimeData(event->mimeData(), event->dropAction(), index.row(), index.column(), index.parent());

src/server/gui/dialogs/settings/server_widgetsettingsscript.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ mbServerWidgetSettingsScript::mbServerWidgetSettingsScript(QWidget *parent) :
5555
m_modelImportPath = new QStringListModel(this);
5656
ui->viewImportPath->setModel(m_modelImportPath);
5757
ui->viewImportPath->setSelectionMode(QAbstractItemView::ExtendedSelection);
58-
connect(m_modelImportPath, &QAbstractItemModel::dataChanged, this, [this](const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> &roles = QVector<int>())
58+
connect(m_modelImportPath, &QAbstractItemModel::dataChanged, this, [this](const QModelIndex &topLeft, const QModelIndex &, const QVector<int> &)
5959
{
6060
QModelIndex newIndex = topLeft;
6161
if (m_modelImportPath->data(newIndex).toString().trimmed().isEmpty())

src/server/runtime/server_runscriptthread.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ struct MemWork
5656

5757
QSharedMemory::SharedMemoryError initMem(QSharedMemory &mem, size_t size)
5858
{
59-
mem.create(size);
59+
mem.create(static_cast<int>(size));
6060
QSharedMemory::SharedMemoryError r = mem.error();
6161
switch (r)
6262
{

0 commit comments

Comments
 (0)