转换UTF8格式提交文件
This commit is contained in:
parent
f78bed60d3
commit
9238fe34ab
|
|
@ -92,11 +92,9 @@ INCLUDEPATH += ../../OSGFramework/include
|
||||||
INCLUDEPATH += ../../common
|
INCLUDEPATH += ../../common
|
||||||
|
|
||||||
CONFIG(debug, debug|release){
|
CONFIG(debug, debug|release){
|
||||||
LIBS += -L../../Bin -lConvertorManagerd
|
|
||||||
LIBS += -L../../Bin -lBaseFund
|
LIBS += -L../../Bin -lBaseFund
|
||||||
LIBS += -L../../Bin -lslfiod
|
LIBS += -L../../Bin -lslfiod
|
||||||
} else {
|
} else {
|
||||||
LIBS += -L../../Bin -lConvertorManager
|
|
||||||
LIBS += -L../../Bin -lBaseFun
|
LIBS += -L../../Bin -lBaseFun
|
||||||
LIBS += -L../../Bin -lslfio
|
LIBS += -L../../Bin -lslfio
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#include "dataslothelper.h"
|
#include "dataslothelper.h"
|
||||||
#include <QItemSelectionModel>
|
#include <QItemSelectionModel>
|
||||||
#include <QListIterator>
|
#include <QListIterator>
|
||||||
|
|
||||||
|
|
@ -28,22 +28,22 @@ DataSlotHelper * DataSlotHelper::instance()
|
||||||
void DataSlotHelper::movedUp(QTableWidget *table)
|
void DataSlotHelper::movedUp(QTableWidget *table)
|
||||||
{
|
{
|
||||||
bool moveUpMax=false;
|
bool moveUpMax=false;
|
||||||
//重置选择区域
|
//重置选择区域
|
||||||
resetRangeSelection(table);
|
resetRangeSelection(table);
|
||||||
m_sourceRowsData.clear();
|
m_sourceRowsData.clear();
|
||||||
m_descRowsData.clear();
|
m_descRowsData.clear();
|
||||||
//拾取表格数据
|
//拾取表格数据
|
||||||
pickTableRangeData(table,m_sourceRowsData);
|
pickTableRangeData(table,m_sourceRowsData);
|
||||||
//表格数据改变 isUp 是否向上,moveFixed是否到头固定模式
|
//表格数据改变 isUp 是否向上,moveFixed是否到头固定模式
|
||||||
tableSelectionRangeChange(table,true,moveUpMax);
|
tableSelectionRangeChange(table,true,moveUpMax);
|
||||||
if (moveUpMax)
|
if (moveUpMax)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
pickTableRangeData(table,m_descRowsData);
|
pickTableRangeData(table,m_descRowsData);
|
||||||
//交换移动原始数据和移动的目标数据
|
//交换移动原始数据和移动的目标数据
|
||||||
swapSelRowMoveRow(true);
|
swapSelRowMoveRow(true);
|
||||||
//刷新移动数据
|
//刷新移动数据
|
||||||
updateMoveRowData(table);
|
updateMoveRowData(table);
|
||||||
m_sourceRowsData.clear();
|
m_sourceRowsData.clear();
|
||||||
m_descRowsData.clear();
|
m_descRowsData.clear();
|
||||||
|
|
@ -68,7 +68,7 @@ void DataSlotHelper::movedDow(QTableWidget *table)
|
||||||
m_descRowsData.clear();
|
m_descRowsData.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
//表格数据改变 isUp 是否向上,moveFixed是否到头固定模式
|
//表格数据改变 isUp 是否向上,moveFixed是否到头固定模式
|
||||||
void DataSlotHelper::tableSelectionRangeChange(QTableWidget *table,bool isUp,bool &moveFixed)
|
void DataSlotHelper::tableSelectionRangeChange(QTableWidget *table,bool isUp,bool &moveFixed)
|
||||||
{
|
{
|
||||||
QList<QTableWidgetSelectionRange> selRanges=table->selectedRanges();
|
QList<QTableWidgetSelectionRange> selRanges=table->selectedRanges();
|
||||||
|
|
@ -219,7 +219,7 @@ void DataSlotHelper::megerRange(QList<QTableWidgetSelectionRange> &rangeLst,
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//选中移动范围
|
//选中移动范围
|
||||||
void DataSlotHelper::rangeMoveRow(int &beginRow,int &endRow,int rowCount,bool isUp,bool &moveFixed)
|
void DataSlotHelper::rangeMoveRow(int &beginRow,int &endRow,int rowCount,bool isUp,bool &moveFixed)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
@ -255,7 +255,7 @@ void DataSlotHelper::rangeMoveRow(int &beginRow,int &endRow,int rowCount,bool is
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//获取表格行数据
|
//获取表格行数据
|
||||||
QStringList DataSlotHelper::tableRowData(QTableWidget* table,int row)
|
QStringList DataSlotHelper::tableRowData(QTableWidget* table,int row)
|
||||||
{
|
{
|
||||||
QStringList rowData;
|
QStringList rowData;
|
||||||
|
|
@ -273,7 +273,7 @@ QStringList DataSlotHelper::tableRowData(QTableWidget* table,int row)
|
||||||
return rowData;
|
return rowData;
|
||||||
|
|
||||||
}
|
}
|
||||||
//拾取表格数据
|
//拾取表格数据
|
||||||
void DataSlotHelper::pickTableRangeData(QTableWidget* table,
|
void DataSlotHelper::pickTableRangeData(QTableWidget* table,
|
||||||
QList<PinkTableData> &rangeData)
|
QList<PinkTableData> &rangeData)
|
||||||
{
|
{
|
||||||
|
|
@ -302,7 +302,7 @@ void DataSlotHelper::pickTableRangeData(QTableWidget* table,
|
||||||
rangeData << PinkTableData(range,rgData);
|
rangeData << PinkTableData(range,rgData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//交换移动原始数据和移动的目标数据
|
//交换移动原始数据和移动的目标数据
|
||||||
void DataSlotHelper::swapSelRowMoveRow(bool isUp)
|
void DataSlotHelper::swapSelRowMoveRow(bool isUp)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
@ -327,15 +327,15 @@ void DataSlotHelper::swapSelRowMoveRow(bool isUp)
|
||||||
QList<QStringList> srcRowData;
|
QList<QStringList> srcRowData;
|
||||||
QList<QStringList> desRowData;
|
QList<QStringList> desRowData;
|
||||||
int desSize=0;
|
int desSize=0;
|
||||||
//目标与源进行交换
|
//目标与源进行交换
|
||||||
for (int i=0;i<sSize;i++)
|
for (int i=0;i<sSize;i++)
|
||||||
{
|
{
|
||||||
|
|
||||||
//源插入到目标
|
//源插入到目标
|
||||||
srcRange=sourceKeys.value(i);
|
srcRange=sourceKeys.value(i);
|
||||||
srcRowData=sourceValues.value(i);
|
srcRowData=sourceValues.value(i);
|
||||||
/////////////////////////////////////////////
|
/////////////////////////////////////////////
|
||||||
//目标插入到源
|
//目标插入到源
|
||||||
desRange=descKeys.value(i);
|
desRange=descKeys.value(i);
|
||||||
desRowData=descValues.value(i);
|
desRowData=descValues.value(i);
|
||||||
|
|
||||||
|
|
@ -352,7 +352,7 @@ void DataSlotHelper::swapSelRowMoveRow(bool isUp)
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
//重置数据行
|
//重置数据行
|
||||||
void DataSlotHelper::resetNewDaataRow(QList< QList<QStringList> > & restDataRow,bool isUp)
|
void DataSlotHelper::resetNewDaataRow(QList< QList<QStringList> > & restDataRow,bool isUp)
|
||||||
{
|
{
|
||||||
QList<QStringList> rangeRowData;
|
QList<QStringList> rangeRowData;
|
||||||
|
|
@ -390,7 +390,7 @@ void DataSlotHelper::resetNewDaataRow(QList< QList<QStringList> > & restDataRow,
|
||||||
restDataRow=result;
|
restDataRow=result;
|
||||||
|
|
||||||
}
|
}
|
||||||
//分离表格数据和范围
|
//分离表格数据和范围
|
||||||
void DataSlotHelper::pinkTableDataRanges(const QList<PinkTableData> &pinkData,
|
void DataSlotHelper::pinkTableDataRanges(const QList<PinkTableData> &pinkData,
|
||||||
QList<QTableWidgetSelectionRange> &ranges,QList< QList<QStringList> > &rowsData)
|
QList<QTableWidgetSelectionRange> &ranges,QList< QList<QStringList> > &rowsData)
|
||||||
{
|
{
|
||||||
|
|
@ -406,15 +406,15 @@ void DataSlotHelper::pinkTableDataRanges(const QList<PinkTableData> &pinkData,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//刷新移动数据
|
//刷新移动数据
|
||||||
void DataSlotHelper::updateMoveRowData(QTableWidget* table)
|
void DataSlotHelper::updateMoveRowData(QTableWidget* table)
|
||||||
{
|
{
|
||||||
//先目标再源
|
//先目标再源
|
||||||
updateRowsData(table,m_descRowsData);
|
updateRowsData(table,m_descRowsData);
|
||||||
updateRowsData(table,m_sourceRowsData);
|
updateRowsData(table,m_sourceRowsData);
|
||||||
|
|
||||||
}
|
}
|
||||||
//刷新移动数据
|
//刷新移动数据
|
||||||
void DataSlotHelper::updateRowsData(QTableWidget* table,
|
void DataSlotHelper::updateRowsData(QTableWidget* table,
|
||||||
const QList<PinkTableData> &data)
|
const QList<PinkTableData> &data)
|
||||||
{
|
{
|
||||||
|
|
@ -452,7 +452,7 @@ void DataSlotHelper::updateRowsData(QTableWidget* table,
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
//刷新表格视图数据
|
//刷新表格视图数据
|
||||||
void DataSlotHelper::updateTableView(QTableWidget *table,const QStringList &rowsData,int row)
|
void DataSlotHelper::updateTableView(QTableWidget *table,const QStringList &rowsData,int row)
|
||||||
{
|
{
|
||||||
if ( NULL == table)
|
if ( NULL == table)
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef DATASLOTHELPER_H
|
#ifndef DATASLOTHELPER_H
|
||||||
#define DATASLOTHELPER_H
|
#define DATASLOTHELPER_H
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
|
@ -25,37 +25,37 @@ public:
|
||||||
|
|
||||||
~DataSlotHelper();
|
~DataSlotHelper();
|
||||||
static DataSlotHelper *instance();
|
static DataSlotHelper *instance();
|
||||||
//向上移动
|
//向上移动
|
||||||
void movedUp(QTableWidget *table);
|
void movedUp(QTableWidget *table);
|
||||||
//向下移动
|
//向下移动
|
||||||
void movedDow(QTableWidget *table);
|
void movedDow(QTableWidget *table);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
//获取表格行数据
|
//获取表格行数据
|
||||||
QStringList tableRowData(QTableWidget* table,int row);
|
QStringList tableRowData(QTableWidget* table,int row);
|
||||||
//拾取表格数据
|
//拾取表格数据
|
||||||
void pickTableRangeData(QTableWidget* table
|
void pickTableRangeData(QTableWidget* table
|
||||||
,QList<PinkTableData> &rangeData);
|
,QList<PinkTableData> &rangeData);
|
||||||
//表格数据改变 isUp 是否向上,moveFixed是否到头固定模式
|
//表格数据改变 isUp 是否向上,moveFixed是否到头固定模式
|
||||||
void tableSelectionRangeChange(QTableWidget *table,bool isUp,bool &moveFixed);
|
void tableSelectionRangeChange(QTableWidget *table,bool isUp,bool &moveFixed);
|
||||||
//选中移动范围
|
//选中移动范围
|
||||||
void rangeMoveRow(int &beginRow,int &endRow,int rowCount,bool isUp,bool &moveFixed);
|
void rangeMoveRow(int &beginRow,int &endRow,int rowCount,bool isUp,bool &moveFixed);
|
||||||
//交换移动原始数据和移动的目标数据
|
//交换移动原始数据和移动的目标数据
|
||||||
void swapSelRowMoveRow(bool isUp);
|
void swapSelRowMoveRow(bool isUp);
|
||||||
//刷新移动数据
|
//刷新移动数据
|
||||||
void updateMoveRowData(QTableWidget* table);
|
void updateMoveRowData(QTableWidget* table);
|
||||||
//刷新行数据
|
//刷新行数据
|
||||||
void updateRowsData(QTableWidget* table,const QList<PinkTableData> &data);
|
void updateRowsData(QTableWidget* table,const QList<PinkTableData> &data);
|
||||||
//刷新表格视图数据
|
//刷新表格视图数据
|
||||||
void updateTableView(QTableWidget *table,const QStringList& rowsData,int row);
|
void updateTableView(QTableWidget *table,const QStringList& rowsData,int row);
|
||||||
//分离表格数据和范围
|
//分离表格数据和范围
|
||||||
void pinkTableDataRanges(const QList<PinkTableData> &pinkData,
|
void pinkTableDataRanges(const QList<PinkTableData> &pinkData,
|
||||||
QList<QTableWidgetSelectionRange> &ranges,QList< QList<QStringList> > &rowsData);
|
QList<QTableWidgetSelectionRange> &ranges,QList< QList<QStringList> > &rowsData);
|
||||||
//重置数据行
|
//重置数据行
|
||||||
void resetNewDaataRow(QList< QList<QStringList> > & restDataRow,bool isUp);
|
void resetNewDaataRow(QList< QList<QStringList> > & restDataRow,bool isUp);
|
||||||
//重置选择区域
|
//重置选择区域
|
||||||
void resetRangeSelection(QTableWidget* table);
|
void resetRangeSelection(QTableWidget* table);
|
||||||
//合并单选行
|
//合并单选行
|
||||||
void megerRange(QList<QTableWidgetSelectionRange> &rangeLst,const QList<QTableWidgetSelectionRange> &selRanges);
|
void megerRange(QList<QTableWidgetSelectionRange> &rangeLst,const QList<QTableWidgetSelectionRange> &selRanges);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
@ -68,9 +68,9 @@ explicit DataSlotHelper(QObject *parent=NULL);
|
||||||
private:
|
private:
|
||||||
static DataSlotHelper *p_helper;
|
static DataSlotHelper *p_helper;
|
||||||
GC m_gc;
|
GC m_gc;
|
||||||
//源行数据
|
//源行数据
|
||||||
QList<PinkTableData> m_sourceRowsData;
|
QList<PinkTableData> m_sourceRowsData;
|
||||||
//目标数据
|
//目标数据
|
||||||
QList<PinkTableData> m_descRowsData;
|
QList<PinkTableData> m_descRowsData;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user