forked from qt-creator/qt-creator
ModelingLib: Fix deprecation warning
"warning: ‘int QMouseEvent::x() const’ is deprecated: Use position()" Change-Id: Icb61991c68d7a596ed01a6b7a5c592348055a774 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -101,7 +101,7 @@ void PaletteBox::mousePressEvent(QMouseEvent *event)
|
|||||||
{
|
{
|
||||||
qreal w = static_cast<qreal>(width()) / static_cast<qreal>(m_brushes.size());
|
qreal w = static_cast<qreal>(width()) / static_cast<qreal>(m_brushes.size());
|
||||||
|
|
||||||
int i = static_cast<int>((event->x() / w));
|
int i = static_cast<int>((event->position().x() / w));
|
||||||
QMT_ASSERT(i >= 0 && i < m_brushes.size(), return);
|
QMT_ASSERT(i >= 0 && i < m_brushes.size(), return);
|
||||||
setCurrentIndex(i);
|
setCurrentIndex(i);
|
||||||
if (m_currentIndex >= 0 && m_currentIndex < m_brushes.size())
|
if (m_currentIndex >= 0 && m_currentIndex < m_brushes.size())
|
||||||
|
Reference in New Issue
Block a user