mirror of
https://github.com/Indy970/QtHPConnect
synced 2024-12-26 21:59:23 +01:00
External drag drop
This commit is contained in:
parent
b02e9f8cdf
commit
e773148a2b
10 changed files with 171 additions and 34 deletions
|
@ -314,7 +314,7 @@ void AbstractData::parseData() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void AbstractData::parseData(QDataStream& in) {
|
void AbstractData::parseData(QDataStream& in) {
|
||||||
qDebug()<<"AbstractData::parseData(DS)";
|
qDebug()<<"AbstractData::parseData(DataStream)";
|
||||||
|
|
||||||
in.setByteOrder(QDataStream::LittleEndian);
|
in.setByteOrder(QDataStream::LittleEndian);
|
||||||
qint8 c;
|
qint8 c;
|
||||||
|
@ -322,7 +322,6 @@ void AbstractData::parseData(QDataStream& in) {
|
||||||
uint length;
|
uint length;
|
||||||
length=16;
|
length=16;
|
||||||
|
|
||||||
qDebug()<<"Parsing Matrix";
|
|
||||||
in.startTransaction();
|
in.startTransaction();
|
||||||
while(!in.atEnd()) {
|
while(!in.atEnd()) {
|
||||||
in>>c;
|
in>>c;
|
||||||
|
@ -905,7 +904,7 @@ void Program::setProg(QString data_in) {
|
||||||
|
|
||||||
void Program::parseData() {
|
void Program::parseData() {
|
||||||
|
|
||||||
QTextCodec * codec = QTextCodec::codecForName("UTF8");
|
QTextCodec * codec = QTextCodec::codecForName("ISO 8859-1");
|
||||||
QByteArray a1;
|
QByteArray a1;
|
||||||
a1=getData();
|
a1=getData();
|
||||||
text = codec->toUnicode(a1);
|
text = codec->toUnicode(a1);
|
||||||
|
@ -915,7 +914,7 @@ void Program::parseData() {
|
||||||
|
|
||||||
void Program::parseData(QDataStream& in) {
|
void Program::parseData(QDataStream& in) {
|
||||||
|
|
||||||
QTextCodec * codec = QTextCodec::codecForName("UTF-16");
|
QTextCodec * codec = QTextCodec::codecForName("ISO 8859-1");
|
||||||
QByteArrayMatcher matcher;
|
QByteArrayMatcher matcher;
|
||||||
QByteArray search;
|
QByteArray search;
|
||||||
QByteArray phrase;
|
QByteArray phrase;
|
||||||
|
@ -1008,7 +1007,7 @@ void Notes::parseData() {
|
||||||
|
|
||||||
// quint16 len1,len2;
|
// quint16 len1,len2;
|
||||||
int formatstart;
|
int formatstart;
|
||||||
QTextCodec * codec = QTextCodec::codecForName("UTF-16LE");
|
QTextCodec * codec = QTextCodec::codecForName("UTF-8");
|
||||||
|
|
||||||
QByteArray a1,a3;
|
QByteArray a1,a3;
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
#include <global.h>
|
#include <global.h>
|
||||||
#include <cntfilesystemmodel.h>
|
#include <cntfilesystemmodel.h>
|
||||||
#include <QMimeData>
|
#include <QMimeData>
|
||||||
|
#include <QList>
|
||||||
#include <QStringListModel>
|
#include <QStringListModel>
|
||||||
|
|
||||||
#include <hp_mditexteditor.h>
|
#include <hp_mditexteditor.h>
|
||||||
|
@ -83,6 +84,8 @@ QMimeData* contentFileSystemModel::mimeData(const QModelIndexList &indexes) cons
|
||||||
|
|
||||||
qDebug()<<"contentFileSystemModel::mimeData";
|
qDebug()<<"contentFileSystemModel::mimeData";
|
||||||
|
|
||||||
|
foreach(index,indexes) {
|
||||||
|
|
||||||
index=indexes.first();
|
index=indexes.first();
|
||||||
// qDebug()<<index.data(Qt::DisplayRole);
|
// qDebug()<<index.data(Qt::DisplayRole);
|
||||||
// QString data;
|
// QString data;
|
||||||
|
@ -108,6 +111,7 @@ QMimeData* contentFileSystemModel::mimeData(const QModelIndexList &indexes) cons
|
||||||
}
|
}
|
||||||
mimeDataPtr->setText(info.baseName());
|
mimeDataPtr->setText(info.baseName());
|
||||||
|
|
||||||
|
|
||||||
switch (filedata.type) {
|
switch (filedata.type) {
|
||||||
|
|
||||||
case HP_PROG:
|
case HP_PROG:
|
||||||
|
@ -130,6 +134,20 @@ QMimeData* contentFileSystemModel::mimeData(const QModelIndexList &indexes) cons
|
||||||
}
|
}
|
||||||
|
|
||||||
file.close();
|
file.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
//Allow copy to external file managers
|
||||||
|
QList<QUrl> urls;
|
||||||
|
QFileInfo info;
|
||||||
|
QUrl url;
|
||||||
|
foreach(index,indexes) {
|
||||||
|
info = contentFileSystemModel::fileInfo(index);
|
||||||
|
|
||||||
|
url = QUrl::fromLocalFile(info.absoluteFilePath());
|
||||||
|
|
||||||
|
urls.append(url);
|
||||||
|
}
|
||||||
|
mimeDataPtr->setUrls(urls);
|
||||||
|
|
||||||
return mimeDataPtr;
|
return mimeDataPtr;
|
||||||
}
|
}
|
||||||
|
@ -154,7 +172,18 @@ Qt::ItemFlags contentFileSystemModel::flags(const QModelIndex &index) const
|
||||||
//Allow drop in location
|
//Allow drop in location
|
||||||
bool contentFileSystemModel::canDropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) const
|
bool contentFileSystemModel::canDropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) const
|
||||||
{
|
{
|
||||||
return true;
|
|
||||||
|
qDebug()<<data->formats();
|
||||||
|
|
||||||
|
if (data->hasUrls()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (data->hasText()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Process the drop action
|
//Process the drop action
|
||||||
|
@ -184,6 +213,29 @@ bool contentFileSystemModel::dropMimeData(const QMimeData* md_data, Qt::DropActi
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Check for external file drop
|
||||||
|
if (md_data->hasUrls()) {
|
||||||
|
|
||||||
|
QString name = md_data->text();
|
||||||
|
QList<QUrl> urls = md_data->urls();
|
||||||
|
QUrl url;
|
||||||
|
QString filefrom;
|
||||||
|
QString fileto;
|
||||||
|
|
||||||
|
foreach(url,urls) {
|
||||||
|
filefrom=url.toLocalFile();
|
||||||
|
QFileInfo fileinfo(filefrom);
|
||||||
|
fileto=path+"/"+url.fileName();
|
||||||
|
if(isFileType(fileinfo)) {
|
||||||
|
//consider check to limit unusual file types
|
||||||
|
QFile::copy(filefrom,fileto);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
//rework
|
||||||
QByteArray data_in;
|
QByteArray data_in;
|
||||||
QByteArray typeary;
|
QByteArray typeary;
|
||||||
QString name = md_data->text();
|
QString name = md_data->text();
|
||||||
|
@ -198,7 +250,6 @@ bool contentFileSystemModel::dropMimeData(const QMimeData* md_data, Qt::DropActi
|
||||||
qDebug()<<data_in;
|
qDebug()<<data_in;
|
||||||
qDebug()<<fileinfo;
|
qDebug()<<fileinfo;
|
||||||
|
|
||||||
|
|
||||||
// QDataStream stream(&encodedData, QIODevice::ReadOnly);
|
// QDataStream stream(&encodedData, QIODevice::ReadOnly);
|
||||||
|
|
||||||
if (writeFile(fileinfo,data_in)>-1)
|
if (writeFile(fileinfo,data_in)>-1)
|
||||||
|
@ -305,6 +356,8 @@ AbstractData * contentFileSystemModel::readFile(QFileInfo fileinfo) const {
|
||||||
|
|
||||||
if (file.open(QIODevice::ReadOnly),QFileDevice::AutoCloseHandle) {
|
if (file.open(QIODevice::ReadOnly),QFileDevice::AutoCloseHandle) {
|
||||||
QDataStream in(&file);
|
QDataStream in(&file);
|
||||||
|
// QTextCodec *codec = QTextCodec::codecForName("UTF-16");
|
||||||
|
// in.setCodec(codec);
|
||||||
in.setByteOrder(QDataStream::LittleEndian);
|
in.setByteOrder(QDataStream::LittleEndian);
|
||||||
|
|
||||||
filedata=getFileType(fileinfo);
|
filedata=getFileType(fileinfo);
|
||||||
|
@ -317,6 +370,12 @@ AbstractData * contentFileSystemModel::readFile(QFileInfo fileinfo) const {
|
||||||
data->parseData(in);
|
data->parseData(in);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case HP_NOTE: {
|
||||||
|
qDebug()<<"HP_NOTE";
|
||||||
|
data = new Notes(filedata.filename, HP_NOTE, QStringLiteral(""));
|
||||||
|
data->parseData(in);
|
||||||
|
}
|
||||||
|
break;
|
||||||
default: ;
|
default: ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -332,10 +391,10 @@ int contentFileSystemModel::writeFile(QFileInfo fileinfo, QByteArray data_in) co
|
||||||
QFile file(fileinfo.absoluteFilePath());
|
QFile file(fileinfo.absoluteFilePath());
|
||||||
|
|
||||||
if (file.open(QIODevice::ReadWrite)) {
|
if (file.open(QIODevice::ReadWrite)) {
|
||||||
QTextStream out(&file);
|
QDataStream out(&file);
|
||||||
QTextCodec *codec = QTextCodec::codecForName("UTF-16");
|
// QTextCodec *codec = QTextCodec::codecForName("UTF-8");
|
||||||
out.setCodec(codec);
|
// out.setCodec(codec);
|
||||||
// out.setByteOrder(QDataStream::LittleEndian);
|
out.setByteOrder(QDataStream::LittleEndian);
|
||||||
|
|
||||||
// quint8 c;
|
// quint8 c;
|
||||||
// for (int i =0 ;i< data_in.length();i++)
|
// for (int i =0 ;i< data_in.length();i++)
|
||||||
|
@ -384,36 +443,26 @@ bool contentFileSystemModel::createNewProgram(QMdiArea * mdiwin, QString filenam
|
||||||
QDir dir(path);
|
QDir dir(path);
|
||||||
QFileInfo fileinfo(dir,filename+"."+getFileType(HP_PROG));
|
QFileInfo fileinfo(dir,filename+"."+getFileType(HP_PROG));
|
||||||
|
|
||||||
/*
|
|
||||||
QFile file(fileinfo.absoluteFilePath());
|
|
||||||
|
|
||||||
if (file.open(QIODevice::WriteOnly)) {
|
|
||||||
|
|
||||||
QTextStream out(&file);
|
|
||||||
out << "" << endl;
|
|
||||||
} else {
|
|
||||||
qWarning()<<tr("Could not open file");
|
|
||||||
}
|
|
||||||
|
|
||||||
file.close();
|
|
||||||
*/
|
|
||||||
qDebug()<<"Create new program pressed";
|
qDebug()<<"Create new program pressed";
|
||||||
return openFile(mdiwin,fileinfo);
|
return openFile(mdiwin,fileinfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
//create a new note file
|
//create a new note file
|
||||||
bool contentFileSystemModel::createNewNote(QMdiArea * mdiwin,QString foldername) {
|
bool contentFileSystemModel::createNewNote(QMdiArea * mdiwin,QString filename) {
|
||||||
|
|
||||||
QSettings appSettings("IRGP","QtHPconnect");
|
QSettings appSettings("IRGP","QtHPconnect");
|
||||||
QString path=appSettings.value("contentPath").toString();
|
QString path=appSettings.value("contentPath").toString();
|
||||||
|
QDir dir(path);
|
||||||
|
QFileInfo fileinfo(dir,filename+"."+getFileType(HP_NOTE));
|
||||||
|
|
||||||
qDebug()<<"Create new note pressed";
|
qDebug()<<"Create new program pressed";
|
||||||
return false;
|
return openFile(mdiwin,fileinfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
//return the file type
|
//return the file type
|
||||||
hp_DataStruct contentFileSystemModel::getFileType(QFileInfo info) const {
|
hp_DataStruct contentFileSystemModel::getFileType(QFileInfo info) const {
|
||||||
hp_DataStruct filedata;
|
hp_DataStruct filedata;
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
QString suffix;
|
QString suffix;
|
||||||
hp_DataType type=HP_MAIN;
|
hp_DataType type=HP_MAIN;
|
||||||
|
@ -431,6 +480,21 @@ hp_DataStruct contentFileSystemModel::getFileType(QFileInfo info) const {
|
||||||
return filedata;
|
return filedata;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//return the file type
|
||||||
|
bool contentFileSystemModel::isFileType(QFileInfo info) const {
|
||||||
|
hp_DataStruct filedata;
|
||||||
|
|
||||||
|
int i;
|
||||||
|
QString suffix;
|
||||||
|
suffix=info.completeSuffix();
|
||||||
|
for (i=0;i<FILE_TYPE;i++) {
|
||||||
|
if (suffix==file_type[i])
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
//return the file type suffix
|
//return the file type suffix
|
||||||
QString contentFileSystemModel::getFileType(hp_DataType type) const {
|
QString contentFileSystemModel::getFileType(hp_DataType type) const {
|
||||||
int i;
|
int i;
|
||||||
|
|
|
@ -21,10 +21,11 @@
|
||||||
hp_MdiLogWindow::hp_MdiLogWindow(QWidget * parent)
|
hp_MdiLogWindow::hp_MdiLogWindow(QWidget * parent)
|
||||||
:hp_MdiWindow(parent)
|
:hp_MdiWindow(parent)
|
||||||
{
|
{
|
||||||
setMinimumSize(500,400);
|
setMinimumSize(200,200);
|
||||||
setMaximumSize(1000,1000);
|
setMaximumSize(1000,1000);
|
||||||
setSizePolicy(QSizePolicy::Ignored,QSizePolicy::Ignored);
|
setSizePolicy(QSizePolicy::Ignored,QSizePolicy::Ignored);
|
||||||
setup();
|
setup();
|
||||||
|
resize(500,400);
|
||||||
}
|
}
|
||||||
|
|
||||||
void hp_MdiLogWindow::setup() {
|
void hp_MdiLogWindow::setup() {
|
||||||
|
|
|
@ -21,6 +21,9 @@
|
||||||
#include <hptreeitem.h>
|
#include <hptreeitem.h>
|
||||||
#include <hpdata.h>
|
#include <hpdata.h>
|
||||||
#include <abstractdata.h>
|
#include <abstractdata.h>
|
||||||
|
#include <QBoxLayout>
|
||||||
|
#include <QToolBar>
|
||||||
|
#include <QToolButton>
|
||||||
|
|
||||||
//Called by the calculator Window
|
//Called by the calculator Window
|
||||||
hp_mdiTextEdit::hp_mdiTextEdit(QWidget * parent,hpTreeItem * treeItem, AbstractData * calcData)
|
hp_mdiTextEdit::hp_mdiTextEdit(QWidget * parent,hpTreeItem * treeItem, AbstractData * calcData)
|
||||||
|
@ -28,7 +31,7 @@ hp_mdiTextEdit::hp_mdiTextEdit(QWidget * parent,hpTreeItem * treeItem, AbstractD
|
||||||
{
|
{
|
||||||
setMinimumSize(200,200);
|
setMinimumSize(200,200);
|
||||||
setMaximumSize(1000,1000);
|
setMaximumSize(1000,1000);
|
||||||
setSizePolicy(QSizePolicy::Ignored,QSizePolicy::Ignored);
|
setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding);
|
||||||
|
|
||||||
qDebug()<<"hp_mdiTextEdit::hp_mdiTextEdit 1";
|
qDebug()<<"hp_mdiTextEdit::hp_mdiTextEdit 1";
|
||||||
hptreeitem=treeItem;
|
hptreeitem=treeItem;
|
||||||
|
@ -51,7 +54,7 @@ hp_mdiTextEdit::hp_mdiTextEdit(QWidget * parent, QFileInfo filedata, AbstractDat
|
||||||
qDebug()<<"hp_mdiTextEdit::hp_mdiTextEdit 2";
|
qDebug()<<"hp_mdiTextEdit::hp_mdiTextEdit 2";
|
||||||
setMinimumSize(200,200);
|
setMinimumSize(200,200);
|
||||||
setMaximumSize(1000,1000);
|
setMaximumSize(1000,1000);
|
||||||
setSizePolicy(QSizePolicy::Ignored,QSizePolicy::Ignored);
|
// setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding);
|
||||||
calculator=QStringLiteral("Content: ");
|
calculator=QStringLiteral("Content: ");
|
||||||
content=true;
|
content=true;
|
||||||
hptreeitem=nullptr;
|
hptreeitem=nullptr;
|
||||||
|
@ -61,6 +64,7 @@ hp_mdiTextEdit::hp_mdiTextEdit(QWidget * parent, QFileInfo filedata, AbstractDat
|
||||||
type=calcData->getType();
|
type=calcData->getType();
|
||||||
setup();
|
setup();
|
||||||
setWindowTitle(calculator+filename);
|
setWindowTitle(calculator+filename);
|
||||||
|
resize(450,350);
|
||||||
}
|
}
|
||||||
|
|
||||||
void hp_mdiTextEdit::setup() {
|
void hp_mdiTextEdit::setup() {
|
||||||
|
@ -92,7 +96,41 @@ void hp_mdiTextEdit::setup() {
|
||||||
else {
|
else {
|
||||||
qDebug()<<"hp_mdiTextEdit::setup - Data Null";
|
qDebug()<<"hp_mdiTextEdit::setup - Data Null";
|
||||||
}
|
}
|
||||||
setWidget(textEdit);
|
|
||||||
|
QIcon save(":/icons/save_22x22.png");
|
||||||
|
QAction * actionSave= new QAction(save,"Save",this);
|
||||||
|
|
||||||
|
QWidget * top = new QWidget();
|
||||||
|
QBoxLayout * layout = new QVBoxLayout();
|
||||||
|
layout->setContentsMargins(0, 0, 0, 0);
|
||||||
|
layout->setSpacing(0);
|
||||||
|
top->setLayout(layout);
|
||||||
|
|
||||||
|
QToolBar * toolbar = new QToolBar("Save");
|
||||||
|
toolbar->addAction(actionSave);
|
||||||
|
|
||||||
|
QToolButton *saveButton=new QToolButton();
|
||||||
|
QMenu * menu = new QMenu(saveButton);
|
||||||
|
menu->addAction(actionSave);
|
||||||
|
layout->setMenuBar(menu);
|
||||||
|
// layout->addWidget(toolbar);
|
||||||
|
// QSizePolicy sizePolicy1(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||||
|
// sizePolicy1.setHorizontalStretch(0);
|
||||||
|
// sizePolicy1.setVerticalStretch(0);
|
||||||
|
// sizePolicy1.setHeightForWidth(textEdit->sizePolicy().hasHeightForWidth());
|
||||||
|
// textEdit->setSizePolicy(sizePolicy1);
|
||||||
|
// layout->setSizeConstraint(QLayout::SetNoConstraint);
|
||||||
|
|
||||||
|
layout->addWidget(textEdit);
|
||||||
|
setWidget(top);
|
||||||
|
|
||||||
|
connect(actionSave,SIGNAL(triggered()),this,SLOT(eventSave()));
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
void hp_mdiTextEdit::eventSave(){
|
||||||
|
save();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool hp_mdiTextEdit::save(){
|
bool hp_mdiTextEdit::save(){
|
||||||
|
@ -147,7 +185,6 @@ bool hp_mdiTextEdit::maybeSave()
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void hp_mdiTextEdit::show() {
|
void hp_mdiTextEdit::show() {
|
||||||
|
|
||||||
if (textEdit)
|
if (textEdit)
|
||||||
|
|
|
@ -17,6 +17,10 @@
|
||||||
|
|
||||||
#include "hp_mdiwindow.h"
|
#include "hp_mdiwindow.h"
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
#include <QMenu>
|
||||||
|
#include <QToolBar>
|
||||||
|
#include <QToolButton>
|
||||||
|
#include <QBoxLayout>
|
||||||
|
|
||||||
hp_MdiWindow::hp_MdiWindow(QWidget * parent)
|
hp_MdiWindow::hp_MdiWindow(QWidget * parent)
|
||||||
:QMdiSubWindow(parent)
|
:QMdiSubWindow(parent)
|
||||||
|
@ -32,6 +36,10 @@ void hp_MdiWindow::setup() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void hp_MdiWindow::eventSave() {
|
||||||
|
qDebug()<<"Save pressed";
|
||||||
|
}
|
||||||
|
|
||||||
bool hp_MdiWindow::save() {
|
bool hp_MdiWindow::save() {
|
||||||
|
|
||||||
qDebug()<<"hp_MdiWindow::save";
|
qDebug()<<"hp_MdiWindow::save";
|
||||||
|
|
|
@ -29,7 +29,30 @@
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
<widget class="QToolBar" name="toolBar">
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>toolBar</string>
|
||||||
|
</property>
|
||||||
|
<attribute name="toolBarArea">
|
||||||
|
<enum>TopToolBarArea</enum>
|
||||||
|
</attribute>
|
||||||
|
<attribute name="toolBarBreak">
|
||||||
|
<bool>false</bool>
|
||||||
|
</attribute>
|
||||||
|
<addaction name="actionSave"/>
|
||||||
|
</widget>
|
||||||
|
<action name="actionSave">
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="qthpconnect.qrc">
|
||||||
|
<normaloff>:/icons/save_22x22.png</normaloff>:/icons/save_22x22.png</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Save</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
</widget>
|
</widget>
|
||||||
<resources/>
|
<resources>
|
||||||
|
<include location="qthpconnect.qrc"/>
|
||||||
|
</resources>
|
||||||
<connections/>
|
<connections/>
|
||||||
</ui>
|
</ui>
|
||||||
|
|
|
@ -44,6 +44,7 @@ public:
|
||||||
void deleteFile(QModelIndex &index);
|
void deleteFile(QModelIndex &index);
|
||||||
void renameFile(QModelIndex &index, QString newName);
|
void renameFile(QModelIndex &index, QString newName);
|
||||||
hp_DataStruct getFileType(QFileInfo info) const;
|
hp_DataStruct getFileType(QFileInfo info) const;
|
||||||
|
bool isFileType(QFileInfo info) const;
|
||||||
QString getFileType(hp_DataType) const;
|
QString getFileType(hp_DataType) const;
|
||||||
AbstractData * readFile(QFileInfo fileinfo) const;
|
AbstractData * readFile(QFileInfo fileinfo) const;
|
||||||
int writeFile(QFileInfo fileinfo, QByteArray data_in) const;
|
int writeFile(QFileInfo fileinfo, QByteArray data_in) const;
|
||||||
|
|
|
@ -62,6 +62,7 @@ public:
|
||||||
signals:
|
signals:
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
void eventSave();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -39,6 +39,9 @@ public:
|
||||||
void show();
|
void show();
|
||||||
~hp_MdiWindow();
|
~hp_MdiWindow();
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void eventSave();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // HP_MDIWINDOW_H
|
#endif // HP_MDIWINDOW_H
|
||||||
|
|
|
@ -27,7 +27,7 @@ textEditor::textEditor(QWidget *parent) :
|
||||||
QSettings appSettings("IRGP","QtHPconnect");
|
QSettings appSettings("IRGP","QtHPconnect");
|
||||||
wParent = parent;
|
wParent = parent;
|
||||||
setAttribute(Qt::WA_DeleteOnClose);
|
setAttribute(Qt::WA_DeleteOnClose);
|
||||||
setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding);
|
// setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding);
|
||||||
isUntitled = true;
|
isUntitled = true;
|
||||||
|
|
||||||
defaultPath=QDir(appSettings.value("contentPath").toString());
|
defaultPath=QDir(appSettings.value("contentPath").toString());
|
||||||
|
|
Loading…
Reference in a new issue