修复虚拟相机打开图像卡顿问题

master
bobpan 5 years ago
parent 4c079d612a
commit 03daf66f62

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -24,7 +24,7 @@ QLoginDlg::QLoginDlg(QUserDB* pUserDB)
{ {
ui.setupUi(this); ui.setupUi(this);
setWindowFlags(Qt::WindowCloseButtonHint); setWindowFlags(Qt::WindowCloseButtonHint);
setWindowIcon(QIcon(":/userinfo")); //setWindowIcon(QIcon(":/userinfo"));
_UserNameComboBox = ui.login_UserName; _UserNameComboBox = ui.login_UserName;
_PasswdLineEdit = ui.login_Passwd; _PasswdLineEdit = ui.login_Passwd;
_UserNameComboBox->setEditable(true); _UserNameComboBox->setEditable(true);

@ -5,7 +5,7 @@ QUserAddNew::QUserAddNew(QWidget *parent): QDialog(parent)
{ {
ui.setupUi(this); ui.setupUi(this);
setWindowFlags(Qt::WindowCloseButtonHint); setWindowFlags(Qt::WindowCloseButtonHint);
setWindowIcon(QIcon(":/userinfo")); // setWindowIcon(QIcon(":/userinfo"));
ui.m_UserName_lineEdit->clear(); ui.m_UserName_lineEdit->clear();
ui.m_Passwd_lineEdit->clear(); ui.m_Passwd_lineEdit->clear();
ui.m_Passwd2_lineEdit->clear(); ui.m_Passwd2_lineEdit->clear();

@ -40,8 +40,8 @@ class IUserCtrl:public QObject {
public: public:
IUserCtrl() {}; IUserCtrl() {};
~IUserCtrl() {}; ~IUserCtrl() {};
virtual void CheckLogin() =0; virtual void CheckLogin(QWidget* parent = nullptr) =0;
virtual void ShowUserMgrDlg() = 0; virtual void ShowUserMgrDlg(QWidget* parent = nullptr) = 0;
virtual void LogOutUser() =0; virtual void LogOutUser() =0;
virtual QString CurUser() = 0; virtual QString CurUser() = 0;
virtual int CurUserLevel() = 0; virtual int CurUserLevel() = 0;

@ -61,17 +61,20 @@ QUserCtrl::~QUserCtrl()
} }
} }
void QUserCtrl::CheckLogin() void QUserCtrl::CheckLogin(QWidget* parent)
{ {
QStringList strList = _pUserDBSqlite->Users(-1); QStringList strList = _pUserDBSqlite->Users(-1);
_LoginDlg->AddItems2List(strList); _LoginDlg->AddItems2List(strList);
_LoginDlg->setParent(parent);
_LoginDlg->setWindowFlags(Qt::Dialog | Qt::WindowCloseButtonHint);
_LoginDlg->show(); _LoginDlg->show();
} }
void QUserCtrl::ShowUserMgrDlg() void QUserCtrl::ShowUserMgrDlg(QWidget* parent)
{ {
QDesktopWidget* desktop = QApplication::desktop();// QDesktopWidget* desktop = QApplication::desktop();//
_pDlgUsersMgr->setParent(parent);
_pDlgUsersMgr->setWindowFlags(Qt::Dialog | Qt::WindowCloseButtonHint);
_pDlgUsersMgr->move((desktop->width() - _pDlgUsersMgr->width()) / 2, (desktop->height() - _pDlgUsersMgr->height()) / 2); _pDlgUsersMgr->move((desktop->width() - _pDlgUsersMgr->width()) / 2, (desktop->height() - _pDlgUsersMgr->height()) / 2);
_pDlgUsersMgr->SetUserAndLevel(_CurrentUserName, m_nLevel); _pDlgUsersMgr->SetUserAndLevel(_CurrentUserName, m_nLevel);
_pDlgUsersMgr->OnUpdateUserList(); _pDlgUsersMgr->OnUpdateUserList();

@ -13,8 +13,8 @@ public:
QUserCtrl(QWidget* parent = 0); QUserCtrl(QWidget* parent = 0);
~QUserCtrl(); ~QUserCtrl();
void CheckLogin(); void CheckLogin(QWidget* parent = nullptr);
void ShowUserMgrDlg(); void ShowUserMgrDlg(QWidget* parent = nullptr);
void LogOutUser(); void LogOutUser();
QString CurUser() { return _CurrentUserName; } //当前登录用户的用户名 QString CurUser() { return _CurrentUserName; } //当前登录用户的用户名
int CurUserLevel() { return m_nLevel; } //当前登录用户的等级 int CurUserLevel() { return m_nLevel; } //当前登录用户的等级

@ -17,7 +17,7 @@ QUserManagerDlg::QUserManagerDlg(QUserDB* pLogic)
{ {
ui.setupUi(this); ui.setupUi(this);
setWindowFlags(Qt::WindowCloseButtonHint); setWindowFlags(Qt::WindowCloseButtonHint);
setWindowIcon(QIcon(":/userinfo")); //setWindowIcon(QIcon(":/userinfo"));
QStringList headerList; QStringList headerList;
headerList << QObject::tr("用户名") << QObject::tr("等级"); headerList << QObject::tr("用户名") << QObject::tr("等级");
plistModel = QSharedPointer<QStandardItemModel>(new QStandardItemModel); plistModel = QSharedPointer<QStandardItemModel>(new QStandardItemModel);
@ -58,7 +58,8 @@ void QUserManagerDlg::onAddUser()
QMessageBox::warning(this, QObject::tr("错误警告"), QObject::tr("你当前没有权限添加用户,请登录!")); QMessageBox::warning(this, QObject::tr("错误警告"), QObject::tr("你当前没有权限添加用户,请登录!"));
return; return;
} }
QUserAddNew dlg; QUserAddNew dlg(this);
dlg.setWindowFlags(Qt::Dialog | Qt::WindowCloseButtonHint);
dlg.setTitle(QObject::tr("添加新用户")); dlg.setTitle(QObject::tr("添加新用户"));
UserInfo info; UserInfo info;
info.mLevel = m_level; info.mLevel = m_level;
@ -132,7 +133,8 @@ void QUserManagerDlg::onModifyUser()
QMessageBox::warning(this, QObject::tr("错误警告"), QObject::tr("你没有选中需要修改的用户,请联系管理员!")); QMessageBox::warning(this, QObject::tr("错误警告"), QObject::tr("你没有选中需要修改的用户,请联系管理员!"));
return; return;
} }
QUserAddNew dlg; QUserAddNew dlg(this);
dlg.setWindowFlags(Qt::Dialog | Qt::WindowCloseButtonHint);
dlg.setTitle(QObject::tr("修改用户信息")); dlg.setTitle(QObject::tr("修改用户信息"));
UserInfo info; UserInfo info;
info.mLevel = m_level; info.mLevel = m_level;

@ -582,7 +582,7 @@ Q_SLOT void CMainWin::onActionClicked()
} }
} }
else else
m_pUserCtrl->CheckLogin(); m_pUserCtrl->CheckLogin(this);
} }
else else
{ {
@ -594,7 +594,7 @@ Q_SLOT void CMainWin::onActionClicked()
} }
else if ("main_action_userManager" == strObj) {//用户管理 else if ("main_action_userManager" == strObj) {//用户管理
if (m_pUserCtrl) { if (m_pUserCtrl) {
m_pUserCtrl->ShowUserMgrDlg(); m_pUserCtrl->ShowUserMgrDlg(this);
} }
else else
{ {
@ -945,7 +945,7 @@ Q_SLOT void CMainWin::onShowImage(int ID, QImage img)
} }
else else
{ {
QRect rt = ui.wf_lb_image_show_1->rect(); QRect rt = pLab->rect();
int h = img.height(); int h = img.height();
int w = img.width(); int w = img.width();
float d = w * 1.0 / h; float d = w * 1.0 / h;

@ -7,7 +7,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>1022</width> <width>1022</width>
<height>705</height> <height>723</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@ -143,6 +143,12 @@
</item> </item>
<item> <item>
<widget class="QLabel" name="wf_lb_image_show_1"> <widget class="QLabel" name="wf_lb_image_show_1">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>492</width> <width>492</width>
@ -167,19 +173,6 @@
</property> </property>
</widget> </widget>
</item> </item>
<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>
</layout> </layout>
</item> </item>
<item> <item>
@ -211,6 +204,12 @@
</item> </item>
<item> <item>
<widget class="QLabel" name="wf_lb_image_show_2"> <widget class="QLabel" name="wf_lb_image_show_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>492</width> <width>492</width>
@ -235,19 +234,6 @@
</property> </property>
</widget> </widget>
</item> </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> </layout>
</item> </item>
</layout> </layout>

@ -6,7 +6,7 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>516</width> <width>442</width>
<height>195</height> <height>195</height>
</rect> </rect>
</property> </property>

Loading…
Cancel
Save