Disable cursor while hovering over MapView. Remove unnecessary connection.

This commit is contained in:
p620
2020-10-31 18:21:16 +03:00
parent a8463ffac8
commit b199bd37f5
2 changed files with 7 additions and 2 deletions

View File

@@ -1342,6 +1342,7 @@ MapView::MapView( math::degrees camera_yaw0
, _modeStampTool{&_showStampPalette, &_cursorRotation, this}
, _modeStampPaletteMain{this}
{
setCursor(Qt::BlankCursor);
_main_window->setCorner(Qt::TopLeftCorner, Qt::LeftDockWidgetArea);
_main_window->setCorner(Qt::BottomLeftCorner, Qt::LeftDockWidgetArea);
_main_window->setCorner(Qt::TopRightCorner, Qt::RightDockWidgetArea);

View File

@@ -26,8 +26,12 @@ PaletteMain::PaletteMain(MapView* parent)
_view.setIconSize({128, 128});
_view.setWrapping(true);
_view.setModel(&_model);
connect(&_view, &QAbstractItemView::clicked, [this](QModelIndex const& index) -> void { emit itemSelected(index.data(Qt::UserRole).value<QPixmap const*>()); });
connect(this, &PaletteMain::itemSelected, [parent](QPixmap const* pixmap) -> void { parent->setBrushTexture(pixmap); });
connect(&_view, &QAbstractItemView::clicked, [this, parent](QModelIndex const& index) -> void
{
QPixmap const* pixmap{index.data(Qt::UserRole).value<QPixmap const*>()};
parent->setBrushTexture(pixmap);
emit itemSelected(pixmap);
});
_layout.addWidget(&_view);
}