Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fmPOS
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xiaojing.zhang
fmPOS
Commits
f0da09cb
Commit
f0da09cb
authored
Mar 17, 2017
by
NitefullWind
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1. 导航界面使用状态机和动画重新实现。 2. 登录界面去掉阴影和扩展键盘。
parent
b4b4a9c2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
98 additions
and
219 deletions
+98
-219
fmp_home/fmnumpad.cpp
+3
-7
fmp_home/fmnumpad.h
+3
-3
fmp_home/fmnumpad.ui
+1
-87
fmp_home/fmp_he_handlers.cpp
+0
-1
fmp_home/fmp_home.pro
+4
-4
fmp_home/fmp_home_navwindow.cpp
+58
-58
fmp_home/fmp_home_navwindow.h
+6
-22
fmp_home/fmp_home_navwindow.ui
+13
-7
fmp_home/fmp_login.cpp
+6
-21
fmp_home/fmp_login.h
+1
-6
fmp_home/fmp_login.ui
+0
-0
fmp_home/fmp_wnd.cpp
+1
-1
fmp_home/menubutton.cpp
+2
-2
fmp_home/res/img/fm-icon_02.png
+0
-0
No files found.
fmp_home/fm
p_num_
pad.cpp
→
fmp_home/fm
num
pad.cpp
View file @
f0da09cb
#
include
"fm
p_num_
pad.h"
#
include
"fm
num
pad.h"
#include "ui_fmnumpad.h"
#include <QLineEdit>
FMNumPad
::
FMNumPad
(
Q
Dialog
*
parent
)
:
FMPWnd
(
parent
),
FMNumPad
::
FMNumPad
(
Q
Widget
*
parent
)
:
QWidget
(
parent
),
ui
(
new
Ui
::
FMNumPad
),
_lineEdit
(
nullptr
)
{
...
...
@@ -24,10 +24,6 @@ FMNumPad::FMNumPad(QDialog *parent) :
FMNumPad
::~
FMNumPad
()
{
delete
ui
;
if
(
_lineEdit
)
{
delete
_lineEdit
;
_lineEdit
=
nullptr
;
}
}
void
FMNumPad
::
on_digit_clicked
()
...
...
fmp_home/fm
p_num_
pad.h
→
fmp_home/fm
num
pad.h
View file @
f0da09cb
#
ifndef
FMNUMPAD_H
#define FMNUMPAD_H
#include
"fmp_wnd.h"
#include
<QWidget>
class
QLineEdit
;
...
...
@@ -9,12 +9,12 @@ namespace Ui {
class
FMNumPad
;
}
class
FMNumPad
:
public
FMPWnd
class
FMNumPad
:
public
QWidget
{
Q_OBJECT
public
:
explicit
FMNumPad
(
Q
Dialog
*
parent
=
0
);
explicit
FMNumPad
(
Q
Widget
*
parent
=
0
);
~
FMNumPad
();
void
setLineEdit
(
QLineEdit
*
lineEdit
);
...
...
fmp_home/fmnumpad.ui
View file @
f0da09cb
...
...
@@ -7,7 +7,7 @@
<x>
0
</x>
<y>
0
</y>
<width>
246
</width>
<height>
305
</height>
<height>
234
</height>
</rect>
</property>
<property
name=
"windowTitle"
>
...
...
@@ -106,79 +106,6 @@ QPushButton:hover {
<number>
0
</number>
</property>
<item>
<widget
class=
"QWidget"
name=
"title"
native=
"true"
>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout"
>
<property
name=
"spacing"
>
<number>
0
</number>
</property>
<property
name=
"leftMargin"
>
<number>
0
</number>
</property>
<property
name=
"topMargin"
>
<number>
0
</number>
</property>
<property
name=
"rightMargin"
>
<number>
0
</number>
</property>
<property
name=
"bottomMargin"
>
<number>
0
</number>
</property>
<item>
<widget
class=
"QLabel"
name=
"title_label"
>
<property
name=
"text"
>
<string>
数字键盘
</string>
</property>
</widget>
</item>
<item>
<spacer
name=
"horizontalSpacer"
>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
40
</width>
<height>
20
</height>
</size>
</property>
</spacer>
</item>
<item>
<widget
class=
"QPushButton"
name=
"close_btn"
>
<property
name=
"minimumSize"
>
<size>
<width>
34
</width>
<height>
34
</height>
</size>
</property>
<property
name=
"maximumSize"
>
<size>
<width>
34
</width>
<height>
34
</height>
</size>
</property>
<property
name=
"text"
>
<string/>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<spacer
name=
"verticalSpacer"
>
<property
name=
"orientation"
>
<enum>
Qt::Vertical
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
20
</width>
<height>
10
</height>
</size>
</property>
</spacer>
</item>
<item>
<layout
class=
"QGridLayout"
name=
"gridLayout"
>
<property
name=
"leftMargin"
>
<number>
10
</number>
...
...
@@ -289,19 +216,6 @@ QPushButton:hover {
</item>
</layout>
</item>
<item>
<spacer
name=
"verticalSpacer_2"
>
<property
name=
"orientation"
>
<enum>
Qt::Vertical
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
20
</width>
<height>
10
</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<resources/>
...
...
fmp_home/fmp_he_handlers.cpp
View file @
f0da09cb
...
...
@@ -14,7 +14,6 @@ FMPStartEventHandler::FMPStartEventHandler(ctkPluginContext *ctx, FMPHome *home)
void
FMPStartEventHandler
::
handleEvent
(
const
ctkEvent
&
event
)
{
qDebug
()
<<
"==========="
;
if
(
_home
)
{
QString
ack_topic
=
event
.
getTopic
();
//! com/fmp/services/REQ_START/id
...
...
fmp_home/fmp_home.pro
View file @
f0da09cb
...
...
@@ -19,9 +19,9 @@ SOURCES +=\
menubutton
.
cpp
\
fmp_wnd
.
cpp
\
fmp_login
.
cpp
\
fmp_num_pad
.
cpp
\
fmnetwork
.
cpp
\
fmp_he_handlers
.
cpp
fmp_he_handlers
.
cpp
\
fmnumpad
.
cpp
HEADERS
+=
fmp_home
.
h
\
fmp_home_plugin_p
.
h
\
...
...
@@ -31,9 +31,9 @@ HEADERS += fmp_home.h \
fmp_wnd
.
h
\
fmp_login
.
h
\
menubutton
.
h
\
fmp_num_pad
.
h
\
fmnetwork
.
h
\
fmp_he_handlers
.
h
fmp_he_handlers
.
h
\
fmnumpad
.
h
FORMS
+=
\
fmp_home_navwindow
.
ui
\
...
...
fmp_home/fmp_home_navwindow.cpp
View file @
f0da09cb
...
...
@@ -4,7 +4,10 @@
#include <QDebug>
#include <QDesktopWidget>
#include <QParallelAnimationGroup>
#include <QSequentialAnimationGroup>
#include <QPropertyAnimation>
#include <QEasingCurve>
#include <QStateMachine>
#include <fmp_settings_i.h>
NavWindow
::
NavWindow
(
FMPSettingsInterface
*&
settings
,
QWidget
*
parent
)
:
...
...
@@ -12,6 +15,7 @@ NavWindow::NavWindow(FMPSettingsInterface *&settings, QWidget *parent) :
ui
(
new
Ui
::
NavWindow
),
_btn_group
(
new
QButtonGroup
(
this
)),
_animationShow
(
new
QParallelAnimationGroup
(
this
)),
_stateMachine
(
new
QStateMachine
(
this
)),
PI
(
3.1415926
),
_settings
(
settings
)
{
...
...
@@ -20,23 +24,19 @@ NavWindow::NavWindow(FMPSettingsInterface *&settings, QWidget *parent) :
btns
.
push_back
(
"payment"
);
btns
.
push_back
(
"tool"
);
btns
.
push_back
(
"tool"
);
MenuUiProp
.
distance
=
100
;
MenuUiProp
.
beginAngle
=
-
(
PI
*
0.45
);
MenuUiProp
.
endAngle
=
(
PI
*
0.45
);
MenuUiProp
.
beginAngle
=
-
(
PI
/
2
);
MenuUiProp
.
endAngle
=
(
PI
/
2
);
MenuUiProp
.
interval
=
(
PI
)
/
4
;
isUseAnimation
=
_settings
->
GetBool
(
FMP_INIKEY_HOMEANIMATION
);
setNavStatus
(
Default
);
this
->
setAttribute
(
Qt
::
WA_TranslucentBackground
);
this
->
setWindowFlags
(
windowFlags
()
|
Qt
::
FramelessWindowHint
|
Qt
::
WindowStaysOnTopHint
|
Qt
::
Tool
);
connect
(
_btn_group
,
SIGNAL
(
buttonClicked
(
QAbstractButton
*
)),
this
,
SLOT
(
onMenuBtnClicked
(
QAbstractButton
*
)));
initMenu
();
connect
(
this
,
SIGNAL
(
statusChanged
(
NavStatus
)),
this
,
SLOT
(
onStatusChanged
(
NavStatus
)));
connect
(
_animationShow
,
&
QParallelAnimationGroup
::
finished
,
this
,
[
=
](){
ui
->
navMainBtn
->
lower
();
});
}
NavWindow
::~
NavWindow
()
...
...
@@ -46,65 +46,85 @@ NavWindow::~NavWindow()
delete
ui
;
}
void
NavWindow
::
setNavStatus
(
const
NavStatus
status
)
{
this
->
_status
=
status
;
emit
statusChanged
(
status
);
}
void
NavWindow
::
on_navMainBtn_clicked
()
{
int
status
=
this
->
_status
;
status
=
(
status
+
1
)
%
2
;
setNavStatus
((
NavStatus
)
status
);
}
void
NavWindow
::
spreadMenus
(
const
bool
isSpread
)
{
//! Start animation.
if
(
isSpread
&&
isUseAnimation
)
{
if
(
!
isSpread
)
{
ui
->
navMainBtn
->
raise
();
_animationShow
->
start
();
}
//! Set the menu btns are visible.
foreach
(
QAbstractButton
*
b
,
_btn_group
->
buttons
())
{
auto
btn
=
qobject_cast
<
QPushButton
*>
(
b
);
btn
->
setVisible
(
isSpread
);
if
(
isUseAnimation
)
{
auto
dir
=
isSpread
?
QParallelAnimationGroup
::
Forward
:
QParallelAnimationGroup
::
Backward
;
_animationShow
->
setDirection
(
dir
);
_animationShow
->
start
();
}
else
{
auto
btnList
=
_btn_group
->
buttons
();
for
(
int
i
=
0
;
i
<
btnList
.
size
();
++
i
)
{
auto
btn
=
qobject_cast
<
QPushButton
*>
(
btnList
[
i
]);
if
(
isSpread
)
{
auto
r
=
_btnsGeometry
[
i
];
btn
->
setGeometry
(
r
);
ui
->
navMainBtn
->
lower
();
}
else
{
btn
->
setGeometry
(
_centerGeometry
);
}
}
}
}
void
NavWindow
::
initMenu
()
{
QState
*
stateDefault
=
new
QState
(
_stateMachine
);
stateDefault
->
assignProperty
(
ui
->
navMainBtn
,
"styleSheet"
,
"#navMainBtn{ background-image: url(:fm-icon_01);margin: -26 0 0 -30;}"
);
QState
*
stateSpread
=
new
QState
(
_stateMachine
);
stateSpread
->
assignProperty
(
ui
->
navMainBtn
,
"styleSheet"
,
"#navMainBtn{ background-image: url(:fm-icon_02);margin: -26 0 0 -30;}"
);
stateSpread
->
addTransition
(
ui
->
navMainBtn
,
&
QPushButton
::
clicked
,
stateDefault
);
stateDefault
->
addTransition
(
ui
->
navMainBtn
,
&
QPushButton
::
clicked
,
stateSpread
);
connect
(
stateSpread
,
&
QState
::
exited
,
this
,
[
&
](){
ui
->
navMainBtn
->
raise
();
});
int
centerX
=
ui
->
navMainBtn
->
x
()
+
ui
->
navMainBtn
->
width
()
/
2
;
int
centerY
=
ui
->
navMainBtn
->
y
()
+
ui
->
navMainBtn
->
height
()
/
2
;
const
int
dis
=
MenuUiProp
.
distance
;
int
btnsNum
=
btns
.
size
();
double
jianGe
=
0
;
if
(
btnsNum
>
1
)
{
if
(
MenuUiProp
.
interval
>
0
)
{
jianGe
=
MenuUiProp
.
interval
;
}
else
if
(
btnsNum
>
1
)
{
jianGe
=
(
MenuUiProp
.
endAngle
-
MenuUiProp
.
beginAngle
)
/
(
btns
.
size
()
-
1
);
}
const
int
btnWidth
=
60
;
_centerGeometry
=
QRect
(
centerX
-
btnWidth
/
2
,
centerY
-
btnWidth
/
2
,
btnWidth
,
btnWidth
);
bool
isUseAnimation
=
_settings
->
GetBool
(
FMP_INIKEY_HOMEANIMATION
);
for
(
decltype
(
btns
.
size
())
i
=
0
;
i
<
btns
.
size
();
++
i
)
{
auto
btn
=
new
QPushButton
(
this
);
btn
->
setVisible
(
false
);
double
angle
=
MenuUiProp
.
beginAngle
+
jianGe
*
i
;
int
x
=
centerX
+
dis
*
cos
(
angle
)
-
btnWidth
/
2
;
int
y
=
centerY
+
dis
*
sin
(
angle
)
-
btnWidth
/
2
;
QRect
btnGrometry
(
x
,
y
,
btnWidth
,
btnWidth
);
btn
->
setObjectName
(
btns
[
i
]);
btn
->
setGeometry
(
x
,
y
,
btnWidth
,
btnWidth
);
_btn_group
->
addButton
(
btn
);
// 创建动画
auto
animation
=
new
QPropertyAnimation
(
btn
,
"geometry"
);
animation
->
setDuration
(
200
);
animation
->
setStartValue
(
QRect
(
centerX
-
btn
->
width
()
/
2
,
centerY
-
btn
->
width
()
/
2
,
btn
->
width
(),
btn
->
height
()));
animation
->
setEndValue
(
btn
->
geometry
());
_animationShow
->
addAnimation
(
animation
);
btn
->
setGeometry
(
_centerGeometry
);
stateDefault
->
assignProperty
(
btn
,
"geometry"
,
_centerGeometry
);
stateSpread
->
assignProperty
(
btn
,
"geometry"
,
btnGrometry
);
if
(
isUseAnimation
)
{
// 创建动画
auto
animation
=
new
QPropertyAnimation
(
btn
,
"geometry"
);
animation
->
setDuration
(
300
+
i
*
75
);
animation
->
setEasingCurve
(
QEasingCurve
::
InOutBack
);
_animationShow
->
addAnimation
(
animation
);
}
}
ui
->
navMainBtn
->
raise
();
_stateMachine
->
addDefaultAnimation
(
_animationShow
);
_stateMachine
->
setInitialState
(
stateDefault
);
_stateMachine
->
start
();
}
void
NavWindow
::
onMenuBtnClicked
(
QAbstractButton
*
btn
)
...
...
@@ -112,23 +132,3 @@ void NavWindow::onMenuBtnClicked(QAbstractButton *btn)
QString
btnName
=
btn
->
objectName
();
emit
menuBtnClicked
(
btnName
);
}
void
NavWindow
::
onStatusChanged
(
NavStatus
status
)
{
switch
(
status
)
{
case
Default
:
spreadMenus
(
false
);
ui
->
navMainBtn
->
setStyleSheet
(
"#navMainBtn{ border-image: url(:fm-icon_01)}"
);
break
;
case
Spread
:
spreadMenus
(
true
);
ui
->
navMainBtn
->
setStyleSheet
(
"#navMainBtn{ border-image: url(:fm-icon_02)}"
);
break
;
case
Message
:
ui
->
navMainBtn
->
setStyleSheet
(
"#navMainBtn{ border-image: url(:xiaoxi)}"
);
break
;
default
:
ui
->
navMainBtn
->
setStyleSheet
(
"#navMainBtn{ border-image: url(:fm-icon_01)}"
);
break
;
}
}
fmp_home/fmp_home_navwindow.h
View file @
f0da09cb
...
...
@@ -12,35 +12,19 @@ class NavWindow;
class
QButtonGroup
;
class
QAbstractButton
;
class
QParallelAnimationGroup
;
class
QSequentialAnimationGroup
;
class
FMPSettingsInterface
;
class
QStateMachine
;
class
NavWindow
:
public
QDialog
{
Q_OBJECT
public
:
/**
* @brief The NavStatus enum
* Default: 默认状态
* Message: 由新消息状态
* Spread: 菜单按钮展开状态
*/
enum
NavStatus
{
Default
=
0
,
Spread
,
Message
};
explicit
NavWindow
(
FMPSettingsInterface
*
&
settings
,
QWidget
*
parent
=
0
);
~
NavWindow
();
public
slots
:
/**
* @brief setNavStatus
* 设置该导航窗口的状态
* @param status
*/
void
setNavStatus
(
const
NavStatus
status
);
/**
* @brief spreadMenus
...
...
@@ -51,19 +35,18 @@ public slots:
signals
:
void
menuBtnClicked
(
QString
btnName
);
void
statusChanged
(
NavStatus
status
);
private
slots
:
void
on_navMainBtn_clicked
();
void
onMenuBtnClicked
(
QAbstractButton
*
);
void
onStatusChanged
(
NavStatus
status
);
private
:
Ui
::
NavWindow
*
ui
;
NavStatus
_status
;
QButtonGroup
*
_btn_group
;
std
::
vector
<
QRect
>
_btnsGeometry
;
QParallelAnimationGroup
*
_animationShow
;
QRect
_centerGeometry
;
QStateMachine
*
_stateMachine
;
void
initMenu
();
...
...
@@ -75,6 +58,7 @@ private:
int
distance
;
double
beginAngle
;
double
endAngle
;
double
interval
;
};
MenuUiProps
MenuUiProp
;
bool
isUseAnimation
;
...
...
fmp_home/fmp_home_navwindow.ui
View file @
f0da09cb
...
...
@@ -15,9 +15,9 @@
</property>
<property
name=
"styleSheet"
>
<string
notr=
"true"
>
#navMainBtn {
min-width: 185px; min-height:185px
;
max-width: 185px; max-height:185px
;
border
-image: url(:fm-icon_01)
background-image: url(:fm-icon_02)
;
margin: -26 0 0 -30
;
border
: none;
}
QPushButton {
...
...
@@ -42,15 +42,21 @@ QPushButton:hover {
}
#payment:pressed {
border-image: url(:payment_onclick);
}
#vip {
border-image: url(:member02);
}
#vip:pressed {
border-image: url(:member02_onclick);
}
</string>
</property>
<widget
class=
"MenuButton"
name=
"navMainBtn"
native=
"true"
>
<property
name=
"geometry"
>
<rect>
<x>
1
1
0
</x>
<y>
6
0
</y>
<width>
1
85
</width>
<height>
1
85
</height>
<x>
1
4
0
</x>
<y>
9
0
</y>
<width>
1
21
</width>
<height>
1
21
</height>
</rect>
</property>
<property
name=
"styleSheet"
>
...
...
fmp_home/fmp_login.cpp
View file @
f0da09cb
...
...
@@ -5,14 +5,12 @@
#include <QJsonDocument>
#include <QJsonObject>
#include <QJsonParseError>
#include "fmp_num_pad.h"
#include "fmnetwork.h"
#include <QDebug>
FMPLogin
::
FMPLogin
(
QString
url
,
QString
storeId
,
QString
partnerId
,
QDialog
*
parent
)
:
FMPWnd
(
parent
),
ui
(
new
Ui
::
FMPLogin
),
_numPad
(
new
FMNumPad
),
_userName
(
""
),
_errorMsg
(
""
),
_url
(
url
),
...
...
@@ -20,22 +18,18 @@ FMPLogin::FMPLogin(QString url, QString storeId, QString partnerId, QDialog *par
_partnerId
(
partnerId
)
{
ui
->
setupUi
(
this
);
connect
(
_numP
ad
,
SIGNAL
(
digit_confirm
()),
this
,
SLOT
(
on_login_btn_clicked
()));
connect
(
ui
->
nump
ad
,
SIGNAL
(
digit_confirm
()),
this
,
SLOT
(
on_login_btn_clicked
()));
QDesktopWidget
w
;
QRect
rc
=
w
.
availableGeometry
();
_numPad
->
setGeometry
((
rc
.
width
()
+
640
)
/
2
,
(
rc
.
height
()
-
480
)
/
2
,
_numPad
->
width
(),
_numPad
->
height
());
connect
(
qApp
,
&
QApplication
::
focusChanged
,
this
,
&
FMPLogin
::
onFocusChanged
);
}
FMPLogin
::~
FMPLogin
()
{
delete
ui
;
delete
_numPad
;
}
void
FMPLogin
::
on_login_btn_clicked
()
{
_numPad
->
close
();
this
->
setEnabled
(
false
);
if
(
login
(
ui
->
user_edit
->
text
(),
ui
->
pwd_edit
->
text
()))
{
...
...
@@ -77,18 +71,9 @@ bool FMPLogin::login(QString userName, QString password)
return
isLogined
();
}
void
FMPLogin
::
on
_key_btn_clicked
(
)
void
FMPLogin
::
on
FocusChanged
(
QWidget
*
,
QWidget
*
now
)
{
_numPad
->
setLineEdit
(
ui
->
user_edit
);
_numPad
->
close
();
_numPad
->
show
();
ui
->
user_edit
->
setFocus
();
}
void
FMPLogin
::
on_key_btn_2_clicked
()
{
_numPad
->
setLineEdit
(
ui
->
pwd_edit
);
_numPad
->
close
();
_numPad
->
show
();
ui
->
pwd_edit
->
setFocus
();
if
(
ui
->
user_edit
==
now
||
ui
->
pwd_edit
==
now
)
{
ui
->
numpad
->
setLineEdit
(
qobject_cast
<
QLineEdit
*>
(
now
));
}
}
fmp_home/fmp_login.h
View file @
f0da09cb
...
...
@@ -3,8 +3,6 @@
#include "fmp_wnd.h"
class
FMNumPad
;
namespace
Ui
{
class
FMPLogin
;
}
...
...
@@ -31,14 +29,11 @@ public:
private
slots
:
void
on_login_btn_clicked
();
void
on_key_btn_clicked
();
void
on_key_btn_2_clicked
();
void
onFocusChanged
(
QWidget
*
,
QWidget
*
now
);
private
:
Ui
::
FMPLogin
*
ui
;
FMNumPad
*
_numPad
;
QString
_userName
;
QString
_errorMsg
;
...
...
fmp_home/fmp_login.ui
View file @
f0da09cb
This diff is collapsed.
Click to expand it.
fmp_home/fmp_wnd.cpp
View file @
f0da09cb
...
...
@@ -22,7 +22,7 @@ FMPWnd::~FMPWnd()
int
FMPWnd
::
exec
()
{
show
FullScreen
();
show
Normal
();
// ::SetForegroundWindow((HWND)effectiveWinId());
// ::SetWindowPos( (HWND)effectiveWinId(), HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW);
...
...
fmp_home/menubutton.cpp
View file @
f0da09cb
...
...
@@ -6,7 +6,7 @@ MenuButton::MenuButton(QWidget *parent)
_mouseMove
(
false
),
_mousePress
(
false
),
_canMove
(
false
),
_movedItem
(
this
)
_movedItem
(
nullptr
)
{
}
...
...
@@ -31,7 +31,7 @@ void MenuButton::mousePressEvent(QMouseEvent *e)
void
MenuButton
::
mouseMoveEvent
(
QMouseEvent
*
e
)
{
if
(
_mousePress
&&
(
e
->
buttons
()
==
Qt
::
LeftButton
))
if
(
_mo
vedItem
&&
_mo
usePress
&&
(
e
->
buttons
()
==
Qt
::
LeftButton
))
{
QPoint
moved
=
e
->
globalPos
()
-
_lastMousePos
;
// 防止因抖动误拖动
...
...
fmp_home/res/img/fm-icon_02.png
View replaced file @
b4b4a9c2
View file @
f0da09cb
12.1 KB
|
W:
|
H:
3.8 KB
|
W:
|
H:
2-up
Swipe
Onion skin
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment