More WDraggableSpinBox fixes (prevent dragging with right click, disable context menu popups in World Editor)

This commit is contained in:
parax0 2015-07-30 23:08:18 -04:00
parent 2a0134fbfc
commit 4450606fbf
2 changed files with 32 additions and 8 deletions

View File

@ -153,7 +153,10 @@
</size>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
<enum>Qt::TabFocus</enum>
</property>
<property name="contextMenuPolicy">
<enum>Qt::NoContextMenu</enum>
</property>
<property name="correctionMode">
<enum>QAbstractSpinBox::CorrectToNearestValue</enum>
@ -203,7 +206,10 @@
</size>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
<enum>Qt::TabFocus</enum>
</property>
<property name="contextMenuPolicy">
<enum>Qt::NoContextMenu</enum>
</property>
<property name="correctionMode">
<enum>QAbstractSpinBox::CorrectToNearestValue</enum>
@ -253,7 +259,10 @@
</size>
</property>
<property name="focusPolicy">
<enum>Qt::ClickFocus</enum>
<enum>Qt::TabFocus</enum>
</property>
<property name="contextMenuPolicy">
<enum>Qt::NoContextMenu</enum>
</property>
<property name="correctionMode">
<enum>QAbstractSpinBox::CorrectToNearestValue</enum>
@ -302,6 +311,9 @@
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="contextMenuPolicy">
<enum>Qt::NoContextMenu</enum>
</property>
<property name="frame">
<bool>true</bool>
</property>
@ -458,6 +470,9 @@
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QTabWidget" name="TabWidget">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="tabPosition">
<enum>QTabWidget::North</enum>
</property>
@ -465,7 +480,7 @@
<enum>QTabWidget::Rounded</enum>
</property>
<property name="currentIndex">
<number>1</number>
<number>0</number>
</property>
<property name="iconSize">
<size>
@ -882,6 +897,12 @@
<header>WDraggableSpinBox.h</header>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>XSpinBox</tabstop>
<tabstop>YSpinBox</tabstop>
<tabstop>ZSpinBox</tabstop>
<tabstop>TabWidget</tabstop>
</tabstops>
<resources>
<include location="../Icons.qrc"/>
</resources>

View File

@ -17,11 +17,14 @@ WDraggableSpinBox::~WDraggableSpinBox()
{
}
void WDraggableSpinBox::mousePressEvent(QMouseEvent*)
void WDraggableSpinBox::mousePressEvent(QMouseEvent *pEvent)
{
mBeingDragged = true;
mBeenDragged = false;
mLastY = QCursor::pos().y();
if (pEvent->button() == Qt::LeftButton)
{
mBeingDragged = true;
mBeenDragged = false;
mLastY = QCursor::pos().y();
}
}
void WDraggableSpinBox::mouseReleaseEvent(QMouseEvent *Event)