Results 1 to 6 of 6

Thread: QGraphicsView, QGraphicsScene and QGraphicsTextItem / Implementing a HexEditor

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Dec 2010
    Posts
    9
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Lightbulb QGraphicsView, QGraphicsScene and QGraphicsTextItem / Implementing a HexEditor

    Hi,

    I want to implement a hex-editor with a classical 3-parts-layout (offset, hex, ascii) with Qt (and Python, but that does not matter because class-names are equal to those of C++). As a proof of concept I thought it's maybe a good idea to use a QGraphicsView in which I place a QGraphicsScene. The QGraphicsScene is then filled with the three QGraphicsTextItems representing the current offset, hex and ascii values.

    See the graphics below to get a better understanding:
    fredi_arch.png

    Currently this implementation has some problems:
    • First of all, I wanted to get your opinion on this setup. Is there any better way? All in all it's less pixel-calculations than I expected because almost all geometry can be determined by already available methods (e. g. like those provided by QFontMetrics). The QGraphicsTextItem also allows me to apply colors, e. g. for implementing selections.
    • The QGraphicsScene is created in case the navigation bar or the mouse wheel is used on the QGraphicsView or when a resizeEvent() occurs. That works fine, but I'm not sure if that's the best approach.
    • Is there any way to fix the QGraphicsScene in the QGraphicsView? When I press the Page-Up/Page-Down keys it moves around (but the mouse-click coordinates which are relative to an item's position are still given correctly).


    Thanks for reading and giving me your opinions beforehand
    Rainer
    Attached Images Attached Images
    Last edited by dubbaluga; 5th December 2010 at 19:58.

Similar Threads

  1. QGraphicsScene & QGraphicsView help please
    By munna in forum Qt Programming
    Replies: 6
    Last Post: 13th February 2017, 12:30
  2. QGraphicsTextItem subclass & QGraphicsScene
    By ttvo in forum Qt Programming
    Replies: 2
    Last Post: 30th August 2009, 15:46
  3. Replies: 9
    Last Post: 22nd February 2008, 16:22
  4. QGraphicsScene and QGraphicsView
    By sabeesh in forum Qt Programming
    Replies: 7
    Last Post: 1st August 2007, 06:59
  5. QGraphicsScene and QGraphicsView
    By rossd in forum Qt Programming
    Replies: 2
    Last Post: 25th April 2007, 14:43

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.