Giter VIP home page Giter VIP logo

qhexedit2's People

Contributors

dermalog avatar fferri avatar ktrace avatar lancos avatar ljhcage avatar moutarde avatar revolter avatar simsys avatar sithlord48 avatar swt2c avatar takeshixx avatar thinksj avatar vowstar avatar yassermalaika avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

qhexedit2's Issues

why use the vitural void setFont?

Thanks for you great job. I am learning your code. And why do you use virtual void setFont(const QFont &font); defined in qhexedit.h? It is really weird for me, I understand that QWidget has a function with the same name, and QAbstractScrollArea derived from QWidget, so you just override it? But why virtual?

Definitiion of QHexEdit properties

It would be great to include the following get/set functions also in the definition of Q_PROPERTY, so they become designable in QT Designer when using the QHexEditor as a QT plugin:

/*! Switch the address area on or off.
  \param addressArea true (show it), false (hide it).
  */
void setAddressArea(bool addressArea);

/*! Set the minimum width of the address area.
  \param addressWidth Width in characters.
  */
void setAddressWidth(int addressWidth);

/*! Switch the ascii area on or off.
  \param asciiArea true (show it), false (hide it).
  */
void setAsciiArea(bool asciiArea);

/*! Switch the highlighting feature on or of.
  \param mode true (show it), false (hide it).
  */
void setHighlighting(bool mode);

Kind regards

Hauke

Copy-Paste support

