Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fmp_vip
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
zhenfei.zhang
fmp_vip
Commits
5ed20300
Commit
5ed20300
authored
Nov 28, 2017
by
NitefullWind
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1. 添加小键盘。
parent
74bc5ec7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
492 additions
and
6 deletions
+492
-6
fmvip/fmvip.pri
+6
-3
fmvip/windows/fmnumpad.cpp
+71
-0
fmvip/windows/fmnumpad.h
+45
-0
fmvip/windows/forms/fmnumpad.ui
+349
-0
fmvip/windows/forms/fmviplogin.ui
+2
-2
tests/testplugin/tst_testplugin.cpp
+18
-0
version.h
+1
-1
No files found.
fmvip/fmvip.pri
View file @
5ed20300
...
@@ -49,7 +49,8 @@ SOURCES += \
...
@@ -49,7 +49,8 @@ SOURCES += \
$$PWD/task/taskrefund.cpp \
$$PWD/task/taskrefund.cpp \
$$PWD/database/fmp_database.cpp \
$$PWD/database/fmp_database.cpp \
$$PWD/task/tasksetstoreinfo.cpp \
$$PWD/task/tasksetstoreinfo.cpp \
$$PWD/items/storeinfo.cpp
$$PWD/items/storeinfo.cpp \
$$PWD/windows/fmnumpad.cpp
HEADERS +=\
HEADERS +=\
$$PWD/backup/fmbackup.h \
$$PWD/backup/fmbackup.h \
...
@@ -89,7 +90,8 @@ HEADERS +=\
...
@@ -89,7 +90,8 @@ HEADERS +=\
$$PWD/task/taskrefund.h \
$$PWD/task/taskrefund.h \
$$PWD/database/fmp_database.h \
$$PWD/database/fmp_database.h \
$$PWD/task/tasksetstoreinfo.h \
$$PWD/task/tasksetstoreinfo.h \
$$PWD/items/storeinfo.h
$$PWD/items/storeinfo.h \
$$PWD/windows/fmnumpad.h
unix {
unix {
target.path = /usr/lib
target.path = /usr/lib
...
@@ -123,4 +125,5 @@ FORMS += \
...
@@ -123,4 +125,5 @@ FORMS += \
$$PWD/windows/forms/fmviplogin.ui \
$$PWD/windows/forms/fmviplogin.ui \
$$PWD/windows/forms/fmviporder.ui \
$$PWD/windows/forms/fmviporder.ui \
$$PWD/windows/forms/fmvippanel.ui \
$$PWD/windows/forms/fmvippanel.ui \
$$PWD/windows/forms/fmviprefund.ui
$$PWD/windows/forms/fmviprefund.ui \
$$PWD/windows/forms/fmnumpad.ui
fmvip/windows/fmnumpad.cpp
0 → 100644
View file @
5ed20300
#include "fmnumpad.h"
#include "ui_fmnumpad.h"
FMNumPad
::
FMNumPad
(
QDialog
*
parent
)
:
FMVipWnd
(
parent
),
ui
(
new
Ui
::
FMNumPad
)
{
initWnd
(
nullptr
);
}
FMNumPad
::
FMNumPad
(
QLineEdit
*
lineEidt
,
QDialog
*
parent
)
:
_lineEdit
(
lineEidt
),
FMVipWnd
(
parent
),
ui
(
new
Ui
::
FMNumPad
)
{
initWnd
(
nullptr
);
}
bool
FMNumPad
::
initWnd
(
Session
*
session
)
{
Q_UNUSED
(
session
)
ui
->
setupUi
(
this
);
connect
(
ui
->
no0
,
&
QPushButton
::
clicked
,
this
,
&
FMNumPad
::
on_digit_clicked
);
connect
(
ui
->
no1
,
&
QPushButton
::
clicked
,
this
,
&
FMNumPad
::
on_digit_clicked
);
connect
(
ui
->
no2
,
&
QPushButton
::
clicked
,
this
,
&
FMNumPad
::
on_digit_clicked
);
connect
(
ui
->
no3
,
&
QPushButton
::
clicked
,
this
,
&
FMNumPad
::
on_digit_clicked
);
connect
(
ui
->
no4
,
&
QPushButton
::
clicked
,
this
,
&
FMNumPad
::
on_digit_clicked
);
connect
(
ui
->
no5
,
&
QPushButton
::
clicked
,
this
,
&
FMNumPad
::
on_digit_clicked
);
connect
(
ui
->
no6
,
&
QPushButton
::
clicked
,
this
,
&
FMNumPad
::
on_digit_clicked
);
connect
(
ui
->
no7
,
&
QPushButton
::
clicked
,
this
,
&
FMNumPad
::
on_digit_clicked
);
connect
(
ui
->
no8
,
&
QPushButton
::
clicked
,
this
,
&
FMNumPad
::
on_digit_clicked
);
connect
(
ui
->
no9
,
&
QPushButton
::
clicked
,
this
,
&
FMNumPad
::
on_digit_clicked
);
connect
(
ui
->
dot
,
&
QPushButton
::
clicked
,
this
,
&
FMNumPad
::
on_digit_clicked
);
setFocusPolicy
(
Qt
::
NoFocus
);
return
true
;
}
FMNumPad
::~
FMNumPad
()
{
delete
ui
;
}
void
FMNumPad
::
on_digit_clicked
()
{
QString
num_str
=
qobject_cast
<
QPushButton
*>
(
sender
())
->
text
();
emit
digit_click
(
num_str
);
if
(
_lineEdit
!=
nullptr
)
{
_lineEdit
->
insert
(
num_str
);
}
}
void
FMNumPad
::
on_backspace_btn_clicked
()
{
emit
digit_delete
();
if
(
_lineEdit
!=
nullptr
)
{
_lineEdit
->
backspace
();
}
}
void
FMNumPad
::
on_clear_btn_clicked
()
{
emit
digit_clear
();
if
(
_lineEdit
!=
nullptr
)
{
_lineEdit
->
clear
();
}
}
void
FMNumPad
::
on_confirm_btn_clicked
()
{
emit
digit_confirm
();
}
fmvip/windows/fmnumpad.h
0 → 100644
View file @
5ed20300
#ifndef FMNUMPAD_H
#define FMNUMPAD_H
#include "fmvipwnd.h"
#include <QLineEdit>
namespace
Ui
{
class
FMNumPad
;
}
class
FMNumPad
:
public
FMVipWnd
{
Q_OBJECT
public
:
explicit
FMNumPad
(
QDialog
*
parent
=
0
);
FMNumPad
(
QLineEdit
*
lineEidt
,
QDialog
*
parent
=
0
);
~
FMNumPad
();
private
:
bool
initWnd
(
Session
*
session
);
signals
:
void
digit_click
(
QString
keynum
);
void
digit_delete
();
void
digit_clear
();
void
digit_confirm
();
private
slots
:
void
on_digit_clicked
();
void
on_backspace_btn_clicked
();
void
on_clear_btn_clicked
();
void
on_confirm_btn_clicked
();
private
:
Ui
::
FMNumPad
*
ui
;
QLineEdit
*
_lineEdit
;
};
#endif // FMNUMPAD_H
fmvip/windows/forms/fmnumpad.ui
0 → 100644
View file @
5ed20300
<?xml version="1.0" encoding="UTF-8"?>
<ui
version=
"4.0"
>
<class>
FMNumPad
</class>
<widget
class=
"QWidget"
name=
"FMNumPad"
>
<property
name=
"geometry"
>
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
246
</width>
<height>
305
</height>
</rect>
</property>
<property
name=
"windowTitle"
>
<string>
Form
</string>
</property>
<property
name=
"styleSheet"
>
<string
notr=
"true"
>
QWidget {
font: normal 22px
"
Microsoft YaHei
"
;
color: rgb(90,90,90);
}
#FMNumPad {
background: rgb(255,255,255);
border: 1 solid silver;
}
/*
* 标题栏
*/
#title {
background: rgb(56, 56, 64);
min-height: 32px; max-height: 32px;
}
#title_label {
margin-left: 4px;
font: normal 15px
"
Microsoft YaHei
"
;
color: rgb(220, 220, 220);
}
#close_btn {
min-width: 32;max-width: 32;
min-height: 32;max-height: 32;
image: url(
"
:/img/btn_close.png
"
);
background: rgb(56, 56, 64);
border: 0 solid silver;
padding: 0;
}
QPushButton {
border: 1 solid silver;
border-radius: 2px;
min-width: 50px; min-height: 50px;
max-width: 50px; max-height: 50px;
color: rgb(120,120,120);
background: transparent;
}
QPushButton:hover {
background: #7aad65;
color: white;
padding: 2 0 0 2;
}
#no0 {
min-width: 106px;
max-width: 106px;}
#backspace_btn, #clear_btn {
font: normal 16px
"
Microsoft YaHei
"
;
}
#backspace_btn {
background-image: url(
"
:/img/num_del.png
"
);
}
#confirm_btn {
background: rgb(37,176,241);
font: 400 16px
"
Microsoft YaHei
"
;
color: white;
min-height: 106px;
max-height: 106px;
border: 0 solid white;
border-right: 1 solid silver;
}
#confirm_btn:hover {
padding: 2 0 0 2;
}
</string>
</property>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout"
>
<property
name=
"spacing"
>
<number>
8
</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=
"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>
32
</width>
<height>
32
</height>
</size>
</property>
<property
name=
"maximumSize"
>
<size>
<width>
32
</width>
<height>
32
</height>
</size>
</property>
<property
name=
"cursor"
>
<cursorShape>
PointingHandCursor
</cursorShape>
</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>
</property>
<property
name=
"rightMargin"
>
<number>
10
</number>
</property>
<item
row=
"1"
column=
"3"
>
<widget
class=
"QPushButton"
name=
"clear_btn"
>
<property
name=
"cursor"
>
<cursorShape>
PointingHandCursor
</cursorShape>
</property>
<property
name=
"text"
>
<string>
清空
</string>
</property>
</widget>
</item>
<item
row=
"3"
column=
"0"
colspan=
"2"
>
<widget
class=
"QPushButton"
name=
"no0"
>
<property
name=
"cursor"
>
<cursorShape>
PointingHandCursor
</cursorShape>
</property>
<property
name=
"text"
>
<string>
0
</string>
</property>
</widget>
</item>
<item
row=
"2"
column=
"2"
>
<widget
class=
"QPushButton"
name=
"no9"
>
<property
name=
"cursor"
>
<cursorShape>
PointingHandCursor
</cursorShape>
</property>
<property
name=
"text"
>
<string>
9
</string>
</property>
</widget>
</item>
<item
row=
"1"
column=
"2"
>
<widget
class=
"QPushButton"
name=
"no6"
>
<property
name=
"cursor"
>
<cursorShape>
PointingHandCursor
</cursorShape>
</property>
<property
name=
"text"
>
<string>
6
</string>
</property>
</widget>
</item>
<item
row=
"2"
column=
"3"
rowspan=
"2"
>
<widget
class=
"QPushButton"
name=
"confirm_btn"
>
<property
name=
"cursor"
>
<cursorShape>
PointingHandCursor
</cursorShape>
</property>
<property
name=
"text"
>
<string>
确认
</string>
</property>
</widget>
</item>
<item
row=
"0"
column=
"0"
>
<widget
class=
"QPushButton"
name=
"no1"
>
<property
name=
"cursor"
>
<cursorShape>
PointingHandCursor
</cursorShape>
</property>
<property
name=
"text"
>
<string>
1
</string>
</property>
</widget>
</item>
<item
row=
"0"
column=
"1"
>
<widget
class=
"QPushButton"
name=
"no2"
>
<property
name=
"cursor"
>
<cursorShape>
PointingHandCursor
</cursorShape>
</property>
<property
name=
"text"
>
<string>
2
</string>
</property>
</widget>
</item>
<item
row=
"0"
column=
"2"
>
<widget
class=
"QPushButton"
name=
"no3"
>
<property
name=
"cursor"
>
<cursorShape>
PointingHandCursor
</cursorShape>
</property>
<property
name=
"text"
>
<string>
3
</string>
</property>
</widget>
</item>
<item
row=
"1"
column=
"1"
>
<widget
class=
"QPushButton"
name=
"no5"
>
<property
name=
"cursor"
>
<cursorShape>
PointingHandCursor
</cursorShape>
</property>
<property
name=
"text"
>
<string>
5
</string>
</property>
</widget>
</item>
<item
row=
"1"
column=
"0"
>
<widget
class=
"QPushButton"
name=
"no4"
>
<property
name=
"cursor"
>
<cursorShape>
PointingHandCursor
</cursorShape>
</property>
<property
name=
"text"
>
<string>
4
</string>
</property>
</widget>
</item>
<item
row=
"0"
column=
"3"
>
<widget
class=
"QPushButton"
name=
"backspace_btn"
>
<property
name=
"cursor"
>
<cursorShape>
PointingHandCursor
</cursorShape>
</property>
<property
name=
"styleSheet"
>
<string
notr=
"true"
/>
</property>
<property
name=
"text"
>
<string/>
</property>
</widget>
</item>
<item
row=
"3"
column=
"2"
>
<widget
class=
"QPushButton"
name=
"dot"
>
<property
name=
"cursor"
>
<cursorShape>
PointingHandCursor
</cursorShape>
</property>
<property
name=
"text"
>
<string>
.
</string>
</property>
</widget>
</item>
<item
row=
"2"
column=
"0"
>
<widget
class=
"QPushButton"
name=
"no7"
>
<property
name=
"cursor"
>
<cursorShape>
PointingHandCursor
</cursorShape>
</property>
<property
name=
"text"
>
<string>
7
</string>
</property>
</widget>
</item>
<item
row=
"2"
column=
"1"
>
<widget
class=
"QPushButton"
name=
"no8"
>
<property
name=
"cursor"
>
<cursorShape>
PointingHandCursor
</cursorShape>
</property>
<property
name=
"text"
>
<string>
8
</string>
</property>
</widget>
</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/>
<connections/>
</ui>
fmvip/windows/forms/fmviplogin.ui
View file @
5ed20300
...
@@ -54,7 +54,7 @@
...
@@ -54,7 +54,7 @@
min-width: 54;
min-width: 54;
min-height: 54;
min-height: 54;
border-radius: 0px;
border-radius: 0px;
image: url(
:/img/btn_close.png
);
image: url(
"
:/img/btn_close.png
"
);
}
}
/*
/*
...
@@ -63,7 +63,7 @@
...
@@ -63,7 +63,7 @@
#mobile_label {
#mobile_label {
color: rgb(169,169,169);
color: rgb(169,169,169);
image: url(
"
:/account.png
"
);
image: url(
"
:/
img/
account.png
"
);
background: white;
background: white;
border: 1 solid silver;
border: 1 solid silver;
border-right: 0;
border-right: 0;
...
...
tests/testplugin/tst_testplugin.cpp
View file @
5ed20300
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
#include "fmvipdispatcher.h"
#include "fmvipdispatcher.h"
#include "fmtask.h"
#include "fmtask.h"
#include "fmnumpad.h"
class
TestPlugin
:
public
QObject
class
TestPlugin
:
public
QObject
{
{
...
@@ -28,6 +29,9 @@ private slots:
...
@@ -28,6 +29,9 @@ private slots:
void
test_Sign_data
();
void
test_Sign_data
();
void
test_Sign
();
void
test_Sign
();
void
test_numpad_data
();
void
test_numpad
();
};
};
TestPlugin
::
TestPlugin
()
TestPlugin
::
TestPlugin
()
...
@@ -148,6 +152,20 @@ void TestPlugin::test_Sign()
...
@@ -148,6 +152,20 @@ void TestPlugin::test_Sign()
QCOMPARE
(
FMTask
::
Sign
(
jsonObj1
),
SignStr
);
QCOMPARE
(
FMTask
::
Sign
(
jsonObj1
),
SignStr
);
}
}
void
TestPlugin
::
test_numpad_data
()
{
}
void
TestPlugin
::
test_numpad
()
{
QLineEdit
*
edit
=
new
QLineEdit
();
FMNumPad
pad
(
edit
);
pad
.
show
();
edit
->
show
();
QTest
::
qWait
(
1000
*
60
*
2
);
}
QTEST_MAIN
(
TestPlugin
)
QTEST_MAIN
(
TestPlugin
)
#include "tst_testplugin.moc"
#include "tst_testplugin.moc"
version.h
View file @
5ed20300
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
#define VER_MINOR 1
#define VER_MINOR 1
#define VER_REVISION 0
#define VER_REVISION 0
#define VER_BUILD 2
8
#define VER_BUILD 2
9
//! Convert version numbers to string
//! Convert version numbers to string
#define _STR(S) #S
#define _STR(S) #S
...
...
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