mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-02-20 03:49:40 -06:00
Change the internal data type for cell contents to a binary type
Store the data of a DB cell in a QByteArray, i.e. a binary data type, instead of putting it in a QString, thus converting it to a UTF8 string. Rewrite the reading and writing of DB cells to correctly handle binary data containing 0x00 bytes. Change the edit dialog to actually do all the data checks etc. on a currently invisible QHexEdit widget instead of a QTextEdit. All these changes combined make it possible to actually store binary data without it being corrupted. You can for example import pictures now, export them and actually open the exported file. So this is an improvement.
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#define __EDITDIALOG_H__
|
||||
|
||||
#include <QDialog>
|
||||
class QHexEdit;
|
||||
|
||||
namespace Ui {
|
||||
class EditDialog;
|
||||
@@ -23,7 +24,7 @@ public:
|
||||
|
||||
public slots:
|
||||
virtual void reset();
|
||||
virtual void loadText(const QString& text, int row, int col);
|
||||
virtual void loadText(const QByteArray& data, int row, int col);
|
||||
|
||||
private slots:
|
||||
virtual void enableExport(bool enabled);
|
||||
@@ -37,10 +38,11 @@ private slots:
|
||||
|
||||
signals:
|
||||
void goingAway();
|
||||
void updateRecordText(int, int, const QString&);
|
||||
void updateRecordText(int, int, const QByteArray&);
|
||||
|
||||
private:
|
||||
Ui::EditDialog* ui;
|
||||
QHexEdit* hexEdit;
|
||||
int dataType;
|
||||
int dataSize;
|
||||
int curCol;
|
||||
|
||||
Reference in New Issue
Block a user