Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
PosUpgradeManagementTool
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
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
xiaoqing.gu
PosUpgradeManagementTool
Commits
e5a41fca
Commit
e5a41fca
authored
Dec 22, 2017
by
xiaoqing.gu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加数据库信息配置文件
parent
9d3efcd4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
75 additions
and
10 deletions
+75
-10
PosForkPlan/PosForkPlan.pro.user
+4
-4
PosForkPlan/changedatabasedialog.cpp
+26
-5
PosForkPlan/changedatabasedialog.h
+1
-0
PosForkPlan/mainwindow.cpp
+44
-1
No files found.
PosForkPlan/PosForkPlan.pro.user
View file @
e5a41fca
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 3.5.1, 2017-12-21T1
0:57:59
. -->
<!-- Written by QtCreator 3.5.1, 2017-12-21T1
8:42:11
. -->
<qtcreator>
<qtcreator>
<data>
<data>
<variable>
EnvironmentId
</variable>
<variable>
EnvironmentId
</variable>
...
@@ -61,7 +61,7 @@
...
@@ -61,7 +61,7 @@
<value
type=
"QString"
key=
"ProjectExplorer.ProjectConfiguration.DefaultDisplayName"
>
Desktop Qt 5.5.1 MinGW 32bit
</value>
<value
type=
"QString"
key=
"ProjectExplorer.ProjectConfiguration.DefaultDisplayName"
>
Desktop Qt 5.5.1 MinGW 32bit
</value>
<value
type=
"QString"
key=
"ProjectExplorer.ProjectConfiguration.DisplayName"
>
Desktop Qt 5.5.1 MinGW 32bit
</value>
<value
type=
"QString"
key=
"ProjectExplorer.ProjectConfiguration.DisplayName"
>
Desktop Qt 5.5.1 MinGW 32bit
</value>
<value
type=
"QString"
key=
"ProjectExplorer.ProjectConfiguration.Id"
>
qt.55.win32_mingw492_kit
</value>
<value
type=
"QString"
key=
"ProjectExplorer.ProjectConfiguration.Id"
>
qt.55.win32_mingw492_kit
</value>
<value
type=
"int"
key=
"ProjectExplorer.Target.ActiveBuildConfiguration"
>
0
</value>
<value
type=
"int"
key=
"ProjectExplorer.Target.ActiveBuildConfiguration"
>
1
</value>
<value
type=
"int"
key=
"ProjectExplorer.Target.ActiveDeployConfiguration"
>
0
</value>
<value
type=
"int"
key=
"ProjectExplorer.Target.ActiveDeployConfiguration"
>
0
</value>
<value
type=
"int"
key=
"ProjectExplorer.Target.ActiveRunConfiguration"
>
0
</value>
<value
type=
"int"
key=
"ProjectExplorer.Target.ActiveRunConfiguration"
>
0
</value>
<valuemap
type=
"QVariantMap"
key=
"ProjectExplorer.Target.BuildConfiguration.0"
>
<valuemap
type=
"QVariantMap"
key=
"ProjectExplorer.Target.BuildConfiguration.0"
>
...
@@ -227,8 +227,8 @@
...
@@ -227,8 +227,8 @@
<value
type=
"int"
key=
"PE.EnvironmentAspect.Base"
>
2
</value>
<value
type=
"int"
key=
"PE.EnvironmentAspect.Base"
>
2
</value>
<valuelist
type=
"QVariantList"
key=
"PE.EnvironmentAspect.Changes"
/>
<valuelist
type=
"QVariantList"
key=
"PE.EnvironmentAspect.Changes"
/>
<value
type=
"QString"
key=
"ProjectExplorer.ProjectConfiguration.DefaultDisplayName"
>
PosForkPlan
</value>
<value
type=
"QString"
key=
"ProjectExplorer.ProjectConfiguration.DefaultDisplayName"
>
PosForkPlan
</value>
<value
type=
"QString"
key=
"ProjectExplorer.ProjectConfiguration.DisplayName"
></value>
<value
type=
"QString"
key=
"ProjectExplorer.ProjectConfiguration.DisplayName"
>
PosForkPlan2
</value>
<value
type=
"QString"
key=
"ProjectExplorer.ProjectConfiguration.Id"
>
Qt4ProjectManager.Qt4RunConfiguration:
D:/qtDemo
/PosForkPlan/PosForkPlan.pro
</value>
<value
type=
"QString"
key=
"ProjectExplorer.ProjectConfiguration.Id"
>
Qt4ProjectManager.Qt4RunConfiguration:
C:/Users/xiaoqing.gu/Documents/project
/PosForkPlan/PosForkPlan.pro
</value>
<value
type=
"QString"
key=
"Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments"
></value>
<value
type=
"QString"
key=
"Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments"
></value>
<value
type=
"QString"
key=
"Qt4ProjectManager.Qt4RunConfiguration.ProFile"
>
PosForkPlan.pro
</value>
<value
type=
"QString"
key=
"Qt4ProjectManager.Qt4RunConfiguration.ProFile"
>
PosForkPlan.pro
</value>
<value
type=
"bool"
key=
"Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix"
>
false
</value>
<value
type=
"bool"
key=
"Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix"
>
false
</value>
...
...
PosForkPlan/changedatabasedialog.cpp
View file @
e5a41fca
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
#include <database.h>
#include <database.h>
#include <QMessageBox>
#include <QMessageBox>
#include <QsLog.h>
#include <QsLog.h>
#include <QSettings>
/*
/*
...
@@ -20,10 +21,20 @@ ChangeDatabaseDialog::ChangeDatabaseDialog(QWidget *parent) :
...
@@ -20,10 +21,20 @@ ChangeDatabaseDialog::ChangeDatabaseDialog(QWidget *parent) :
ui
->
setupUi
(
this
);
ui
->
setupUi
(
this
);
this
->
setFixedSize
(
420
,
320
);
this
->
setFixedSize
(
420
,
320
);
this
->
setWindowTitle
(
"确认数据库"
);
this
->
setWindowTitle
(
"确认数据库"
);
ui
->
DatabaseAddressLe
->
setText
(
"115.159.110.221,9528"
);
ui
->
DatabaseNameLe
->
setText
(
"Freemud_PosUpgrade"
);
QSettings
*
setting
=
new
QSettings
(
qApp
->
applicationDirPath
()
+
"/config.ini"
,
QSettings
::
IniFormat
);
ui
->
UIDLe
->
setText
(
"waimaitest"
);
QString
db_address
=
setting
->
value
(
"config/address"
).
toString
();
ui
->
PWDLe
->
setText
(
"waimaitest@freemud"
);
QString
db_port
=
setting
->
value
(
"config/port"
).
toString
();
QString
db_server
=
db_address
+
","
+
db_port
;
QString
db_name
=
setting
->
value
(
"config/name"
).
toString
();
QString
db_user
=
setting
->
value
(
"config/user"
).
toString
();
QString
db_userpwd
=
setting
->
value
(
"config/userpwd"
).
toString
();
ui
->
DatabaseAddressLe
->
setText
(
db_server
);
ui
->
DatabaseNameLe
->
setText
(
db_name
);
ui
->
UIDLe
->
setText
(
db_user
);
ui
->
PWDLe
->
setText
(
db_userpwd
);
Qt
::
WindowFlags
flags
=
Qt
::
Dialog
;
Qt
::
WindowFlags
flags
=
Qt
::
Dialog
;
flags
|=
Qt
::
WindowCloseButtonHint
;
flags
|=
Qt
::
WindowCloseButtonHint
;
setWindowFlags
(
flags
);
setWindowFlags
(
flags
);
...
@@ -57,6 +68,16 @@ void ChangeDatabaseDialog::on_ConfirmBtn_clicked()
...
@@ -57,6 +68,16 @@ void ChangeDatabaseDialog::on_ConfirmBtn_clicked()
QString
databaseName
=
ui
->
DatabaseNameLe
->
text
();
QString
databaseName
=
ui
->
DatabaseNameLe
->
text
();
QString
uid
=
ui
->
UIDLe
->
text
();
QString
uid
=
ui
->
UIDLe
->
text
();
QString
pwd
=
ui
->
PWDLe
->
text
();
QString
pwd
=
ui
->
PWDLe
->
text
();
QSettings
*
setting
=
new
QSettings
(
qApp
->
applicationDirPath
()
+
"/config.ini"
,
QSettings
::
IniFormat
);
QString
server_address
=
server
.
section
(
','
,
0
,
0
);
QString
server_port
=
server
.
section
(
','
,
1
,
1
);
setting
->
setValue
(
"config/address"
,
server_address
);
setting
->
setValue
(
"config/port"
,
server_port
);
setting
->
setValue
(
"config/name"
,
databaseName
);
setting
->
setValue
(
"config/user"
,
uid
);
setting
->
setValue
(
"config/userpwd"
,
pwd
);
if
(
server
==
NULL
||
databaseName
==
NULL
||
uid
==
NULL
||
pwd
==
NULL
)
if
(
server
==
NULL
||
databaseName
==
NULL
||
uid
==
NULL
||
pwd
==
NULL
)
{
{
QMessageBox
::
warning
(
NULL
,
"警告"
,
"请输入数据库信息"
,
QMessageBox
::
Yes
,
QMessageBox
::
Yes
);
QMessageBox
::
warning
(
NULL
,
"警告"
,
"请输入数据库信息"
,
QMessageBox
::
Yes
,
QMessageBox
::
Yes
);
...
@@ -64,6 +85,7 @@ void ChangeDatabaseDialog::on_ConfirmBtn_clicked()
...
@@ -64,6 +85,7 @@ void ChangeDatabaseDialog::on_ConfirmBtn_clicked()
return
;
return
;
}
}
emit
sendMessage
(
server
,
databaseName
,
uid
,
pwd
);
emit
sendMessage
(
server
,
databaseName
,
uid
,
pwd
);
}
}
...
@@ -84,4 +106,3 @@ void ChangeDatabaseDialog::on_CancelBtn_clicked()
...
@@ -84,4 +106,3 @@ void ChangeDatabaseDialog::on_CancelBtn_clicked()
PosForkPlan/changedatabasedialog.h
View file @
e5a41fca
...
@@ -26,6 +26,7 @@ signals:
...
@@ -26,6 +26,7 @@ signals:
private
:
private
:
Ui
::
ChangeDatabaseDialog
*
ui
;
Ui
::
ChangeDatabaseDialog
*
ui
;
};
};
#endif // CHANGEDATABASEDIALOG_H
#endif // CHANGEDATABASEDIALOG_H
PosForkPlan/mainwindow.cpp
View file @
e5a41fca
...
@@ -17,6 +17,7 @@
...
@@ -17,6 +17,7 @@
#include <QAbstractItemView>
#include <QAbstractItemView>
#include <combobutton.h>
#include <combobutton.h>
#include <QsLog.h>
#include <QsLog.h>
#include <QHeaderView>
/*
/*
...
@@ -57,6 +58,7 @@ MainWindow::MainWindow(QWidget *parent) :
...
@@ -57,6 +58,7 @@ MainWindow::MainWindow(QWidget *parent) :
ui
->
setupUi
(
this
);
ui
->
setupUi
(
this
);
this
->
setFixedSize
(
850
,
790
);
this
->
setFixedSize
(
850
,
790
);
ui
->
tableView
->
hide
();
ui
->
tableView
->
hide
();
// ui->tableWidget->hide();
ui
->
PartInformationBtn
->
setEnabled
(
false
);
ui
->
PartInformationBtn
->
setEnabled
(
false
);
ui
->
ImplementBtn
->
setEnabled
(
false
);
ui
->
ImplementBtn
->
setEnabled
(
false
);
...
@@ -975,6 +977,12 @@ void MainWindow::on_CheckListBtn_clicked()
...
@@ -975,6 +977,12 @@ void MainWindow::on_CheckListBtn_clicked()
}
}
ui
->
tableView
->
setModel
(
model
);
ui
->
tableView
->
setModel
(
model
);
while
(
model
->
canFetchMore
())
{
model
->
fetchMore
();
}
int
rowCount
=
model
->
rowCount
();
int
rowCount
=
model
->
rowCount
();
int
columnCount
=
model
->
columnCount
();
int
columnCount
=
model
->
columnCount
();
...
@@ -1254,6 +1262,11 @@ void MainWindow::on_DeleteListBtn_clicked()
...
@@ -1254,6 +1262,11 @@ void MainWindow::on_DeleteListBtn_clicked()
}
}
ui
->
tableView
->
setModel
(
model1
);
ui
->
tableView
->
setModel
(
model1
);
while
(
model1
->
canFetchMore
())
{
model1
->
fetchMore
();
}
int
rowCount
=
model1
->
rowCount
();
int
rowCount
=
model1
->
rowCount
();
int
columnCount
=
model1
->
columnCount
();
int
columnCount
=
model1
->
columnCount
();
ui
->
tableWidget
->
setRowCount
(
rowCount
);
ui
->
tableWidget
->
setRowCount
(
rowCount
);
...
@@ -1466,11 +1479,16 @@ void MainWindow::on_FullInformationBtn_clicked()
...
@@ -1466,11 +1479,16 @@ void MainWindow::on_FullInformationBtn_clicked()
}
}
ui
->
tableView
->
setModel
(
model
);
ui
->
tableView
->
setModel
(
model
);
while
(
model
->
canFetchMore
())
{
model
->
fetchMore
();
}
int
rowCount
=
model
->
rowCount
();
int
rowCount
=
model
->
rowCount
();
int
columnCount
=
model
->
columnCount
();
int
columnCount
=
model
->
columnCount
();
ui
->
tableWidget
->
setRowCount
(
rowCount
);
ui
->
tableWidget
->
setRowCount
(
rowCount
);
ui
->
tableWidget
->
setColumnCount
(
columnCount
);
ui
->
tableWidget
->
setColumnCount
(
columnCount
);
ui
->
tableWidget
->
setHorizontalHeaderLabels
(
QStringList
()
<<
tr
(
"门店ID"
)
<<
tr
(
"
商户
编号"
)
<<
tr
(
"自增POS ID"
)
<<
tr
(
"Pos编号"
)
ui
->
tableWidget
->
setHorizontalHeaderLabels
(
QStringList
()
<<
tr
(
"门店ID"
)
<<
tr
(
"
门店
编号"
)
<<
tr
(
"自增POS ID"
)
<<
tr
(
"Pos编号"
)
<<
tr
(
"最后心跳时间"
)
<<
tr
(
"更新版本"
)
<<
tr
(
"更新状态"
)
<<
tr
(
"计划编号"
)
<<
tr
(
"可否使用"
)
<<
tr
(
"备忘录"
));
<<
tr
(
"最后心跳时间"
)
<<
tr
(
"更新版本"
)
<<
tr
(
"更新状态"
)
<<
tr
(
"计划编号"
)
<<
tr
(
"可否使用"
)
<<
tr
(
"备忘录"
));
int
i
=
0
,
j
=
0
;
int
i
=
0
,
j
=
0
;
...
@@ -1507,6 +1525,16 @@ void MainWindow::on_FullInformationBtn_clicked()
...
@@ -1507,6 +1525,16 @@ void MainWindow::on_FullInformationBtn_clicked()
// ui->tableWidget->setSelectionBehavior(QAbstractItemView::SelectRows);
// ui->tableWidget->setSelectionBehavior(QAbstractItemView::SelectRows);
ui
->
tableWidget
->
horizontalHeader
()
->
setDefaultAlignment
(
Qt
::
AlignLeft
);
ui
->
tableWidget
->
horizontalHeader
()
->
setDefaultAlignment
(
Qt
::
AlignLeft
);
ui
->
tableWidget
->
setEditTriggers
(
QAbstractItemView
::
NoEditTriggers
);
ui
->
tableWidget
->
setEditTriggers
(
QAbstractItemView
::
NoEditTriggers
);
/*设置点击表头可以进行排序*/
QHeaderView
*
headerGoods
=
ui
->
tableWidget
->
horizontalHeader
();
//SortIndicator为水平标题栏文字旁边的三角指示器
headerGoods
->
setSortIndicator
(
1
,
Qt
::
AscendingOrder
);
// headerGoods->setSortIndicator(2, Qt::AscendingOrder);
// headerGoods->setSortIndicator(3, Qt::AscendingOrder);
headerGoods
->
setSortIndicatorShown
(
true
);
// headerGoods->setClickable(true);
connect
(
headerGoods
,
SIGNAL
(
sectionClicked
(
int
)),
ui
->
tableWidget
,
SLOT
(
sortByColumn
(
int
)));
}
}
else
else
{
{
...
@@ -1926,6 +1954,11 @@ void MainWindow::on_PartInformationBtn_clicked()
...
@@ -1926,6 +1954,11 @@ void MainWindow::on_PartInformationBtn_clicked()
ui
->
tableView
->
setModel
(
model
);
ui
->
tableView
->
setModel
(
model
);
while
(
model
->
canFetchMore
())
{
model
->
fetchMore
();
}
int
rowCount
=
model
->
rowCount
();
int
rowCount
=
model
->
rowCount
();
int
columnCount
=
model
->
columnCount
();
int
columnCount
=
model
->
columnCount
();
ui
->
tableWidget
->
setRowCount
(
rowCount
);
ui
->
tableWidget
->
setRowCount
(
rowCount
);
...
@@ -1966,6 +1999,16 @@ void MainWindow::on_PartInformationBtn_clicked()
...
@@ -1966,6 +1999,16 @@ void MainWindow::on_PartInformationBtn_clicked()
// ui->tableWidget->setSelectionBehavior(QAbstractItemView::SelectRows);
// ui->tableWidget->setSelectionBehavior(QAbstractItemView::SelectRows);
ui
->
tableWidget
->
horizontalHeader
()
->
setDefaultAlignment
(
Qt
::
AlignLeft
);
ui
->
tableWidget
->
horizontalHeader
()
->
setDefaultAlignment
(
Qt
::
AlignLeft
);
ui
->
tableWidget
->
setEditTriggers
(
QAbstractItemView
::
NoEditTriggers
);
ui
->
tableWidget
->
setEditTriggers
(
QAbstractItemView
::
NoEditTriggers
);
/*设置点击表头可以进行排序*/
QHeaderView
*
headerGoods
=
ui
->
tableWidget
->
horizontalHeader
();
//SortIndicator为水平标题栏文字旁边的三角指示器
headerGoods
->
setSortIndicator
(
1
,
Qt
::
AscendingOrder
);
// headerGoods->setSortIndicator(2, Qt::AscendingOrder);
// headerGoods->setSortIndicator(3, Qt::AscendingOrder);
headerGoods
->
setSortIndicatorShown
(
true
);
// headerGoods->setClickable(true);
connect
(
headerGoods
,
SIGNAL
(
sectionClicked
(
int
)),
ui
->
tableWidget
,
SLOT
(
sortByColumn
(
int
)));
}
}
else
else
{
{
...
...
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