The Ostinato project (http://ostinato.org) uses qhexedit2 to let users enter 
packet contents as a hexdump.

We have received a request to support copy-paste with this widget 
(http://groups.google.com/group/ostinato/browse_thread/thread/c65f2933238cf5b3) 
and hence are raising this enhancement request

Original issue reported on code.google.com by [email protected] on 26 Apr 2011 at 3:36

ascii text editing

It would be nice to be able to edit also the ascii #text in the right area, not only the plain hex values.

GUI Polishing

1. Line 302 "QHexEdit" instead of "SDI"
2. Line 287 Insert Timout 2000
3. Line 283 Set MinimumWidth to 90

Original issue reported on code.google.com by [email protected] on 30 Jan 2012 at 3:52

setData() steals focus

What steps will reproduce the problem?
1. Call setData()
2. You focus has been stolen!

What is the expected output? What do you see instead?
I'd like to keep the focus, when using a spinbox for array size management it 
forces me to click at spinbox after every character I enter.

What version of the product are you using? On what operating system?
0.5.4 Linux/Windows/OSX

Please provide any additional information below.

I fixed it by commenting setFocus(); (qhexedit_p.cpp:52) But I think a better 
way would be to make it optional.

Original issue reported on code.google.com by [email protected] on 5 Oct 2011 at 10:22

Memory usage

http://qt-project.org/doc/qt-4.8/qfile.html#map


Original issue reported on code.google.com by [email protected] on 13 Mar 2012 at 7:25

How to Insert some text before hex editing

Thanks for the awesome hex editor, but I have so many messages and those messages have so many bytes. How can I display those many messages and their corresponding bytes in your hex editor.
For Ex:
Msg_1
0000| 12 54 65 48 78 | //Ascii Area
...........................................
Msg_2
0000| 54 65 98 45 87 | //Ascii Area
...........................................

Please help me in this regard.

How to Insert some text before hex editing

Following previous issue:
Thanks for your reply. You have done an awesome job on this. I have already tried that but QLabel is getting overridden into the hex texts. Can you please tell how I will move the hex text to the next line of QLabel. It will really help me a lot.
to

Improve the App: Warn before losing user data

The editor should warn a user, when they

  • try to close the editor with unsaved, changed content
  • load new files and they loose changed content

This feature should fit to the enhanced multi file editor functionality.

Leak memory issue

Hi,
I want to say thank you for great job, for save my time :), this is widget I need
I just use your source in my project and when debug I discover one leak memory issue

QHexEdit::QHexEdit(QWidget *parent) : QAbstractScrollArea(parent)
{
.....
_chunks = new Chunks();
....
}

Chunks::Chunks()
{
QBuffer *buf = new QBuffer();
...
}

I have fixed it and attached here,
Please check

Thank you again for your great job
fix_mem_leak.zip

Please bump the library version when introducing incompatible API changes

For packaging downstream in distributions it is important that the library version is updated when the API changes, otherwise dependent packages aren't rebuilt and can misbehave in various ways - even just refuse to start with a segfault.

The latest version 0.8.0 includes incompatible changes. Could you please update the library version accordingly?

Error in example (function saveFile())

In Example saveFile() function:

file.open(QFile::WriteOnly | QFile::Text)

causes errors while saving (/n translated to /r/n);

correct way:

file.open(QFile::WriteOnly | QFile::Truncate)

Original issue reported on code.google.com by [email protected] on 6 Jun 2013 at 4:28

Qt 5 Compatibility

QHexEdit would not compile with Qt 5.

I created a patch that compiles with Qt 5.2 and with Qt 4.8.

Tested on OS X 10.9 (Mavericks)

Note about Qt 4.8:
Qt 4.8 is not supported on OS X 10.9. I still managed to compile. And I could 
even run the example application. But it responded very slow when I was 
selecting bytes in the hex view.

Note about PyQt:
I didn't uptdate the part for PyQt. Since I'm not familiar with PyQt and sip, 
I'm not sure if I'll manage to do that. But I'm interested in using QHexEdit in 
PyQt 5 myself. So if I'll have some time I'll try to wrap my head around this 
stuff.

Original issue reported on code.google.com by [email protected] on 31 Dec 2013 at 12:40

Attachments:

[ISSUE]

Dynamic changing chars in line count (now hardcoded).


Original issue reported on code.google.com by [email protected] on 21 Jan 2012 at 4:58

No copyright and licensing statement

The inclusion of the GNU LGPL v2.1 in the license.txt file under the src directory suggests that the author or authors wish to make this code available for use under the terms of that license. However, without an explicit statement to that effect, it is not legally permissible for me to use this code under those terms. If the intent is to release this code under the LGPL, please add a statement of copyright and licensing to the library.

Editing behaves strange when not all options are set.

When using the QHexEdit widget without calling:

setAddressArea(true);
setAsciiArea(true);
setHighlighting(true);
setOverwriteMode(false);
setReadOnly(false);
setAddressWidth(8);

the cursor jumps back to the first column sometimes when in inserting mode and pressing "2" several times.

When these functions are called, the behaviour was ok.

It looks like some internal variables are not initialized correctly within the constructor but only if these functions are called.

Tested with QT5.5, Linux Ubuntu 14.04.

Cursor position after deleting last byte

First off, thanks so much for coding this. It has saved me a bunch of time and I still couldn't come close to having all the features and documentation of yours 😄

I noticed one small bug however. If you place your cursor at the end of the data and press backspace to delete the byte, the cursor moves back 1 spot in front of the new last byte. Happens for both overwrite mode and insert mode.

In the else section of the backspace event handler, I made these changes...

else
            {

                _bPosCurrent -= 1;
                if (_overwriteMode)
                {
                    if(dataAt(_bPosCurrent+1, 1) == QByteArray::fromHex("00"))
                        replace(_bPosCurrent, char(0));
                    else
                    {
                        replace(_bPosCurrent+1, char(0));
                        _bPosCurrent+=1;
                    }
                }
                else
                    remove(_bPosCurrent, 1);

                if(_chunks->size() != _bPosCurrent)
                    _bPosCurrent -= 1;
                setCursorPosition(2 * _bPosCurrent);
                resetSelection(2 * _bPosCurrent);
            }

While it's still not exactly what probably should be done, this seemed to fix it for now.

Link error using sip on VS2015 and Windows 8.1

I am newbie to use PyQT5.6 and SIP-4.18, python3.5.(OS is Windows8.1)
I am currently trying to import “QHexEdit” in my python project.
But I cannot import the “QHexEdit” because of linking problem.
I was trying to solve this adding “Additional Library Directories” of VS2015
but not working.

Build process and library path setup screen of was attached.

Build error summary is shown as below lines.

running install
running build
running build_ext

building ‘qhexedit’ extension

sipqhexeditcmodule.cpp

sipqhexeditQHexEdit.cpp
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:C:\Python35\libs /LIBPATH:C:\Python35\PCbuild\amd64 “/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB\amd64” “/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\LIB\amd64” “/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.10240.0\ucrt\x64” “/LIBPATH:C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\lib\um\x64” “/LIBPATH:C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x64” Qt5Core.lib Qt5Gui.lib Qt5Widget.lib qhexedit.lib /EXPORT:PyInit_qhexedit build\temp.win-amd64-3.5\Release\build\temp.win-amd64-3.5\Release\sipqhexeditcmodule.obj build\temp.win-amd64-3.5\Release\build\temp.win-amd64-3.5\Release\sipqhexeditQHexEdit.obj /OUT:build\lib.win-amd64-3.5\qhexedit.cp35-win_amd64.pyd /IMPLIB:build\temp.win-amd64-3.5\Release\build\temp.win-amd64-3.5\Release\qhexedit.cp35-win_amd64.lib
LINK : fatal error LNK1181: cannot open input file ‘Qt5Core.lib’
error: command ‘C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\link.exe’ failed with exit status 1181

last_state
libpath

Hiding the ascii area doesn't resize the widget properly

What steps will reproduce the problem?
1. call setAsciiArea(false) on the QHexEdit object

What is the expected output? What do you see instead?
I would expect the scroll bar to stop after the hex view, but instead, there's 
a blank empty area on the far right, where the ascii area is usually displayed.

What version of the product are you using? On what operating system?
Latest source (from what I can see)

Please provide any additional information below.
Here's the fix I did in QHexEditPrivate::adjust()

if(_asciiArea)
    setMinimumWidth(_xPosAscii + (BYTES_PER_LINE * _charWidth));
else
    setMinimumWidth(_xPosHex + HEXCHARS_IN_LINE * _charWidth);

Original issue reported on code.google.com by [email protected] on 5 Nov 2011 at 1:09

QHexEdit2 can not handle large files



What is the expected output? What do you see instead?


What version of the product are you using? On what operating system?
mac lepord

Please provide any additional information below.

What to do if i want to open 100MB file here ??
do i need to break the file in small size chunks?.

Original issue reported on code.google.com by [email protected] on 21 Mar 2013 at 10:38

glitch on shift pressed and view slided left

i found a some bug in qhexedit. this bug you can see also with your example app in your head commit.
howto reproduce:

  1. start ghexedit example application
  2. switch in insert mode(thx for your hint)
  3. input e.g. 12 34 56 67 89
  4. resize window to horizontal scrollbar show in the bottom of window
  5. slide scrollbar right (contetn shifted left)
  6. click e.g. on last 9 nibble.
  7. press shift key once
  8. you get you example application like on attached picture
    qhexedit2_glitch

this works not only on the last position and also with alt and ctrl keys.

i tried to find a bug, but til now without success.

Generate an Installer for windows

The usual way to install a application under windows is to download an binary package, an installer, and execute it. If we have no binary installer available, the QHexEdit App is just not available for users.

clearDataChanged() doesn't work properly

What steps will reproduce the problem?
1. Change Data
2. Save File
3. Edit file again

Editing file causes selection from start to point where data is changed

solution:

instead of clear() fill entire _changedData with 0.

void XByteArray::clearDataChanged()
{
    _changedData = QByteArray(_changedData.length(), char(0));
}

Original issue reported on code.google.com by [email protected] on 2 Jun 2013 at 4:25

Compile failure with mingw/gcc 3.4.2; ReadOnly issue

v0.7.3 was not compiling with gcc 3.4.2 on MINGW - yes I know it's a very old gcc version - but that's what I am on and the fix was simple - wrap 64-bit literals with Q_INT64_C()

Another issue I faced was that sometimes the Widget after creation would be set to readonly and I was unable to edit contents. My code never touches the readOnly property. Looking at the qhexedit.cpp, I see that _readOnly is never explicitly initialized - so I guess this could happen?

Here's a patch for both issues -

diff --git a/extra/qhexedit2/src/chunks.cpp b/extra/qhexedit2/src/chunks.cpp
--- a/extra/qhexedit2/src/chunks.cpp
+++ b/extra/qhexedit2/src/chunks.cpp
@@ -6,7 +6,7 @@

 #define BUFFER_SIZE 0x10000
 #define CHUNK_SIZE 0x1000
-#define READ_CHUNK_MASK 0xfffffffffffff000
+#define READ_CHUNK_MASK Q_INT64_C(0xfffffffffffff000)

 // ***************************************** Constructors and file settings

diff --git a/extra/qhexedit2/src/qhexedit.cpp b/extra/qhexedit2/src/qhexedit.cpp
--- a/extra/qhexedit2/src/qhexedit.cpp
+++ b/extra/qhexedit2/src/qhexedit.cpp
@@ -98,7 +98,7 @@ int QHexEdit::addressWidth()
 {
     qint64 size = _chunks->size();
     int n = 1;
-    if (size > 0x100000000){ n += 8; size /= 0x100000000;}
+    if (size > Q_INT64_C(0x100000000)){ n += 8; size /= Q_INT64_C(0x100000000);}
     if (size > 0x10000){ n += 4; size /= 0x10000;}
     if (size > 0x100){ n += 2; size /= 0x100;}
     if (size > 0x10){ n += 1; size /= 0x10;}
@@ -858,6 +858,7 @@ void QHexEdit::init()
     setCursorPosition(0);
     verticalScrollBar()->setValue(0);
     _modified = false;
+    _readOnly = false;
 }

 void QHexEdit::adjust()

Blinking cursor is displayed even if the control is set to read only

What steps will reproduce the problem?
1. Call setReadOnly(true) on the widget

What is the expected output? What do you see instead?
I'd expect the cursor not to be shown, but it is :)

What version of the product are you using? On what operating system?
Latest

Please provide any additional information below.
I made the following change to fix this, in 
QHexEditPrivate::paintEvent(QPaintEvent *event) :

// paint cursor
if (_blink && !_readOnly)
{
 ...
}

Thanks!

Original issue reported on code.google.com by [email protected] on 5 Nov 2011 at 1:12

Uninitialized values in QHexEdit constructor

Since all setters for main class fields are closely interconnected, calling anyone of them while some other fields haven't yet been initialized leads to conditionals relying on uninitialized values (you can check this with valgrind).

To circumvent this I had just to add to the QHexEdit constructor the following lines:
_addressArea = true;
_addressWidth = 4;
_asciiArea = true;
_overwriteMode = true;
_highlighting = true;
_readOnly = false;
_cursorPosition = 0;
_lastEventSize = 0;

Not sure if it is the correct solution, however.

address area doesn't update when changed in optionsdialog

When changing the size of the address area the changes aren't shown in editor 
widget after accepting the options. 

The reason is a missing "adjust()" in function 
"QHexEditPrivate::setAddressWidth()" in qhexedit_p.cpp. The whole function 
should look like this:
==8<==
void QHexEditPrivate::setAddressWidth(int addressWidth)
{
    _xData.setAddressWidth(addressWidth);
    adjust();

    setCursorPos(_cursorPosition);
}
==8<==

Thanks for this great Widget!!!

Original issue reported on code.google.com by [email protected] on 5 Oct 2012 at 11:47

Scroll Bar not shown when extra data inserted

What steps will reproduce the problem?
1. Do insert mode
2. Enter a lot of data
3. Resize the window height so it is smaller then the data

What is the expected output? What do you see instead?
The vertical scrollbar should show, it actually does nothing.

What version of the product are you using? On what operating system?
Latest commit, MSVC2010, Windows8.1, Qt 4.8.5 x86

Please provide any additional information below.
Adding the following line in "QHexEditPrivate::QHexEditPrivate(QScrollArea 
*parent) : QWidget(parent)" fixes it:
connect(this, SIGNAL(dataChanged()), this, SLOT(adjust())); //adjust scrollbar 
when inserting data

Greetings

Original issue reported on code.google.com by [email protected] on 4 Jul 2014 at 11:17

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.