Commit 3163e680 by xiaoqing.gu

1、登陆界面增加自动登录和记住密码功能 2、悬浮窗左右展开 3、悬浮窗长按弹扫码取餐 4、悬浮窗适应屏幕 分辨率

parent 8bb18ec2
......@@ -27,6 +27,7 @@
<file>login_logo.png</file>
<file>base_logo.png</file>
<file>loginlogin.png</file>
<file>loginlogin_back.png</file>
<file>pickupclose.png</file>
<file>pickupwar.png</file>
<file>yy.png</file>
......
......@@ -619,11 +619,6 @@ QWidget
color: #FF000A;
}
#widget_base
{
border-image: url(:base_logo.png);
}
#widget_login
{
border-image: url(:loginlogin.png);
......
Resources/skin/loginlogin.png

2.78 KB | W: | H:

Resources/skin/loginlogin.png

2.96 KB | W: | H:

Resources/skin/loginlogin.png
Resources/skin/loginlogin.png
Resources/skin/loginlogin.png
Resources/skin/loginlogin.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -29,6 +29,8 @@ QEvent::Type PosEvent::s_delete_prt = static_cast<QEvent::Type>(QEvent::register
QEvent::Type PosEvent::s_change_stalls = static_cast<QEvent::Type>(QEvent::registerEventType());
QEvent::Type PosEvent::s_show_stalls = static_cast<QEvent::Type>(QEvent::registerEventType());
QEvent::Type PosEvent::s_show_pickup = static_cast<QEvent::Type>(QEvent::registerEventType());
PosEvent::PosEvent(Type e):QEvent(e)
{
//qDebug() << "------event : " << this;
......
......@@ -113,6 +113,9 @@ public:
//档口信息展示
static Type s_show_stalls;
//---------------------长按悬浮窗功能------------------
//显示扫码取餐界面
static Type s_show_pickup;
private:
//事件携带的信息,该内存你应当在堆中分配
void *_info;
......
......@@ -7,6 +7,7 @@
#include "model/posstallspool.h"
#include "view/mainForm.h"
#include "view/floatForm.h"
#include "view/newfloatform.h"
#include "view/newmainform.h"
#include "control/orderlocalizework.h"
#include "control/orderpushwork.h"
......@@ -229,7 +230,8 @@ int main(int argc, char *argv[])
NewLoginForm loginform;
NewMainForm mainform;
FloatForm floatform;
// FloatForm floatform;
NewFloatForm floatform;
mainform.MyShow();
loginform.showfull();
#endif
......
......@@ -63,6 +63,7 @@
#define INI_PASSWORD "info/password"
#define INI_AUTOCONFIRM "info/autoconfirm"
#define INI_AUTOLOGIN "info/autologin"
#define INI_REMEMBERPWD "info/rememberPwd"
#define INI_UIVISIBLE "Ui/visible"
#define INI_DELEORDERTIMER "all/dltordertimer"
......
......@@ -78,7 +78,8 @@ SOURCES += main.cpp \
view/newloginform.cpp \
view/newpickupform.cpp \
base/Network/ping.cpp \
control/networkcheckwork.cpp
control/networkcheckwork.cpp \
view/newfloatform.cpp
HEADERS += \
event/fmapplication.h \
......@@ -132,7 +133,8 @@ HEADERS += \
view/newloginform.h \
view/newpickupform.h \
base/Network/ping.h \
control/networkcheckwork.h
control/networkcheckwork.h \
view/newfloatform.h
DISTFILES += takeout.rc
......@@ -155,5 +157,6 @@ FORMS += \
view/newdetailform.ui \
view/prttypeform.ui \
view/newloginform.ui \
view/newpickupform.ui
view/newpickupform.ui \
view/newfloatform.ui
......@@ -268,7 +268,7 @@ void FloatForm::mouseReleaseEvent(QMouseEvent *event)
{
//qDebug() << "x:" << event->x() << "y:" << event->y();
if(event->x() > 48 || !m_is_login)
if(event->x() > 100 || !m_is_login)
{
hide();
m_raiseTimer.stop();
......@@ -305,6 +305,7 @@ void FloatForm::mouseReleaseEvent(QMouseEvent *event)
void FloatForm::_Init()
{
QSize tmpdesktopSize= QApplication::desktop()->screenGeometry().size();
if(!m_is_login)
tmpdesktopSize-= QSize(ui->widget_base->width(), ui->widget_base->height());
else
......@@ -313,7 +314,7 @@ void FloatForm::_Init()
setWindowFlags(this->windowFlags() | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint | Qt::Tool);
setAttribute(Qt::WA_TranslucentBackground);
setFixedSize(m_imgNormalSize);
// setFixedSize(m_imgNormalSize);
setStyleSheet("#floatWdg{ border-image: url(:float_normal.png); }");
move(ConfigManger::GetInstance().GetFloatInitPostion());
......@@ -337,6 +338,14 @@ void FloatForm::_Init()
pos.setY(tmpdesktopSize.height());
}
move(pos);
int currentScreenWid = tmpdesktopSize.width();
int currentScreenHei = tmpdesktopSize.height();
double factoryx = currentScreenWid/800.0;
double factoryy = currentScreenHei/600.0;
qDebug() << "******************************9090*************************" <<currentScreenWid << currentScreenHei << factoryx << factoryy;
resetGrid(this,factoryx,factoryy);
}
void FloatForm::_Blink()
......@@ -347,7 +356,7 @@ void FloatForm::_Blink()
m_animation.setEndValue(0);
m_animation.start();
loop.exec();
this->setFixedSize(m_imgRemindSize);
// this->setFixedSize(m_imgRemindSize);
//ui->floatWdg->setStyleSheet("#floatWdg{ border-image: url(:float_remind.png)}");
//ui->widget_login->show();
ui->widget_base->hide();
......@@ -361,7 +370,7 @@ void FloatForm::_Blink()
m_animation.setEndValue(0);
m_animation.start();
loop.exec();
this->setFixedSize(m_imgNormalSize);
// this->setFixedSize(m_imgNormalSize);
//ui->floatWdg->setStyleSheet("#floatWdg{ border-image: url(:float_normal.png)}");
ui->widget_base->hide();
ui->widget_synshow->show();
......@@ -469,3 +478,33 @@ void FloatForm::onShow()
show();
m_raiseTimer.start();
}
void FloatForm::resetGrid(QDialog *widget, double factorx, double factory)
{
int widgetX = widget->x();
int widgetY = widget->y();
int widgetWid = widget->width();
int widgetHei = widget->height();
int nWidgetWid = (int)(widgetWid*factorx);
int nWidgetHei = (int)(widgetHei*factory);
qDebug() << "----------------------------------------9090-----------------------" << widgetX << widgetY << nWidgetWid << nWidgetHei;
this->setGeometry(0,0,nWidgetWid,nWidgetHei);
ui->widget_base->setGeometry(0,0,nWidgetWid*(48/94.0),nWidgetHei);
ui->widget_login->setGeometry(0,0,nWidgetWid,nWidgetHei);
ui->widget_synshow->setGeometry(0,0,nWidgetWid,nWidgetHei);
ui->widget_touch->setGeometry(0,0,nWidgetWid,nWidgetHei);
ui->label_new->setGeometry(100,5,20,20);
ui->label_newnum->setGeometry(130,5,30,20);
ui->label_refund->setGeometry(100,30,20,20);
ui->label_refundnum->setGeometry(130,30,30,20);
// widget->setFixedSize(nWidgetWid,nWidgetHei);
// this->setFixedSize(nWidgetWid,nWidgetHei);
// ui->widget_base->setFixedSize(nWidgetWid*(48/94.0),nWidgetHei);
// ui->widget_login->setFixedSize(nWidgetWid,nWidgetHei);
// ui->widget_synshow->setFixedSize(nWidgetWid,nWidgetHei);
// ui->widget_touch->setFixedSize(nWidgetWid,nWidgetHei);
}
......@@ -80,6 +80,8 @@ private slots:
void _PlayWav();
//udp广播声音播控
void _UdpRadio(QString songName, int type, int time);
//悬浮框大小自适应不同屏幕分辨率
void resetGrid(QDialog *widget,double factorx,double factory);
signals:
/* 功能:通知主窗口显示
......
#include "newfloatform.h"
#include "ui_newfloatform.h"
#include <QPixmap>
#include "base/config/configManger.h"
#include "preDefine.h"
#include "QsLog.h"
#include <QProcess>
#include <QThread>
#include <QHostInfo>
#include <QUdpSocket>
#include <QByteArray>
#include <QJsonObject>
#include <QJsonDocument>
#include <QDesktopWidget>
#include <QPoint>
#include "event/fmapplication.h"
#include "event/posevent.h"
#include "model/posorderpool.h"
extern QThread workThread;
NewFloatForm::NewFloatForm(QWidget *parent) :
QDialog(parent),
ui(new Ui::NewFloatForm)
{
ui->setupUi(this);
m_is_login = false;
FMApplication::subscibeEvent(this, PosEvent::s_change_order);
FMApplication::subscibeEvent(this, PosEvent::s_show_float);
FMApplication::subscibeEvent(this, PosEvent::s_delete_order);
FMApplication::subscibeEvent(this, PosEvent::s_login_status);
FMApplication::subscibeEvent(this, PosEvent::s_network_outtime);
FMApplication::subscibeEvent(this, PosEvent::s_pickuporder_remind);
m_bReminding = false;
m_num = 0;
QPixmap imgNormal(":loginlogin.png");
m_imgNormalSize = imgNormal.size();
QPixmap imgRemind(":loginlogin.png");
m_imgRemindSize = imgRemind.size();
m_animation.setTargetObject(this);
m_animation.setPropertyName("windowOpacity");
m_animation.setDuration(ConfigManger::GetInstance().GetBlinkInterval());
m_animation.setEasingCurve(QEasingCurve::InOutSine);
m_raiseTimer.setInterval(2000);
connect(&m_raiseTimer, &QTimer::timeout, this, &NewFloatForm::raise);
connect(&m_clickTimer, &QTimer::timeout, this, &NewFloatForm::OnUpdate);
// desktopSize= QApplication::desktop()->screenGeometry().size();
// desktopSize-= QSize(144, 48);
//界面数据初始化
ui->label_front_newnum->setText("0");
ui->label_back_newnum->setText("0");
ui->label_front_refundnum->setText("0");
ui->label_back_refundnum->setText("0");
//设置拖动图层透明度
ui->widget_touch->setWindowOpacity(0.1);
_Init();
}
NewFloatForm::~NewFloatForm()
{
delete ui;
}
void NewFloatForm::InitWidget(int flag)
{
if(flag == -1)
{
if(m_is_login)
{
ui->widget_base_frame->show();
ui->widget_back_login->hide();
ui->widget_front_login->hide();
ui->widget_back_synshow->hide();
ui->widget_front_synshow->hide();
}
else
{
ui->widget_base_frame->show();
ui->widget_front_login->hide();
ui->widget_back_login->hide();
ui->widget_front_synshow->hide();
ui->widget_back_synshow->hide();
}
return ;
}
}
bool NewFloatForm::event(QEvent *e)
{
if(e->type() == PosEvent::s_change_order)
{
QString orderid;
GETEVENTINFO(orderid,e,QString);
int refundstatus, orderstatus, ordertype;
bool oldorder;
int tk_new = 0, tk_make = 0, tk_send = 0, tk_refund = 0;
int self_new = 0, self_make = 0, self_refund = 0;
PosOrderPool::GetOrderNum(tk_new, tk_make, tk_send, tk_refund, self_new, self_make, self_refund);
QLOG_DEBUG() << "tk_new" << tk_new << "tk_make" << tk_make << "tk_send" << tk_send << "self_new" << self_new << "self_make" << self_make;
QLOG_DEBUG() << "tk_refund" << tk_refund << "self_refund" << self_refund;
ui->label_back_newnum->setText(QString::number(tk_new + self_new + tk_make + self_make));
ui->label_back_refundnum->setText(QString::number(self_refund + tk_refund));
ui->label_front_newnum->setText(QString::number(tk_new + self_new + tk_make + self_make));
ui->label_front_refundnum->setText(QString::number(self_refund + tk_refund));
if(!PosOrderPool::GetOrderStatusAndOrderType(orderid, orderstatus, refundstatus, ordertype, oldorder))
return true;
//预约单不在提醒
if(ordertype == AppointmentTakeout || ordertype == AppointmentDining || ordertype == AppointmentInvite)
return true;
QLOG_DEBUG() << "input : " << orderid << orderstatus << refundstatus << oldorder;
QString configfile = qApp->applicationDirPath() + "/" + CONFIG_NAME;
QString autoconf = QSettings(configfile, QSettings::IniFormat).value(INI_AUTOCONFIRM, "0").toString();
if(!oldorder && ((orderstatus == NewOrder && autoconf.toInt() == 0) || (orderstatus == FirmOrder && autoconf.toInt() == 1)) &&
refundstatus != ApplicationRefundOrder && refundstatus != ApplicationPartialRefundOrder && refundstatus != RefusingRefundOrder)
{
//m_play_flag = false;
if(ui->widget_back_synshow->isHidden())
ui->widget_back_synshow->show();
onStartRemind(0);
return true;
}
if((refundstatus == ApplicationRefundOrder || refundstatus == ApplicationPartialRefundOrder))
{
//m_play_flag = false;
if(ui->widget_back_synshow->isHidden())
ui->widget_back_synshow->show();
onStartRemind(1);
return true;
}
return true;
}
if(e->type() == PosEvent::s_show_float)
{
this->onShow();
return true;
}
if(e->type() == PosEvent::s_network_outtime)
{
// if(!this->isHidden())
// {
QVariantMap value;
GETEVENTINFO(value,e,QVariantMap);
if(value.contains(EVENT_KEY_NETWORKSTATUS) && value[EVENT_KEY_NETWORKSTATUS].toBool() == true)
{
this->onStopRemind();
}
else
{
//m_play_flag = true;
if(ui->widget_back_synshow->isHidden())
ui->widget_back_synshow->show();
onStartRemind(2);
}
// }
return true;
}
if(e->type() == PosEvent::s_delete_order)
{
int tk_new = 0, tk_make = 0, tk_send = 0, tk_refund = 0;
int self_new = 0, self_make = 0, self_refund = 0;
PosOrderPool::GetOrderNum(tk_new, tk_make, tk_send, tk_refund, self_new, self_make, self_refund);
QLOG_DEBUG() << "tk_new" << tk_new << "tk_make" << tk_make << "tk_send" << tk_send << "self_new" << self_new << "self_make" << self_make;
QLOG_DEBUG() << "tk_refund" << tk_refund << "self_refund" << self_refund;
ui->label_back_newnum->setText(QString::number(tk_new + self_new + tk_make + self_make));
ui->label_back_refundnum->setText(QString::number(self_refund + tk_refund));
ui->label_front_newnum->setText(QString::number(tk_new + self_new + tk_make + self_make));
ui->label_front_refundnum->setText(QString::number(self_refund + tk_refund));
return true;
}
if(e->type() == PosEvent::s_login_status)
{
QVariantMap value;
GETEVENTINFO(value,e,QVariantMap);
if(value.contains(EVENT_KEY_STATUS) && value[EVENT_KEY_STATUS].toBool() == true)
{
m_is_login = true;
}
return true;
}
//预约单提醒
if(e->type() == PosEvent::s_pickuporder_remind)
{
QString orderid;
GETEVENTINFO(orderid,e,QString);
QLOG_DEBUG() << "pickuporderremind : " << orderid;
//m_play_flag = false;
if(ui->widget_back_synshow->isHidden())
ui->widget_back_synshow->show();
onStartRemind(0);
return true;
}
return QWidget::event(e);
}
void NewFloatForm::mouseMoveEvent(QMouseEvent *event)
{
if ((event->buttons()==Qt::LeftButton) && m_bMousePress)
{
QSize tmpdesktopSize= QApplication::desktop()->screenGeometry().size();
if(!m_is_login)
tmpdesktopSize-= QSize(ui->widget_base->width(), ui->widget_base->height());
else
tmpdesktopSize-= QSize(this->width(), this->height());
QPoint moveAmount = event->globalPos() - m_lastMousePos;
m_absMove += moveAmount;
int x=0,y=0;
x=pos().x()+moveAmount.x();
y=pos().y()+moveAmount.y();
qDebug() << "----------------------1010------------------" <<pos().x() << pos().y() << x << y;
if(ui->widget_back_synshow->isHidden()) {
if(x>tmpdesktopSize.width()+ui->widget_base->width()){x=tmpdesktopSize.width()+ui->widget_base->width();}
} else {
if(x>tmpdesktopSize.width()){x=tmpdesktopSize.width();}
}
if(!ui->widget_front_synshow->isHidden()) {
if(x<0){x=0;}
} else {
if(x<-ui->widget_base->width()){x=-ui->widget_base->width();}
}
if(y>tmpdesktopSize.height()){y=tmpdesktopSize.height();}
if(y<0){y=0;}
move(x,y);
m_lastMousePos = event->globalPos();
m_bMouseMove = true;
}
m_clickTimer.stop();
m_num = 0;
}
void NewFloatForm::mousePressEvent(QMouseEvent *event)
{
if (event->button()==Qt::LeftButton)
{
m_bMousePress = true;
m_lastMousePos = event->globalPos();
m_absMove = QPoint(0,0);
m_clickTimer.start(200);
}
}
void NewFloatForm::mouseReleaseEvent(QMouseEvent *event)
{
qDebug() << "-------------2020------------------" << event->globalPos() << pos();
QSize tmpdesktopSize= QApplication::desktop()->screenGeometry().size();
tmpdesktopSize-= QSize(ui->widget_base->width(), ui->widget_base->height());
if (event->button()==Qt::LeftButton)
{
m_bMousePress = false;
}
int x = m_absMove.x();
int y = m_absMove.y();
if(!m_bMouseMove || (((x>-10)&&(x<10))&&((y>-10)&&(y<10))))
{
//qDebug() << "x:" << event->x() << "y:" << event->y();
qDebug() << "-----------------30---------------------------" <<m_num;
if(event->x() > (ui->widget_base->width())*2 || !m_is_login || event->x() < ui->widget_base->width())
{
hide();
m_raiseTimer.stop();
if(m_bReminding)
{
this->onStopRemind();
}
DEFAULTPOSTEVENT(PosEvent::s_show_login, "");
}
else if(m_num > 0)
{
hide();
m_raiseTimer.stop();
if(m_bReminding)
{
this->onStopRemind();
}
DEFAULTPOSTEVENT(PosEvent::s_show_pickup, "");
}
else
{
if(ui->widget_back_synshow->isHidden() && m_is_login && ui->widget_front_synshow->isHidden())
{
if(pos().x() > tmpdesktopSize.width() - 2*(ui->widget_base->width()))
{
ui->widget_front_synshow->show();
} else {
ui->widget_back_synshow->show();
}
if(!ui->widget_base_frame->isHidden())
ui->widget_base_frame->hide();
}
else if(!ui->widget_back_synshow->isHidden() && m_is_login)
{
ui->widget_back_synshow->hide();
if(ui->widget_base_frame->isHidden())
ui->widget_base_frame->show();
} else if(!ui->widget_front_synshow->isHidden() && m_is_login) {
ui->widget_front_synshow->hide();
if(ui->widget_base_frame->isHidden())
ui->widget_base_frame->show();
}
}
m_clickTimer.stop();
m_num = 0;
}
m_bMouseMove = false;
ConfigManger::GetInstance().setFloatInitPostion(this->pos());
}
void NewFloatForm::_Init()
{
QSize tmpdesktopSize= QApplication::desktop()->screenGeometry().size();
if(!m_is_login)
tmpdesktopSize-= QSize(ui->widget_base->width(), ui->widget_base->height());
else
tmpdesktopSize-= QSize(this->width(), this->height());
setWindowFlags(this->windowFlags() | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint | Qt::Tool);
setAttribute(Qt::WA_TranslucentBackground);
// setFixedSize(m_imgNormalSize);
// setStyleSheet("#floatWdg{ border-image: url(:float_normal.png); }");
move(ConfigManger::GetInstance().GetFloatInitPostion());
QPoint pos=ConfigManger::GetInstance().GetFloatInitPostion();
if(pos.x()<0)
{
pos.setX(0);
}
if(pos.y()<0)
{
pos.setY(0);
}
if(pos.x()>tmpdesktopSize.width())
{
pos.setX(tmpdesktopSize.width());
}
if(pos.y()>tmpdesktopSize.height())
{
pos.setY(tmpdesktopSize.height());
}
move(pos);
int currentScreenWid = tmpdesktopSize.width();
int currentScreenHei = tmpdesktopSize.height();
double factoryx = currentScreenWid/800.0;
double factoryy = currentScreenHei/600.0;
qDebug() << "******************************9090*************************" <<currentScreenWid << currentScreenHei << factoryx << factoryy;
resetGrid(this,factoryx,factoryy);
}
void NewFloatForm::_Blink()
{
QSize tmpdesktopSize= QApplication::desktop()->screenGeometry().size();
QEventLoop loop;
connect(&m_animation, &QPropertyAnimation::finished, &loop, &QEventLoop::quit);
m_animation.setStartValue(1);
m_animation.setEndValue(0);
m_animation.start();
loop.exec();
// this->setFixedSize(m_imgRemindSize);
//ui->floatWdg->setStyleSheet("#floatWdg{ border-image: url(:float_remind.png)}");
//ui->widget_login->show();
if(pos().x() > tmpdesktopSize.width() - 2*(ui->widget_base->width()))
{
ui->widget_base_frame->hide();
ui->widget_front_synshow->hide();
ui->widget_back_synshow->hide();
ui->widget_front_login->show();
} else {
ui->widget_base_frame->hide();
ui->widget_back_synshow->hide();
ui->widget_front_synshow->hide();
ui->widget_back_login->show();
}
m_animation.setStartValue(0);
m_animation.setEndValue(1);
m_animation.start();
loop.exec();
m_animation.setStartValue(1);
m_animation.setEndValue(0);
m_animation.start();
loop.exec();
// this->setFixedSize(m_imgNormalSize);
//ui->floatWdg->setStyleSheet("#floatWdg{ border-image: url(:float_normal.png)}");
if(pos().x() > tmpdesktopSize.width() - 2*(ui->widget_base->width()))
{
ui->widget_base_frame->hide();
ui->widget_front_synshow->hide();
ui->widget_back_synshow->hide();
ui->widget_front_login->show();
} else {
ui->widget_base_frame->hide();
ui->widget_back_synshow->hide();
ui->widget_front_synshow->hide();
ui->widget_back_login->show();
}
// ui->widget_base->hide();
// ui->widget_back_synshow->show();
// ui->widget_back_login->hide();
m_animation.setStartValue(0);
m_animation.setEndValue(1);
m_animation.start();
loop.exec();
if(m_bReminding)
{
QTimer::singleShot(ConfigManger::GetInstance().GetBlinkInterval(), this, &NewFloatForm::_Blink);
}
}
void NewFloatForm::_PlayWav()
{
//if(m_play_flag == false && m_bReminding == true)
QSound::play(m_remindWav);
if(m_bReminding)
{
QTimer::singleShot(m_wavPlayInterval, this, &NewFloatForm::_PlayWav);
}
}
void NewFloatForm::_UdpRadio(QString songName, int type,int time)
{
QJsonObject json;
json.insert("reqType",type);
json.insert("sound_name",songName);
json.insert("time",time);
static QString ipAddress;
if(ipAddress.isEmpty())
{
QHostInfo info = QHostInfo::fromName(QHostInfo::localHostName());
foreach(QHostAddress address,info.addresses())
{
if(address.protocol() == QAbstractSocket::IPv4Protocol)
{
ipAddress=address.toString();
}
}
}
int port=ConfigManger::GetInstance().GetUdpPort();
QHostAddress mcast_addr(ipAddress.replace(10,3,ConfigManger::GetInstance().GetUdpUrl()));
QLOG_INFO()<<"udp info"<<mcast_addr<<port<<QJsonDocument(json).toJson(QJsonDocument::Compact);
QUdpSocket udp_socket;
//udp_socket.writeDatagram(QJsonDocument(json).toJson(QJsonDocument::Compact), mcast_addr, port);
udp_socket.writeDatagram(QJsonDocument(json).toJson(QJsonDocument::Compact), QHostAddress::Broadcast, port);
udp_socket.waitForBytesWritten();
udp_socket.close();
qDebug()<<__FUNCTION__;
}
void NewFloatForm::onStartRemind(int type)
{
switch(type)
{
case 0:
m_remindWav = QString("%1/wav/msg.wav").arg(QApplication::applicationDirPath());
// 加上音频的时长
m_wavPlayInterval = ConfigManger::GetInstance().GetSoundInterval() + VALUE_NEWORDERTIME;
ui->label_back_newmsg->setText(QString::fromLocal8Bit("新订单"));
break;
case 1:
m_remindWav = QString("%1/wav/msg1.wav").arg(QApplication::applicationDirPath());
m_wavPlayInterval = ConfigManger::GetInstance().GetSoundInterval() + VALUE_REFUNDORDERTIME;
ui->label_back_newmsg->setText(QString::fromLocal8Bit("新退单"));
break;
case 2:
m_remindWav = QString("%1/wav/msg2.wav").arg(QApplication::applicationDirPath());
m_wavPlayInterval = ConfigManger::GetInstance().GetSoundInterval() + VALUE_REFUNDORDERTIME;
ui->label_back_newmsg->setText(QString::fromLocal8Bit("网络异常"));
}
if(m_bReminding)
{
return;
}else
{
m_bReminding = true;
}
if(m_remindTimer.isActive())
m_remindTimer.stop();
if(this->isHidden())
m_remindTimer.start(1*1000);
else
m_remindTimer.start(7*24*60*60*1000);
m_remindTimer.setSingleShot(true);
connect(&m_remindTimer, &QTimer::timeout, this, &NewFloatForm::onStopRemind);
_Blink();
_PlayWav();
}
void NewFloatForm::onStopRemind()
{
m_bReminding = false;
//m_play_flag = false;
}
void NewFloatForm::onShow()
{
InitWidget();
show();
m_raiseTimer.start();
}
void NewFloatForm::resetGrid(QDialog *widget, double factorx, double factory)
{
int widgetX = widget->x();
int widgetY = widget->y();
int widgetWid = widget->width();
int widgetHei = widget->height();
int nWidgetWid = (int)(widgetWid*factorx);
int nWidgetHei = (int)(widgetHei*factory);
qDebug() << "----------------------------------------9090-----------------------" << widgetX << widgetY << nWidgetWid << nWidgetHei;
// this->setGeometry(0,0,nWidgetWid,nWidgetHei);
// ui->widget_base->setGeometry(widgetX,widgetY+ui->widget_base->width(),nWidgetWid*(48/144.0),nWidgetHei);
// ui->widget_back_login->setGeometry(0,0,nWidgetWid,nWidgetHei);
// ui->widget_back_synshow->setGeometry(0,0,nWidgetWid,nWidgetHei);
// ui->widget_touch->setGeometry(0,0,nWidgetWid,nWidgetHei);
// widget->setFixedSize(nWidgetWid,nWidgetHei);
this->setFixedSize(nWidgetWid,nWidgetHei);
ui->widget_base_frame->setFixedSize(nWidgetWid,nWidgetHei);
ui->widget_back_login->setFixedSize(nWidgetWid,nWidgetHei);
ui->widget_back_synshow->setFixedSize(nWidgetWid,nWidgetHei);
ui->widget_front_login->setFixedSize(nWidgetWid,nWidgetHei);
ui->widget_front_synshow->setFixedSize(nWidgetWid,nWidgetHei);
ui->widget_touch->setFixedSize(nWidgetWid,nWidgetHei);
//设置label字体大小
ui->label_back_new->setStyleSheet(QString("#QLabel{font-size:%1px;}").arg(10*factorx));
ui->label_back_newnum->setStyleSheet(QString("#QLabel{font-size:%1px;}").arg(10*factorx));
}
void NewFloatForm::OnUpdate()
{
m_num++;
}
#ifndef NEWFLOATFORM_H
#define NEWFLOATFORM_H
#include <QDialog>
#include <QMouseEvent>
#include <QTimer>
#include <QSize>
#include <QPropertyAnimation>
#include <QSound>
namespace Ui {
class NewFloatForm;
}
class NewFloatForm : public QDialog
{
Q_OBJECT
public:
explicit NewFloatForm(QWidget *parent = 0);
~NewFloatForm();
virtual bool event(QEvent *e);
protected:
void mouseMoveEvent(QMouseEvent * event);
void mousePressEvent(QMouseEvent * event);
void mouseReleaseEvent(QMouseEvent * event);
private:
QSize desktopSize;
Ui::NewFloatForm *ui;
// 记录左键按下去后是否移动过
bool m_bMouseMove;
// 记录左键是否按下去
bool m_bMousePress;
// 拖动前鼠标坐标
QPoint m_lastMousePos;
// 此次拖动一共移动的距离
QPoint m_absMove;
// 记录正常状态图片的大小
QSize m_imgNormalSize;
// 记录提示状态图片的大小
QSize m_imgRemindSize;
// 记录是否正在提示
bool m_bReminding;
// 闪烁动画
QPropertyAnimation m_animation;
// 记录音频文件
QString m_remindWav;
// 声音的间隔
int m_wavPlayInterval;
// 置顶定时器
QTimer m_raiseTimer;
QTimer m_remindTimer;
//长按悬浮框计时定时器
QTimer m_clickTimer;
//计时1s加1
int m_num;
// 是否登录成功
bool m_is_login;
//停止标识
bool m_play_flag;
//
/* 功能:初始化
* 参数:NULL
* 返回:NULL
* */
void _Init();
/* 功能:界面展示
* 参数:[1] -1界面展示; 0新订单; 1新退单
* 返回:NULL
* */
void InitWidget(int flag = -1);
private slots:
/* 功能:闪烁
* 参数:NULL
* 返回:NULL
* */
void _Blink();
/* 功能:声音
* 参数:NULL
* 返回:NULL
* */
void _PlayWav();
//udp广播声音播控
void _UdpRadio(QString songName, int type, int time);
//悬浮框大小自适应不同屏幕分辨率
void resetGrid(QDialog *widget,double factorx,double factory);
void OnUpdate();
signals:
/* 功能:通知主窗口显示
* 参数:NULL
* 返回:NULL
* */
void showMainForm();
public slots:
/* 功能:开启提示
* 参数:[1]提示类型 0新订单1申请退款
* 返回:NULL
* */
void onStartRemind(int type);
/* 功能:关闭提示
* 参数:NULL
* 返回:NULL
* */
void onStopRemind();
/* 功能:显示窗口
* 参数:NULL
* 返回:NULL
* */
void onShow();
};
#endif // NEWFLOATFORM_H
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>NewFloatForm</class>
<widget class="QDialog" name="NewFloatForm">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>144</width>
<height>48</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<property name="styleSheet">
<string notr="true">#label_front_new,#label_back_new
{
font: 75 10px &quot;黑体&quot;;
color: #0073FF;
}
#label_front_refund,#label_back_refund
{
font: 75 10px &quot;黑体&quot;;
color: #FF000A;
}
#label_front_newnum,#label_back_newnum
{
font: 75 10px &quot;微软雅黑&quot;;
color: #0073FF;
}
#label_front_refundnum,#label_back_refundnum
{
font: 75 10px &quot;微软雅黑&quot;;
color: #FF000A;
}
#widget_base
{
border-image: url(:base_logo.png);
}
/*#widget_back_login
{
border-image: url(:loginlogin.png);
}*/
#widget_back_showmsg
{
border-image: url(:loginlogin.png);
}
#widget_front_showmsg
{
border-image: url(:loginlogin_back.png);
}
/*#widget_back_synshow
{
border-image: url(:loginlogin.png);
}*/
#label_back_newmsg
{
font: 10px &quot;微软雅黑&quot;;
color: #FF000A;
}</string>
</property>
<widget class="QWidget" name="widget_base_frame" native="true">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>144</width>
<height>48</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_7" stretch="1,1,1">
<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>
<spacer name="horizontalSpacer_7">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>45</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QWidget" name="widget_base" native="true"/>
</item>
<item>
<spacer name="horizontalSpacer_8">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>45</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWidget" name="widget_touch" native="true">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>144</width>
<height>48</height>
</rect>
</property>
</widget>
<widget class="QWidget" name="widget_back_login" native="true">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>144</width>
<height>48</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout" stretch="2,1">
<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>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>96</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label_back_newmsg">
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="widget_front_login" native="true">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>144</width>
<height>48</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2" stretch="1,2">
<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="label_front_newmsg">
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>96</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWidget" name="widget_back_synshow" native="true">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>144</width>
<height>48</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_3" stretch="1,2">
<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>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>48</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QWidget" name="widget_back_showmsg" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_5" stretch="1,1">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>5</number>
</property>
<property name="rightMargin">
<number>5</number>
</property>
<property name="bottomMargin">
<number>5</number>
</property>
<item>
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>48</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QGridLayout" name="gridLayout">
<property name="spacing">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_back_new">
<property name="text">
<string></string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="label_back_newnum">
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_back_refund">
<property name="text">
<string>退</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="label_back_refundnum">
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="widget_front_synshow" native="true">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>144</width>
<height>48</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_4" stretch="2,1">
<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="QWidget" name="widget_front_showmsg" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_6" stretch="1,1">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>5</number>
</property>
<property name="topMargin">
<number>5</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>5</number>
</property>
<item>
<layout class="QGridLayout" name="gridLayout_4">
<property name="spacing">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_front_new">
<property name="text">
<string></string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="label_front_newnum">
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_front_refund">
<property name="text">
<string>退</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="label_front_refundnum">
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="horizontalSpacer_6">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>48</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>48</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
<resources/>
<connections/>
</ui>
......@@ -26,21 +26,21 @@ NewLoginForm::NewLoginForm(QWidget *parent) :
connect(ui->lineEdit_account_2, &ClickedLineEdit::clicked, this, &NewLoginForm::GetCurrLineEdit);
connect(ui->lineEdit_partnerid_2, &ClickedLineEdit::clicked, this, &NewLoginForm::GetCurrLineEdit);
connect(ui->lineEdit_pwd_2, &ClickedLineEdit::clicked, this, &NewLoginForm::GetCurrLineEdit);
connect(ui->lineEdit_posno_2, &ClickedLineEdit::clicked, this, &NewLoginForm::GetCurrLineEdit);
// connect(ui->lineEdit_posno_2, &ClickedLineEdit::clicked, this, &NewLoginForm::GetCurrLineEdit);
connect(ui->lineEdit_storeid_2, &ClickedLineEdit::clicked, this, &NewLoginForm::GetCurrLineEdit);
connect(ui->pushButton_10, &QPushButton::clicked, this, &NewLoginForm::number_btn_click);
connect(ui->pushButton_11, &QPushButton::clicked, this, &NewLoginForm::number_btn_click);
connect(ui->pushButton_12, &QPushButton::clicked, this, &NewLoginForm::number_btn_click);
connect(ui->pushButton_13, &QPushButton::clicked, this, &NewLoginForm::number_btn_click);
connect(ui->pushButton_14, &QPushButton::clicked, this, &NewLoginForm::number_btn_click);
connect(ui->pushButton_15, &QPushButton::clicked, this, &NewLoginForm::number_btn_click);
connect(ui->pushButton_16, &QPushButton::clicked, this, &NewLoginForm::number_btn_click);
connect(ui->pushButton_17, &QPushButton::clicked, this, &NewLoginForm::number_btn_click);
connect(ui->pushButton_18, &QPushButton::clicked, this, &NewLoginForm::number_btn_click);
connect(ui->pushButton_19, &QPushButton::clicked, this, &NewLoginForm::number_btn_click);
connect(ui->pushButton_clear_2, &QPushButton::clicked, this, &NewLoginForm::number_btn_click);
connect(ui->pushButton_del_2, &QPushButton::clicked, this, &NewLoginForm::number_btn_click);
connect(ui->pushButton_num0, &QPushButton::clicked, this, &NewLoginForm::number_btn_click);
connect(ui->pushButton_num1, &QPushButton::clicked, this, &NewLoginForm::number_btn_click);
connect(ui->pushButton_num2, &QPushButton::clicked, this, &NewLoginForm::number_btn_click);
connect(ui->pushButton_num3, &QPushButton::clicked, this, &NewLoginForm::number_btn_click);
connect(ui->pushButton_num4, &QPushButton::clicked, this, &NewLoginForm::number_btn_click);
connect(ui->pushButton_num5, &QPushButton::clicked, this, &NewLoginForm::number_btn_click);
connect(ui->pushButton_num6, &QPushButton::clicked, this, &NewLoginForm::number_btn_click);
connect(ui->pushButton_num7, &QPushButton::clicked, this, &NewLoginForm::number_btn_click);
connect(ui->pushButton_num8, &QPushButton::clicked, this, &NewLoginForm::number_btn_click);
connect(ui->pushButton_num9, &QPushButton::clicked, this, &NewLoginForm::number_btn_click);
connect(ui->pushButton_clearBtn, &QPushButton::clicked, this, &NewLoginForm::number_btn_click);
connect(ui->pushButton_delBtn, &QPushButton::clicked, this, &NewLoginForm::number_btn_click);
_curr_lineedit = ui->lineEdit_partnerid_2;
_curr_lineedit->setFocus();
......@@ -52,9 +52,12 @@ NewLoginForm::NewLoginForm(QWidget *parent) :
QString configfile = qApp->applicationDirPath() + "/" + CONFIG_NAME;
m_autologin = QSettings(configfile, QSettings::IniFormat).value(INI_AUTOLOGIN, 0).toInt();
m_rememberPwd = QSettings(configfile, QSettings::IniFormat).value(INI_REMEMBERPWD, 0).toInt();
if(m_autologin)
ui->checkBox_2->setChecked(true);
if(m_rememberPwd)
ui->checkBox_rememberPwd->setChecked(true);
FMApplication::subscibeEvent(this, PosEvent::s_login_status);
FMApplication::subscibeEvent(this, PosEvent::s_opt_status);
......@@ -96,9 +99,11 @@ void NewLoginForm::SetStoreInfo()
ui->lineEdit_partnerid_2->setText(partnerid);
ui->lineEdit_storeid_2->setText(storeid);
ui->lineEdit_posno_2->setText(stationid);
// ui->lineEdit_posno_2->setText(stationid);
ui->lineEdit_account_2->setText(userid);
ui->lineEdit_pwd_2->setText(pwd);
if(ui->checkBox_rememberPwd->isChecked())
ui->lineEdit_pwd_2->setText(pwd);
}
void NewLoginForm::showfull()
......@@ -192,14 +197,22 @@ void NewLoginForm::on_pushButton_login_2_clicked()
else
QSettings(configfile, QSettings::IniFormat).setValue(INI_AUTOLOGIN, 0);
if(ui->checkBox_rememberPwd->isChecked())
QSettings(configfile, QSettings::IniFormat).setValue(INI_REMEMBERPWD, 1);
else
QSettings(configfile, QSettings::IniFormat).setValue(INI_REMEMBERPWD, 0);
QLOG_DEBUG() << "configfile" << configfile;
QVariantMap map;
if(ui->lineEdit_pwd_2->text().isEmpty())
return;
if(ui->lineEdit_account_2->text().isEmpty() ||
ui->lineEdit_pwd_2->text().isEmpty() ||
ui->lineEdit_partnerid_2->text().isEmpty() ||
ui->lineEdit_posno_2->text().isEmpty() ||
/*ui->lineEdit_posno_2->text().isEmpty() ||*/
ui->lineEdit_storeid_2->text().isEmpty() )
{
onShowAlert(AlertForm::ERROR, QString::fromLocal8Bit("商户号/门店号/POS编号/账号/密码均不能为空"));
......@@ -207,7 +220,8 @@ void NewLoginForm::on_pushButton_login_2_clicked()
}
map.insert(JSON_STOREID, ui->lineEdit_storeid_2->text());
map.insert(JSON_STATIONID, ui->lineEdit_posno_2->text());
// map.insert(JSON_STATIONID, ui->lineEdit_posno_2->text());
map.insert(JSON_STATIONID, ui->lineEdit_account_2->text());
map.insert(JSON_KEY_USERID, ui->lineEdit_account_2->text());
map.insert(JSON_KEY_PWD, ui->lineEdit_pwd_2->text());
map.insert(JSON_KEY_PARTNERID, ui->lineEdit_partnerid_2->text());
......@@ -219,11 +233,11 @@ void NewLoginForm::number_btn_click()
{
QPushButton *btn = qobject_cast<QPushButton*>(sender());
if(btn == ui->pushButton_clear_2)
if(btn == ui->pushButton_clearBtn)
{
_curr_lineedit->clear();
}
else if(btn == ui->pushButton_del_2)
else if(btn == ui->pushButton_delBtn)
{
QString text = _curr_lineedit->text();
......
......@@ -48,7 +48,11 @@ private:
// 通知窗口
AlertForm *m_alertForm;
//自动登陆标志位
int m_autologin;
//记住密码标志位
int m_rememberPwd;
};
#endif // NEWLOGINFORM_H
......@@ -58,7 +58,7 @@
background-color: rgb(255, 42, 42);
border-radius: 4px;
}
#pushButton_19,#pushButton_12,#pushButton_17,#pushButton_16,#pushButton_13,#pushButton_14
#pushButton_num1,#pushButton_num2,#pushButton_num4,#pushButton_num5,#pushButton_num7,#pushButton_num8
{
font: 17pt &quot;微软雅黑&quot;;
color: #000000;
......@@ -67,7 +67,7 @@
border-right-style: 0px;
border-bottom-style: 0px;
}
#pushButton_del_2
#pushButton_delBtn
{
font: 14pt &quot;微软雅黑&quot;;
color: #000000;
......@@ -75,7 +75,7 @@
border: 1px solid #D9D9D9;
border-right-style: 0px;
}
#pushButton_11
#pushButton_num0
{
font: 17pt &quot;微软雅黑&quot;;
color: #000000;
......@@ -83,7 +83,7 @@
border: 1px solid #D9D9D9;
border-right-style: 0px;
}
#pushButton_15,#pushButton_18,#pushButton_10
#pushButton_num3,#pushButton_num6,#pushButton_num9
{
font: 17pt &quot;微软雅黑&quot;;
color: #000000;
......@@ -91,7 +91,7 @@
border: 1px solid #D9D9D9;
border-bottom-style: 0px;
}
#pushButton_clear_2
#pushButton_clearBtn
{
font: 14pt &quot;微软雅黑&quot;;
color: #000000;
......@@ -115,6 +115,25 @@
image:url(:login_save.png);
}
#checkBox_rememberPwd
{
font: 9pt &quot;微软雅黑&quot;;
}
#checkBox_rememberPwd::indicator:unchecked{
image:url(:login_unsave.png);
}
#checkBox_rememberPwd::indicator:checked{
image:url(:login_save.png);
}
#widget_3
{
border:1px solid #D9D9D9;
background-color:white;
}
</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
......@@ -247,7 +266,7 @@
<height>550</height>
</size>
</property>
<layout class="QVBoxLayout" name="verticalLayout_4">
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="spacing">
<number>0</number>
</property>
......@@ -442,7 +461,7 @@
</spacer>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout" stretch="0,1,0,1,0">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="spacing">
<number>0</number>
</property>
......@@ -460,7 +479,26 @@
</spacer>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_2">
<layout class="QVBoxLayout" name="verticalLayout_3">
<property name="spacing">
<number>20</number>
</property>
<item>
<spacer name="verticalSpacer_4">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>13</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_6">
<property name="spacing">
......@@ -494,13 +532,13 @@
<property name="minimumSize">
<size>
<width>200</width>
<height>40</height>
<height>30</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>200</width>
<height>40</height>
<height>30</height>
</size>
</property>
<property name="text">
......@@ -540,53 +578,13 @@
<property name="minimumSize">
<size>
<width>200</width>
<height>40</height>
<height>30</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>200</width>
<height>40</height>
</size>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_21">
<item>
<widget class="QLabel" name="label_posno_2">
<property name="text">
<string>POS编号</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_37">
<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="ClickedLineEdit" name="lineEdit_posno_2">
<property name="minimumSize">
<size>
<width>200</width>
<height>40</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>200</width>
<height>40</height>
<height>30</height>
</size>
</property>
</widget>
......@@ -626,13 +624,13 @@
<property name="minimumSize">
<size>
<width>200</width>
<height>40</height>
<height>30</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>200</width>
<height>40</height>
<height>30</height>
</size>
</property>
<property name="text">
......@@ -675,13 +673,13 @@
<property name="minimumSize">
<size>
<width>200</width>
<height>40</height>
<height>30</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>200</width>
<height>40</height>
<height>30</height>
</size>
</property>
<property name="text">
......@@ -695,7 +693,10 @@
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_19">
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
<number>0</number>
</property>
<item>
<spacer name="horizontalSpacer_28">
<property name="orientation">
......@@ -713,7 +714,7 @@
<widget class="QCheckBox" name="checkBox_2">
<property name="minimumSize">
<size>
<width>0</width>
<width>130</width>
<height>0</height>
</size>
</property>
......@@ -724,22 +725,28 @@
</size>
</property>
<property name="text">
<string>下次默认自动登陆</string>
<string>自动登录</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<widget class="QCheckBox" name="checkBox_rememberPwd">
<property name="minimumSize">
<size>
<width>70</width>
<height>0</height>
</size>
</property>
<property name="sizeHint" stdset="0">
<property name="maximumSize">
<size>
<width>40</width>
<height>20</height>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
</spacer>
<property name="text">
<string>记住密码</string>
</property>
</widget>
</item>
</layout>
</item>
......@@ -762,301 +769,281 @@
</spacer>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_3">
<property name="spacing">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>11</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QGridLayout" name="gridLayout_2">
<property name="topMargin">
<number>0</number>
</property>
<property name="spacing">
<number>0</number>
</property>
<item row="4" column="2">
<widget class="QPushButton" name="pushButton_10">
<property name="minimumSize">
<size>
<width>95</width>
<height>70</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>95</width>
<height>70</height>
</size>
</property>
<property name="text">
<string>9</string>
</property>
<property name="number" stdset="0">
<string>9</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QPushButton" name="pushButton_11">
<property name="minimumSize">
<size>
<width>95</width>
<height>70</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>95</width>
<height>70</height>
</size>
</property>
<property name="text">
<string>0</string>
</property>
<property name="number" stdset="0">
<string>0</string>
</property>
</widget>
</item>
<item row="5" column="2">
<widget class="QPushButton" name="pushButton_clear_2">
<property name="minimumSize">
<size>
<width>95</width>
<height>70</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>95</width>
<height>70</height>
</size>
</property>
<property name="text">
<string>清空</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QPushButton" name="pushButton_13">
<property name="minimumSize">
<size>
<width>95</width>
<height>70</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>95</width>
<height>70</height>
</size>
</property>
<property name="text">
<string>4</string>
</property>
<property name="number" stdset="0">
<string>4</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QPushButton" name="pushButton_12">
<property name="minimumSize">
<size>
<width>95</width>
<height>70</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>90</width>
<height>70</height>
</size>
</property>
<property name="text">
<string>2</string>
</property>
<property name="number" stdset="0">
<string>2</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QPushButton" name="pushButton_14">
<property name="minimumSize">
<size>
<width>95</width>
<height>70</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>95</width>
<height>70</height>
</size>
</property>
<property name="text">
<string>7</string>
</property>
<property name="number" stdset="0">
<string>7</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QPushButton" name="pushButton_15">
<property name="minimumSize">
<size>
<width>95</width>
<height>70</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>90</width>
<height>70</height>
</size>
</property>
<property name="text">
<string>3</string>
</property>
<property name="number" stdset="0">
<string>3</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QPushButton" name="pushButton_16">
<property name="minimumSize">
<size>
<width>95</width>
<height>70</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>95</width>
<height>70</height>
</size>
</property>
<property name="text">
<string>8</string>
</property>
<property name="number" stdset="0">
<string>8</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QPushButton" name="pushButton_17">
<property name="minimumSize">
<size>
<width>95</width>
<height>70</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>95</width>
<height>70</height>
</size>
</property>
<property name="text">
<string>5</string>
</property>
<property name="number" stdset="0">
<string>5</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QPushButton" name="pushButton_del_2">
<property name="minimumSize">
<size>
<width>95</width>
<height>70</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>95</width>
<height>70</height>
</size>
</property>
<property name="text">
<string>删除</string>
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="QPushButton" name="pushButton_18">
<property name="minimumSize">
<size>
<width>95</width>
<height>70</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>95</width>
<height>70</height>
</size>
</property>
<property name="text">
<string>6</string>
</property>
<property name="number" stdset="0">
<string>6</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QPushButton" name="pushButton_19">
<property name="minimumSize">
<size>
<width>95</width>
<height>70</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>90</width>
<height>70</height>
</size>
</property>
<property name="text">
<string>1</string>
</property>
<property name="autoDefault">
<bool>true</bool>
</property>
<property name="number" stdset="0">
<string>1</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
<widget class="QWidget" name="widget_3" native="true">
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<layout class="QGridLayout" name="gridLayout_6">
<property name="topMargin">
<number>0</number>
</property>
<property name="spacing">
<number>0</number>
</property>
<item row="4" column="2">
<widget class="QPushButton" name="pushButton_num9">
<property name="minimumSize">
<size>
<width>95</width>
<height>70</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>95</width>
<height>70</height>
</size>
</property>
<property name="text">
<string>9</string>
</property>
<property name="number" stdset="0">
<string>9</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QPushButton" name="pushButton_num0">
<property name="minimumSize">
<size>
<width>95</width>
<height>70</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>95</width>
<height>70</height>
</size>
</property>
<property name="text">
<string>0</string>
</property>
<property name="number" stdset="0">
<string>0</string>
</property>
</widget>
</item>
<item row="5" column="2">
<widget class="QPushButton" name="pushButton_clearBtn">
<property name="minimumSize">
<size>
<width>95</width>
<height>70</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>95</width>
<height>70</height>
</size>
</property>
<property name="text">
<string>清空</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QPushButton" name="pushButton_num4">
<property name="minimumSize">
<size>
<width>95</width>
<height>70</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>95</width>
<height>70</height>
</size>
</property>
<property name="text">
<string>4</string>
</property>
<property name="number" stdset="0">
<string>4</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QPushButton" name="pushButton_num2">
<property name="minimumSize">
<size>
<width>95</width>
<height>70</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>90</width>
<height>70</height>
</size>
</property>
<property name="text">
<string>2</string>
</property>
<property name="number" stdset="0">
<string>2</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QPushButton" name="pushButton_num7">
<property name="minimumSize">
<size>
<width>95</width>
<height>70</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>95</width>
<height>70</height>
</size>
</property>
<property name="text">
<string>7</string>
</property>
<property name="number" stdset="0">
<string>7</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QPushButton" name="pushButton_num3">
<property name="minimumSize">
<size>
<width>95</width>
<height>70</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>90</width>
<height>70</height>
</size>
</property>
<property name="text">
<string>3</string>
</property>
<property name="number" stdset="0">
<string>3</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QPushButton" name="pushButton_num8">
<property name="minimumSize">
<size>
<width>95</width>
<height>70</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>95</width>
<height>70</height>
</size>
</property>
<property name="text">
<string>8</string>
</property>
<property name="number" stdset="0">
<string>8</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QPushButton" name="pushButton_num5">
<property name="minimumSize">
<size>
<width>95</width>
<height>70</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>95</width>
<height>70</height>
</size>
</property>
<property name="text">
<string>5</string>
</property>
<property name="number" stdset="0">
<string>5</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QPushButton" name="pushButton_delBtn">
<property name="minimumSize">
<size>
<width>95</width>
<height>70</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>95</width>
<height>70</height>
</size>
</property>
<property name="text">
<string>删除</string>
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="QPushButton" name="pushButton_num6">
<property name="minimumSize">
<size>
<width>95</width>
<height>70</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>95</width>
<height>70</height>
</size>
</property>
<property name="text">
<string>6</string>
</property>
<property name="number" stdset="0">
<string>6</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QPushButton" name="pushButton_num1">
<property name="minimumSize">
<size>
<width>95</width>
<height>70</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>90</width>
<height>70</height>
</size>
</property>
<property name="text">
<string>1</string>
</property>
<property name="autoDefault">
<bool>true</bool>
</property>
<property name="number" stdset="0">
<string>1</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_34">
......@@ -1185,7 +1172,7 @@
<customwidget>
<class>ClickedLineEdit</class>
<extends>QLineEdit</extends>
<header location="global">view/clickedlineedit.h</header>
<header>view/clickedlineedit.h</header>
</customwidget>
</customwidgets>
<resources/>
......
......@@ -49,6 +49,7 @@ NewMainForm::NewMainForm(QWidget *parent) :
FMApplication::subscibeEvent(this, PosEvent::s_show_mainform);
FMApplication::subscibeEvent(this, PosEvent::s_network_outtime);
FMApplication::subscibeEvent(this, PosEvent::s_show_stalls);
FMApplication::subscibeEvent(this, PosEvent::s_show_pickup);
//this->show();
this->showFullScreen();
......@@ -702,6 +703,13 @@ bool NewMainForm::event(QEvent *e)
return true;
}
if(e->type() == PosEvent::s_show_pickup)
{
this->showFullScreen();
InitWidget(MAIN_SCAN);
return true;
}
return QWidget::event(e);
}
......
......@@ -9,6 +9,7 @@ NewPickupForm::NewPickupForm(QWidget *parent) :
ui(new Ui::NewPickupForm)
{
ui->setupUi(this);
}
NewPickupForm::~NewPickupForm()
......
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