forked from qt-creator/qt-creator
All: Fix some more Qt 6.7 induced deprecation warnings
Change-Id: I4f3fc9c34ff664ab153d4a9a641ec84a11e555a9 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -187,7 +187,7 @@ namespace ADS
|
|||||||
void DockWidgetTabPrivate::moveTab(QMouseEvent *event)
|
void DockWidgetTabPrivate::moveTab(QMouseEvent *event)
|
||||||
{
|
{
|
||||||
event->accept();
|
event->accept();
|
||||||
QPoint distance = event->globalPos() - m_globalDragStartMousePosition;
|
QPoint distance = event->globalPosition().toPoint() - m_globalDragStartMousePosition;
|
||||||
distance.setY(0);
|
distance.setY(0);
|
||||||
auto targetPos = distance + m_tabDragStartPosition;
|
auto targetPos = distance + m_tabDragStartPosition;
|
||||||
targetPos.rx() = qMax(targetPos.x(), 0);
|
targetPos.rx() = qMax(targetPos.x(), 0);
|
||||||
@@ -294,7 +294,7 @@ namespace ADS
|
|||||||
{
|
{
|
||||||
if (event->button() == Qt::LeftButton) {
|
if (event->button() == Qt::LeftButton) {
|
||||||
event->accept();
|
event->accept();
|
||||||
d->saveDragStartMousePosition(event->globalPos());
|
d->saveDragStartMousePosition(event->globalPosition().toPoint());
|
||||||
d->m_dragState = DraggingMousePressed;
|
d->m_dragState = DraggingMousePressed;
|
||||||
emit clicked();
|
emit clicked();
|
||||||
return;
|
return;
|
||||||
@@ -314,7 +314,7 @@ namespace ADS
|
|||||||
case DraggingTab:
|
case DraggingTab:
|
||||||
// End of tab moving, emit signal
|
// End of tab moving, emit signal
|
||||||
if (d->m_dockArea) {
|
if (d->m_dockArea) {
|
||||||
emit moved(event->globalPos());
|
emit moved(event->globalPosition().toPoint());
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -354,7 +354,7 @@ namespace ADS
|
|||||||
auto mappedPos = mapToParent(event->pos());
|
auto mappedPos = mapToParent(event->pos());
|
||||||
bool mouseOutsideBar = (mappedPos.x() < 0) || (mappedPos.x() > parentWidget()->rect().right());
|
bool mouseOutsideBar = (mappedPos.x() < 0) || (mappedPos.x() > parentWidget()->rect().right());
|
||||||
// Maybe a fixed drag distance is better here ?
|
// Maybe a fixed drag distance is better here ?
|
||||||
int dragDistanceY = qAbs(d->m_globalDragStartMousePosition.y() - event->globalPos().y());
|
int dragDistanceY = qAbs(d->m_globalDragStartMousePosition.y() - event->globalPosition().toPoint().y());
|
||||||
if (dragDistanceY >= DockManager::startDragDistance() || mouseOutsideBar) {
|
if (dragDistanceY >= DockManager::startDragDistance() || mouseOutsideBar) {
|
||||||
// If this is the last dock area in a dock container with only
|
// If this is the last dock area in a dock container with only
|
||||||
// one single dock widget it does not make sense to move it to a new
|
// one single dock widget it does not make sense to move it to a new
|
||||||
@@ -382,7 +382,7 @@ namespace ADS
|
|||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
} else if (d->m_dockArea->openDockWidgetsCount() > 1
|
} else if (d->m_dockArea->openDockWidgetsCount() > 1
|
||||||
&& (event->globalPos() - d->m_globalDragStartMousePosition).manhattanLength()
|
&& (event->globalPosition().toPoint() - d->m_globalDragStartMousePosition).manhattanLength()
|
||||||
>= QApplication::startDragDistance()) // Wait a few pixels before start moving
|
>= QApplication::startDragDistance()) // Wait a few pixels before start moving
|
||||||
{
|
{
|
||||||
// If we start dragging the tab, we save its initial position to
|
// If we start dragging the tab, we save its initial position to
|
||||||
@@ -502,7 +502,7 @@ namespace ADS
|
|||||||
// sense to move it to a new floating widget and leave this one empty
|
// sense to move it to a new floating widget and leave this one empty
|
||||||
if ((!d->m_dockArea->dockContainer()->isFloating() || d->m_dockArea->dockWidgetsCount() > 1)
|
if ((!d->m_dockArea->dockContainer()->isFloating() || d->m_dockArea->dockWidgetsCount() > 1)
|
||||||
&& d->m_dockWidget->features().testFlag(DockWidget::DockWidgetFloatable)) {
|
&& d->m_dockWidget->features().testFlag(DockWidget::DockWidgetFloatable)) {
|
||||||
d->saveDragStartMousePosition(event->globalPos());
|
d->saveDragStartMousePosition(event->globalPosition().toPoint());
|
||||||
d->startFloating(DraggingInactive);
|
d->startFloating(DraggingInactive);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -44,7 +44,7 @@ DragWidget::DragWidget(QWidget *parent) : QFrame(parent)
|
|||||||
void DragWidget::mousePressEvent(QMouseEvent * event)
|
void DragWidget::mousePressEvent(QMouseEvent * event)
|
||||||
{
|
{
|
||||||
if (event->button() == Qt::LeftButton) {
|
if (event->button() == Qt::LeftButton) {
|
||||||
m_startPos = event->globalPos() - parentWidget()->mapToGlobal((pos()));
|
m_startPos = event->globalPosition().toPoint() - parentWidget()->mapToGlobal((pos()));
|
||||||
m_opacityEffect = new QGraphicsOpacityEffect;
|
m_opacityEffect = new QGraphicsOpacityEffect;
|
||||||
setGraphicsEffect(m_opacityEffect);
|
setGraphicsEffect(m_opacityEffect);
|
||||||
event->accept();
|
event->accept();
|
||||||
@@ -77,7 +77,7 @@ void DragWidget::mouseMoveEvent(QMouseEvent * event)
|
|||||||
{
|
{
|
||||||
if (event->buttons() & Qt::LeftButton) {
|
if (event->buttons() & Qt::LeftButton) {
|
||||||
if (m_startPos != QPoint(-1, -1)) {
|
if (m_startPos != QPoint(-1, -1)) {
|
||||||
QPoint newPos = parentWidget()->mapFromGlobal(event->globalPos() - m_startPos);
|
QPoint newPos = parentWidget()->mapFromGlobal(event->globalPosition().toPoint() - m_startPos);
|
||||||
|
|
||||||
newPos.setX(limit(newPos.x(), 20, parentWidget()->width() - 20 - width()));
|
newPos.setX(limit(newPos.x(), 20, parentWidget()->width() - 20 - width()));
|
||||||
newPos.setY(limit(newPos.y(), 2, parentWidget()->height() - 20 - height()));
|
newPos.setY(limit(newPos.y(), 2, parentWidget()->height() - 20 - height()));
|
||||||
|
@@ -587,7 +587,7 @@ ItemViewEvent::ItemViewEvent(QEvent *ev, QAbstractItemView *view)
|
|||||||
case QEvent::DragEnter:
|
case QEvent::DragEnter:
|
||||||
case QEvent::DragMove:
|
case QEvent::DragMove:
|
||||||
case QEvent::Drop:
|
case QEvent::Drop:
|
||||||
m_pos = static_cast<QDropEvent *>(ev)->pos();
|
m_pos = static_cast<QDropEvent *>(ev)->position().toPoint();
|
||||||
m_index = view->indexAt(m_pos);
|
m_index = view->indexAt(m_pos);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@@ -99,7 +99,7 @@ static int indexOf(Id id)
|
|||||||
void ModeManagerPrivate::showMenu(int index, QMouseEvent *event)
|
void ModeManagerPrivate::showMenu(int index, QMouseEvent *event)
|
||||||
{
|
{
|
||||||
QTC_ASSERT(m_modes.at(index)->menu(), return);
|
QTC_ASSERT(m_modes.at(index)->menu(), return);
|
||||||
m_modes.at(index)->menu()->popup(event->globalPos());
|
m_modes.at(index)->menu()->popup(event->globalPosition().toPoint());
|
||||||
}
|
}
|
||||||
|
|
||||||
ModeManager::ModeManager(Internal::MainWindow *mainWindow,
|
ModeManager::ModeManager(Internal::MainWindow *mainWindow,
|
||||||
|
@@ -173,7 +173,7 @@ public:
|
|||||||
void DraggableLabel::mousePressEvent(QMouseEvent * event)
|
void DraggableLabel::mousePressEvent(QMouseEvent * event)
|
||||||
{
|
{
|
||||||
if (active && event->button() == Qt::LeftButton) {
|
if (active && event->button() == Qt::LeftButton) {
|
||||||
m_moveStartPos = event->globalPos();
|
m_moveStartPos = event->globalPosition().toPoint();
|
||||||
event->accept();
|
event->accept();
|
||||||
}
|
}
|
||||||
QLabel::mousePressEvent(event);
|
QLabel::mousePressEvent(event);
|
||||||
@@ -190,7 +190,7 @@ void DraggableLabel::mouseMoveEvent(QMouseEvent * event)
|
|||||||
{
|
{
|
||||||
if (active && (event->buttons() & Qt::LeftButton)) {
|
if (active && (event->buttons() & Qt::LeftButton)) {
|
||||||
if (m_moveStartPos != QPoint(-1, -1)) {
|
if (m_moveStartPos != QPoint(-1, -1)) {
|
||||||
const QPoint newPos = event->globalPos();
|
const QPoint newPos = event->globalPosition().toPoint();
|
||||||
const QPoint offset = newPos - m_moveStartPos;
|
const QPoint offset = newPos - m_moveStartPos;
|
||||||
|
|
||||||
m_target->move(m_target->pos() + offset);
|
m_target->move(m_target->pos() + offset);
|
||||||
|
@@ -226,7 +226,7 @@ QString UnifiedDiffEditorWidget::lineNumber(int blockNumber) const
|
|||||||
const QString line = lineExists
|
const QString line = lineExists
|
||||||
? QString::number(m_data.m_lineNumbers[side].value(blockNumber).first)
|
? QString::number(m_data.m_lineNumbers[side].value(blockNumber).first)
|
||||||
: QString();
|
: QString();
|
||||||
lineNumberString += QString(m_data.m_lineNumberDigits[side] - line.count(), ' ') + line;
|
lineNumberString += QString(m_data.m_lineNumberDigits[side] - line.size(), ' ') + line;
|
||||||
};
|
};
|
||||||
addSideNumber(LeftSide, leftLineExists);
|
addSideNumber(LeftSide, leftLineExists);
|
||||||
lineNumberString += '|';
|
lineNumberString += '|';
|
||||||
@@ -263,7 +263,7 @@ void UnifiedDiffData::setLineNumber(DiffSide side, int blockNumber, int lineNumb
|
|||||||
QTC_ASSERT(side < SideCount, return);
|
QTC_ASSERT(side < SideCount, return);
|
||||||
const QString lineNumberString = QString::number(lineNumber);
|
const QString lineNumberString = QString::number(lineNumber);
|
||||||
m_lineNumbers[side].insert(blockNumber, {lineNumber, rowNumberInChunk});
|
m_lineNumbers[side].insert(blockNumber, {lineNumber, rowNumberInChunk});
|
||||||
m_lineNumberDigits[side] = qMax(m_lineNumberDigits[side], lineNumberString.count());
|
m_lineNumberDigits[side] = qMax(m_lineNumberDigits[side], lineNumberString.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
QString UnifiedDiffData::setChunk(const DiffEditorInput &input, const ChunkData &chunkData,
|
QString UnifiedDiffData::setChunk(const DiffEditorInput &input, const ChunkData &chunkData,
|
||||||
|
@@ -535,7 +535,7 @@ public:
|
|||||||
projectModel->resetProjects();
|
projectModel->resetProjects();
|
||||||
});
|
});
|
||||||
contextMenu.addAction(action);
|
contextMenu.addAction(action);
|
||||||
contextMenu.exec(mouseEvent->globalPos());
|
contextMenu.exec(mouseEvent->globalPosition().toPoint());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -59,7 +59,7 @@ bool AssetsLibraryWidget::eventFilter(QObject *obj, QEvent *event)
|
|||||||
} else if (event->type() == QMouseEvent::MouseMove) {
|
} else if (event->type() == QMouseEvent::MouseMove) {
|
||||||
if (!m_assetsToDrag.isEmpty() && m_assetsView->model()) {
|
if (!m_assetsToDrag.isEmpty() && m_assetsView->model()) {
|
||||||
QMouseEvent *me = static_cast<QMouseEvent *>(event);
|
QMouseEvent *me = static_cast<QMouseEvent *>(event);
|
||||||
if ((me->globalPos() - m_dragStartPoint).manhattanLength() > 10) {
|
if ((me->globalPosition().toPoint() - m_dragStartPoint).manhattanLength() > 10) {
|
||||||
QMimeData *mimeData = new QMimeData;
|
QMimeData *mimeData = new QMimeData;
|
||||||
mimeData->setData(Constants::MIME_TYPE_ASSETS, m_assetsToDrag.join(',').toUtf8());
|
mimeData->setData(Constants::MIME_TYPE_ASSETS, m_assetsToDrag.join(',').toUtf8());
|
||||||
|
|
||||||
|
@@ -61,7 +61,7 @@ bool ContentLibraryWidget::eventFilter(QObject *obj, QEvent *event)
|
|||||||
|
|
||||||
if (m_materialToDrag) {
|
if (m_materialToDrag) {
|
||||||
QMouseEvent *me = static_cast<QMouseEvent *>(event);
|
QMouseEvent *me = static_cast<QMouseEvent *>(event);
|
||||||
if ((me->globalPos() - m_dragStartPoint).manhattanLength() > 20
|
if ((me->globalPosition().toPoint() - m_dragStartPoint).manhattanLength() > 20
|
||||||
&& m_materialToDrag->isDownloaded()) {
|
&& m_materialToDrag->isDownloaded()) {
|
||||||
QByteArray data;
|
QByteArray data;
|
||||||
QMimeData *mimeData = new QMimeData;
|
QMimeData *mimeData = new QMimeData;
|
||||||
@@ -76,7 +76,7 @@ bool ContentLibraryWidget::eventFilter(QObject *obj, QEvent *event)
|
|||||||
}
|
}
|
||||||
} else if (m_textureToDrag) {
|
} else if (m_textureToDrag) {
|
||||||
QMouseEvent *me = static_cast<QMouseEvent *>(event);
|
QMouseEvent *me = static_cast<QMouseEvent *>(event);
|
||||||
if ((me->globalPos() - m_dragStartPoint).manhattanLength() > 20
|
if ((me->globalPosition().toPoint() - m_dragStartPoint).manhattanLength() > 20
|
||||||
&& m_textureToDrag->isDownloaded()) {
|
&& m_textureToDrag->isDownloaded()) {
|
||||||
QMimeData *mimeData = new QMimeData;
|
QMimeData *mimeData = new QMimeData;
|
||||||
mimeData->setData(Constants::MIME_TYPE_BUNDLE_TEXTURE,
|
mimeData->setData(Constants::MIME_TYPE_BUNDLE_TEXTURE,
|
||||||
|
@@ -341,14 +341,14 @@ void GraphicsView::keyPressEvent(QKeyEvent *event)
|
|||||||
|
|
||||||
void GraphicsView::mousePressEvent(QMouseEvent *event)
|
void GraphicsView::mousePressEvent(QMouseEvent *event)
|
||||||
{
|
{
|
||||||
if (m_playhead.mousePress(globalToScene(event->globalPos()))) {
|
if (m_playhead.mousePress(globalToScene(event->globalPosition().toPoint()))) {
|
||||||
m_dragging = true;
|
m_dragging = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Shortcut shortcut(event);
|
Shortcut shortcut(event);
|
||||||
if (shortcut == m_style.shortcuts.insertKeyframe) {
|
if (shortcut == m_style.shortcuts.insertKeyframe) {
|
||||||
m_scene->insertKeyframe(globalToRaster(event->globalPos()).x());
|
m_scene->insertKeyframe(globalToRaster(event->globalPosition().toPoint()).x());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -371,7 +371,7 @@ void GraphicsView::mousePressEvent(QMouseEvent *event)
|
|||||||
|
|
||||||
void GraphicsView::mouseMoveEvent(QMouseEvent *event)
|
void GraphicsView::mouseMoveEvent(QMouseEvent *event)
|
||||||
{
|
{
|
||||||
if (m_playhead.mouseMove(globalToScene(event->globalPos()), this))
|
if (m_playhead.mouseMove(globalToScene(event->globalPosition().toPoint()), this))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
QGraphicsView::mouseMoveEvent(event);
|
QGraphicsView::mouseMoveEvent(event);
|
||||||
|
@@ -38,7 +38,7 @@ void Selector::mousePress(QMouseEvent *event, GraphicsView *view, GraphicsScene
|
|||||||
{
|
{
|
||||||
m_shortcut = Shortcut(event);
|
m_shortcut = Shortcut(event);
|
||||||
|
|
||||||
QPointF click = view->globalToScene(event->globalPos());
|
QPointF click = view->globalToScene(event->globalPosition().toPoint());
|
||||||
|
|
||||||
if (SelectableItem *sitem = scene->intersect(click)) {
|
if (SelectableItem *sitem = scene->intersect(click)) {
|
||||||
KeyframeItem *kitem = qobject_cast<KeyframeItem *>(sitem);
|
KeyframeItem *kitem = qobject_cast<KeyframeItem *>(sitem);
|
||||||
@@ -54,8 +54,8 @@ void Selector::mousePress(QMouseEvent *event, GraphicsView *view, GraphicsScene
|
|||||||
applyPreSelection(scene);
|
applyPreSelection(scene);
|
||||||
|
|
||||||
// Init selection tools.
|
// Init selection tools.
|
||||||
m_mouseInit = event->globalPos();
|
m_mouseInit = event->globalPosition().toPoint();
|
||||||
m_mouseCurr = event->globalPos();
|
m_mouseCurr = event->globalPosition().toPoint();
|
||||||
|
|
||||||
m_lasso = QPainterPath(click);
|
m_lasso = QPainterPath(click);
|
||||||
m_lasso.closeSubpath();
|
m_lasso.closeSubpath();
|
||||||
@@ -72,17 +72,17 @@ void Selector::mouseMove(QMouseEvent *event,
|
|||||||
if (m_mouseInit.isNull())
|
if (m_mouseInit.isNull())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if ((event->globalPos() - m_mouseInit).manhattanLength() < QApplication::startDragDistance())
|
if ((event->globalPosition().toPoint() - m_mouseInit).manhattanLength() < QApplication::startDragDistance())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
QPointF delta = event->globalPos() - m_mouseCurr;
|
QPointF delta = event->globalPosition().toPoint() - m_mouseCurr;
|
||||||
if (m_shortcut == m_shortcuts.newSelection || m_shortcut == m_shortcuts.addToSelection
|
if (m_shortcut == m_shortcuts.newSelection || m_shortcut == m_shortcuts.addToSelection
|
||||||
|| m_shortcut == m_shortcuts.removeFromSelection
|
|| m_shortcut == m_shortcuts.removeFromSelection
|
||||||
|| m_shortcut == m_shortcuts.toggleSelection) {
|
|| m_shortcut == m_shortcuts.toggleSelection) {
|
||||||
if (scene->hasActiveItem())
|
if (scene->hasActiveItem())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
select(m_tool, view->globalToScene(event->globalPos()), scene);
|
select(m_tool, view->globalToScene(event->globalPosition().toPoint()), scene);
|
||||||
|
|
||||||
event->accept();
|
event->accept();
|
||||||
view->viewport()->update();
|
view->viewport()->update();
|
||||||
@@ -91,13 +91,13 @@ void Selector::mouseMove(QMouseEvent *event,
|
|||||||
double bigger = std::abs(delta.x()) > std::abs(delta.y()) ? delta.x() : delta.y();
|
double bigger = std::abs(delta.x()) > std::abs(delta.y()) ? delta.x() : delta.y();
|
||||||
double factor = bigger / view->width();
|
double factor = bigger / view->width();
|
||||||
view->setZoomX(view->zoomX() + factor, m_mouseInit);
|
view->setZoomX(view->zoomX() + factor, m_mouseInit);
|
||||||
m_mouseCurr = event->globalPos();
|
m_mouseCurr = event->globalPosition().toPoint();
|
||||||
event->accept();
|
event->accept();
|
||||||
|
|
||||||
} else if (m_shortcut == m_shortcuts.pan) {
|
} else if (m_shortcut == m_shortcuts.pan) {
|
||||||
view->scrollContent(-delta.x(), -delta.y());
|
view->scrollContent(-delta.x(), -delta.y());
|
||||||
playhead.resize(view);
|
playhead.resize(view);
|
||||||
m_mouseCurr = event->globalPos();
|
m_mouseCurr = event->globalPosition().toPoint();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -77,7 +77,7 @@ bool ItemLibraryWidget::eventFilter(QObject *obj, QEvent *event)
|
|||||||
} else if (event->type() == QMouseEvent::MouseMove) {
|
} else if (event->type() == QMouseEvent::MouseMove) {
|
||||||
if (m_itemToDrag.isValid()) {
|
if (m_itemToDrag.isValid()) {
|
||||||
QMouseEvent *me = static_cast<QMouseEvent *>(event);
|
QMouseEvent *me = static_cast<QMouseEvent *>(event);
|
||||||
if ((me->globalPos() - m_dragStartPoint).manhattanLength() > 10) {
|
if ((me->globalPosition().toPoint() - m_dragStartPoint).manhattanLength() > 10) {
|
||||||
ItemLibraryEntry entry = m_itemToDrag.value<ItemLibraryEntry>();
|
ItemLibraryEntry entry = m_itemToDrag.value<ItemLibraryEntry>();
|
||||||
// For drag to be handled correctly, we must have the component properly imported
|
// For drag to be handled correctly, we must have the component properly imported
|
||||||
// beforehand, so we import the module immediately when the drag starts
|
// beforehand, so we import the module immediately when the drag starts
|
||||||
|
@@ -95,7 +95,7 @@ bool MaterialBrowserWidget::eventFilter(QObject *obj, QEvent *event)
|
|||||||
|
|
||||||
if (m_materialToDrag.isValid() || m_textureToDrag.isValid()) {
|
if (m_materialToDrag.isValid() || m_textureToDrag.isValid()) {
|
||||||
QMouseEvent *me = static_cast<QMouseEvent *>(event);
|
QMouseEvent *me = static_cast<QMouseEvent *>(event);
|
||||||
if ((me->globalPos() - m_dragStartPoint).manhattanLength() > 20) {
|
if ((me->globalPosition().toPoint() - m_dragStartPoint).manhattanLength() > 20) {
|
||||||
bool isMaterial = m_materialToDrag.isValid();
|
bool isMaterial = m_materialToDrag.isValid();
|
||||||
QMimeData *mimeData = new QMimeData;
|
QMimeData *mimeData = new QMimeData;
|
||||||
QByteArray internalId;
|
QByteArray internalId;
|
||||||
|
@@ -288,7 +288,7 @@ bool NameItemDelegate::editorEvent(QEvent *event, QAbstractItemModel *, const QS
|
|||||||
if (event->type() == QEvent::MouseButtonRelease) {
|
if (event->type() == QEvent::MouseButtonRelease) {
|
||||||
auto mouseEvent = static_cast<QMouseEvent *>(event);
|
auto mouseEvent = static_cast<QMouseEvent *>(event);
|
||||||
if (mouseEvent->button() == Qt::RightButton) {
|
if (mouseEvent->button() == Qt::RightButton) {
|
||||||
openContextMenu(index, mouseEvent->globalPos());
|
openContextMenu(index, mouseEvent->globalPosition().toPoint());
|
||||||
mouseEvent->accept();
|
mouseEvent->accept();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@@ -340,14 +340,14 @@ void ColorPaletteBackend::releaseEyeDropper()
|
|||||||
|
|
||||||
bool ColorPaletteBackend::handleEyeDropperMouseMove(QMouseEvent *e)
|
bool ColorPaletteBackend::handleEyeDropperMouseMove(QMouseEvent *e)
|
||||||
{
|
{
|
||||||
updateEyeDropperPosition(e->globalPos());
|
updateEyeDropperPosition(e->globalPosition().toPoint());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ColorPaletteBackend::handleEyeDropperMouseButtonRelease(QMouseEvent *e)
|
bool ColorPaletteBackend::handleEyeDropperMouseButtonRelease(QMouseEvent *e)
|
||||||
{
|
{
|
||||||
if (e->button() == Qt::LeftButton)
|
if (e->button() == Qt::LeftButton)
|
||||||
emit currentColorChanged(grabScreenColor(e->globalPos()));
|
emit currentColorChanged(grabScreenColor(e->globalPosition().toPoint()));
|
||||||
else
|
else
|
||||||
emit eyeDropperRejected();
|
emit eyeDropperRejected();
|
||||||
|
|
||||||
@@ -364,7 +364,7 @@ bool ColorPaletteBackend::handleEyeDropperKeyPress(QKeyEvent *e)
|
|||||||
} //else
|
} //else
|
||||||
#endif
|
#endif
|
||||||
//if (e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter) {
|
//if (e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter) {
|
||||||
// emit currentColorChanged(grabScreenColor(e->globalPos()));
|
// emit currentColorChanged(grabScreenColor(e->globalPosition().toPoint()));
|
||||||
// releaseEyeDropper();
|
// releaseEyeDropper();
|
||||||
//}
|
//}
|
||||||
e->accept();
|
e->accept();
|
||||||
|
@@ -23,7 +23,7 @@ void SizeGrip::resizeEvent(QResizeEvent *e)
|
|||||||
void SizeGrip::mousePressEvent(QMouseEvent *e)
|
void SizeGrip::mousePressEvent(QMouseEvent *e)
|
||||||
{
|
{
|
||||||
QWidget::mousePressEvent(e);
|
QWidget::mousePressEvent(e);
|
||||||
m_startPoint = e->globalPos();
|
m_startPoint = e->globalPosition().toPoint();
|
||||||
m_startRect = parentWidget()->rect();
|
m_startRect = parentWidget()->rect();
|
||||||
m_mouseDown = true;
|
m_mouseDown = true;
|
||||||
checkCursor(e->pos());
|
checkCursor(e->pos());
|
||||||
@@ -32,7 +32,7 @@ void SizeGrip::mousePressEvent(QMouseEvent *e)
|
|||||||
void SizeGrip::mouseMoveEvent(QMouseEvent *e)
|
void SizeGrip::mouseMoveEvent(QMouseEvent *e)
|
||||||
{
|
{
|
||||||
if (m_mouseDown) {
|
if (m_mouseDown) {
|
||||||
QPoint p = e->globalPos() - m_startPoint;
|
QPoint p = e->globalPosition().toPoint() - m_startPoint;
|
||||||
parentWidget()->resize(m_startRect.width() + p.x(), m_startRect.height() + p.y());
|
parentWidget()->resize(m_startRect.width() + p.x(), m_startRect.height() + p.y());
|
||||||
} else {
|
} else {
|
||||||
checkCursor(e->pos());
|
checkCursor(e->pos());
|
||||||
|
@@ -37,5 +37,5 @@ void TreeView::mousePressEvent(QMouseEvent *event)
|
|||||||
{
|
{
|
||||||
QTreeView::mousePressEvent(event);
|
QTreeView::mousePressEvent(event);
|
||||||
if (event->button() == Qt::RightButton)
|
if (event->button() == Qt::RightButton)
|
||||||
emit rightButtonClicked(currentIndex(), event->globalPos());
|
emit rightButtonClicked(currentIndex(), event->globalPosition().toPoint());
|
||||||
}
|
}
|
||||||
|
@@ -1339,7 +1339,7 @@ void TerminalWidget::mousePressEvent(QMouseEvent *event)
|
|||||||
contextMenu->addSeparator();
|
contextMenu->addSeparator();
|
||||||
contextMenu->addAction(configureAction);
|
contextMenu->addAction(configureAction);
|
||||||
|
|
||||||
contextMenu->popup(event->globalPos());
|
contextMenu->popup(event->globalPosition().toPoint());
|
||||||
} else if (m_selection) {
|
} else if (m_selection) {
|
||||||
copyToClipboard();
|
copyToClipboard();
|
||||||
setSelection(std::nullopt);
|
setSelection(std::nullopt);
|
||||||
|
@@ -78,7 +78,7 @@ void SizeHandleRect::mousePressEvent(QMouseEvent *e)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
m_startSize = m_curSize = m_resizable->size();
|
m_startSize = m_curSize = m_resizable->size();
|
||||||
m_startPos = m_curPos = m_resizable->mapFromGlobal(e->globalPos());
|
m_startPos = m_curPos = m_resizable->mapFromGlobal(e->globalPosition().toPoint());
|
||||||
if (debugSizeHandle)
|
if (debugSizeHandle)
|
||||||
qDebug() << "SizeHandleRect::mousePressEvent" << m_startSize << m_startPos << m_curPos;
|
qDebug() << "SizeHandleRect::mousePressEvent" << m_startSize << m_startPos << m_curPos;
|
||||||
|
|
||||||
@@ -94,7 +94,7 @@ void SizeHandleRect::mouseMoveEvent(QMouseEvent *e)
|
|||||||
// causes the handle and the mouse cursor to become out of sync
|
// causes the handle and the mouse cursor to become out of sync
|
||||||
// once a min/maxSize limit is hit. When the cursor reenters the valid
|
// once a min/maxSize limit is hit. When the cursor reenters the valid
|
||||||
// areas, it will now snap to it.
|
// areas, it will now snap to it.
|
||||||
m_curPos = m_resizable->mapFromGlobal(e->globalPos());
|
m_curPos = m_resizable->mapFromGlobal(e->globalPosition().toPoint());
|
||||||
QSize delta = QSize(m_curPos.x() - m_startPos.x(), m_curPos.y() - m_startPos.y());
|
QSize delta = QSize(m_curPos.x() - m_startPos.x(), m_curPos.y() - m_startPos.y());
|
||||||
switch (m_dir) {
|
switch (m_dir) {
|
||||||
case Right:
|
case Right:
|
||||||
|
Reference in New Issue
Block a user