avoiding deprecation warnings
This commit is contained in:
parent
aca538a89d
commit
05bb54e48d
@ -22,6 +22,7 @@
|
||||
|
||||
#ifdef CONTEXT_MENU
|
||||
#include <QskMenu.h>
|
||||
#include <QskEvent.h>
|
||||
#endif
|
||||
|
||||
#include <QDir>
|
||||
@ -91,7 +92,7 @@ class GraphicLabel : public QskGraphicLabel
|
||||
menu->addItem( "image://shapes/Ellipse/Red", "Setup" );
|
||||
menu->addItem( "image://shapes/Hexagon/PapayaWhip", "Help" );
|
||||
|
||||
menu->setOrigin( event->localPos() );
|
||||
menu->setOrigin( qskMousePosition( event ) );
|
||||
menu->open();
|
||||
|
||||
connect( menu, &QskMenu::triggered,
|
||||
|
@ -5,6 +5,7 @@
|
||||
#include <QskGraphic.h>
|
||||
#include <QskColorFilter.h>
|
||||
#include <QskSkinlet.h>
|
||||
#include <QskEvent.h>
|
||||
|
||||
#include <qvector.h>
|
||||
#include <qvariant.h>
|
||||
@ -256,9 +257,11 @@ QskColorFilter QskMenu::graphicFilterAt( int index ) const
|
||||
|
||||
void QskMenu::mousePressEvent( QMouseEvent* event )
|
||||
{
|
||||
// QGuiApplication::styleHints()->setFocusOnTouchRelease ??
|
||||
|
||||
if ( event->button() == Qt::LeftButton )
|
||||
{
|
||||
const auto index = indexAtPosition( event->localPos() );
|
||||
const auto index = indexAtPosition( qskMousePosition( event ) );
|
||||
if ( index >= 0 )
|
||||
{
|
||||
setCurrentIndex( index );
|
||||
@ -275,7 +278,7 @@ void QskMenu::mouseReleaseEvent( QMouseEvent* event )
|
||||
{
|
||||
m_data->isPressed = false;
|
||||
|
||||
const auto index = indexAtPosition( event->localPos() );
|
||||
const auto index = indexAtPosition( qskMousePosition( event ) );
|
||||
if ( index == m_data->currentIndex )
|
||||
setSelectedIndex( index );
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user