Commit 1dc2d0d7 by Carwyn

Merge remote-tracking branch 'origin/fmp_home'

parents 49b1267d f0da09cb
#include "fmp_num_pad.h"
#include "fmnumpad.h"
#include "ui_fmnumpad.h"
#include <QLineEdit>
FMNumPad::FMNumPad(QDialog *parent) :
FMPWnd(parent),
FMNumPad::FMNumPad(QWidget *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()
......
#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(QDialog *parent = 0);
explicit FMNumPad(QWidget *parent = 0);
~FMNumPad();
void setLineEdit(QLineEdit* lineEdit);
......
......@@ -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/>
......
......@@ -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 \
......
......@@ -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;
}
}
......@@ -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;
......
......@@ -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>110</x>
<y>60</y>
<width>185</width>
<height>185</height>
<x>140</x>
<y>90</y>
<width>121</width>
<height>121</height>
</rect>
</property>
<property name="styleSheet">
......
......@@ -30,9 +30,6 @@ int FMPHomePrivate::Init()
FMPStartEventHandler* handler = new FMPStartEventHandler(q->_ctx, q);
if(login() != FMP_SUCCESS) {
return FMP_FAILURE;
}
_navWindow->show();
connect(_navWindow, SIGNAL(menuBtnClicked(QString)), this, SLOT(onMenuBtnClicked(QString)));
......@@ -81,6 +78,12 @@ void FMPHomePrivate::onMenuBtnClicked(QString btnName)
Q_Q(FMPHome);
FMP_DEBUG_CTX(q->_ctx) << "Menu clicked: " << btnName;
if(!_isLogined && btnName!="tool") {
if(login() != FMP_SUCCESS) {
return;
}
}
if(btnName == "payment") {
FMPePayInterface *e = q->GetService<FMPePayInterface>(q->_ctx);
e->StartService();
......
......@@ -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(_numPad, SIGNAL(digit_confirm()), this, SLOT(on_login_btn_clicked()));
connect(ui->numpad, 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::onFocusChanged(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));
}
}
......@@ -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;
......
......@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>847</width>
<height>615</height>
<width>640</width>
<height>480</height>
</rect>
</property>
<property name="windowTitle">
......@@ -15,12 +15,7 @@
</property>
<property name="styleSheet">
<string notr="true">#FMPLogin {
background: rgba(100,100,100,80);
}
#Center {
background: rgb(255,255,255);
border: 1 solid silver;
}
QWidget {
......@@ -77,19 +72,6 @@ QLineEdit {
color: rgb(50,50,50);
background: white;
border: 1 solid silver;
border-right: 0;
}
#key_btn, #key_btn_2 {
border: 1 solid silver;
border-left: 0px;
color: rgb(130,130,130);
background-color: rgb(255, 255, 255);
font: 13px &quot;微软雅黑&quot;;
min-height: 49px; min-width: 30px;
}
#key_btn:hover, #key_btn_2:hover {
color: rgb(37,176,246);
}
#login_btn {
......@@ -103,9 +85,16 @@ QLineEdit {
#login_btn:hover {
padding: 2 0 0 2;
}
</string>
#numpad {
min-width: 0; min-height:0;
max-width: 0; max-height:0;
}</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
......@@ -118,235 +107,201 @@ QLineEdit {
<property name="bottomMargin">
<number>0</number>
</property>
<property name="spacing">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QWidget" name="Center" native="true">
<property name="maximumSize">
<size>
<width>640</width>
<height>480</height>
</size>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<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>
<number>20</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
<number>20</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>20</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>20</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="logo_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="text">
<string/>
</property>
</widget>
</item>
</layout>
<widget class="QLabel" name="logo_label">
<property name="text">
<string>非码</string>
</property>
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="main">
<property name="spacing">
<number>40</number>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="leftMargin">
<number>130</number>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
<property name="rightMargin">
<number>130</number>
</property>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="spacing">
<number>0</number>
</property>
<item>
<widget class="QLineEdit" name="user_edit">
<property name="text">
<string/>
</property>
<property name="placeholderText">
<string>账号</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="key_btn">
<property name="text">
<string>键盘</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="spacing">
<number>0</number>
</property>
<item>
<widget class="QLineEdit" name="pwd_edit">
<property name="echoMode">
<enum>QLineEdit::Password</enum>
</property>
<property name="placeholderText">
<string>密码</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="key_btn_2">
<property name="text">
<string>键盘</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QPushButton" name="login_btn">
<property name="text">
<string>登录</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</spacer>
</item>
<item>
<widget class="QWidget" name="tip" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_5">
<widget class="QPushButton" name="close_btn">
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="main">
<property name="spacing">
<number>40</number>
</property>
<property name="leftMargin">
<number>130</number>
</property>
<property name="rightMargin">
<number>130</number>
</property>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="spacing">
<number>0</number>
</property>
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>20</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>20</number>
</property>
<property name="bottomMargin">
<number>0</number>
<number>30</number>
</property>
<item>
<widget class="QLabel" name="operator_desc_label">
<widget class="QLineEdit" name="user_edit">
<property name="text">
<string>操作员:</string>
<string/>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="operator_label">
<property name="text">
<string>00000</string>
<property name="placeholderText">
<string>账号</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
<widget class="QLineEdit" name="pwd_edit">
<property name="echoMode">
<enum>QLineEdit::Password</enum>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="bd_desc_label_2">
<property name="text">
<string>营业日:</string>
<property name="placeholderText">
<string>密码</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="bd_desc_label">
<widget class="QPushButton" name="login_btn">
<property name="text">
<string>2017-02-20</string>
<string>登录</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="FMNumPad" name="numpad" native="true">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</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>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<widget class="QWidget" name="tip" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_5">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>20</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>20</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="operator_desc_label">
<property name="text">
<string>操作员:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="operator_label">
<property name="text">
<string>00000</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<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="QLabel" name="bd_desc_label_2">
<property name="text">
<string>营业日:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="bd_desc_label">
<property name="text">
<string>2017-02-20</string>
</property>
</widget>
</item>
</layout>
......@@ -354,12 +309,14 @@ QLineEdit {
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>FMNumPad</class>
<extends>QWidget</extends>
<header>fmnumpad.h</header>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>user_edit</tabstop>
<tabstop>pwd_edit</tabstop>
<tabstop>login_btn</tabstop>
<tabstop>key_btn</tabstop>
<tabstop>key_btn_2</tabstop>
<tabstop>close_btn</tabstop>
</tabstops>
<resources/>
......
......@@ -22,7 +22,7 @@ FMPWnd::~FMPWnd()
int FMPWnd::exec()
{
showFullScreen();
showNormal();
// ::SetForegroundWindow((HWND)effectiveWinId());
// ::SetWindowPos( (HWND)effectiveWinId(), HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW);
......
......@@ -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 (_movedItem && _mousePress && (e->buttons()==Qt::LeftButton))
{
QPoint moved = e->globalPos() - _lastMousePos;
// 防止因抖动误拖动
......
fmp_home/res/img/fm-icon_02.png

12.1 KB | W: | H:

fmp_home/res/img/fm-icon_02.png

3.8 KB | W: | H:

fmp_home/res/img/fm-icon_02.png
fmp_home/res/img/fm-icon_02.png
fmp_home/res/img/fm-icon_02.png
fmp_home/res/img/fm-icon_02.png
  • 2-up
  • Swipe
  • Onion skin
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment