Merge pull request #153 from Drayshak/develop
Better right-click behaviour, context menu on mouse-up instead of down, fixes #151
This commit is contained in:
commit
c33e5ca62e
@ -177,7 +177,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi
|
|||||||
view->setFrameShape(QFrame::NoFrame);
|
view->setFrameShape(QFrame::NoFrame);
|
||||||
view->setModel(proxymodel);
|
view->setModel(proxymodel);
|
||||||
|
|
||||||
view->setContextMenuPolicy(Qt::CustomContextMenu);
|
//view->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||||
connect(view, SIGNAL(customContextMenuRequested(const QPoint &)), this,
|
connect(view, SIGNAL(customContextMenuRequested(const QPoint &)), this,
|
||||||
SLOT(showInstanceContextMenu(const QPoint &)));
|
SLOT(showInstanceContextMenu(const QPoint &)));
|
||||||
|
|
||||||
|
@ -380,6 +380,14 @@ void GroupView::mouseReleaseEvent(QMouseEvent *event)
|
|||||||
bool click = (index == m_pressedIndex && index.isValid()) ||
|
bool click = (index == m_pressedIndex && index.isValid()) ||
|
||||||
(m_pressedCategory && m_pressedCategory == categoryAt(geometryPos));
|
(m_pressedCategory && m_pressedCategory == categoryAt(geometryPos));
|
||||||
|
|
||||||
|
bool isRight = event->button() == Qt::RightButton;
|
||||||
|
|
||||||
|
if((index == m_pressedIndex && index.isValid()) && isRight)
|
||||||
|
{
|
||||||
|
emit customContextMenuRequested(event->pos());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (click && m_pressedCategory)
|
if (click && m_pressedCategory)
|
||||||
{
|
{
|
||||||
if (state() == ExpandingState)
|
if (state() == ExpandingState)
|
||||||
|
Loading…
Reference in New Issue
Block a user