Results 1 to 7 of 7

Thread: QScrollBar with quint64 value

  1. #1
    Join Date
    Jan 2011
    Posts
    23
    Thanks
    14
    Qt products
    Qt4
    Platforms
    Windows

    Default QScrollBar with quint64 value

    I need to implement a QScrollBar control which should be able to process quint64 values as it's minimum & maximum values.
    I should probably subclass QAbstractSlider but I'm not sure how to do it exactly. Perhaps someone already did that and can give me some hints ? Thanks in advance!

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QScrollBar with quint64 value

    QAbstractSlider already defines minimum and maximum with int type so that won't do. You either have to subclass QWidget and implement everything yourself or live with int-ranged scroll bars. Why do you say you need a 64b range scroll bar?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. The following user says thank you to wysota for this useful post:

    ArkKup (17th January 2015)

  4. #3
    Join Date
    Jan 2011
    Posts
    23
    Thanks
    14
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QScrollBar with quint64 value

    bummer its for a 64-bit process memory view\dump app so I was hoping to have the range selectable from 0x00000000`00010000 to 0x000007FF`FFFEFFFF (process user space range)

  5. #4
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QScrollBar with quint64 value

    Ummm, you might want to rethink that choice of interaction.

    Even if you did have a quint64 range with a scrollbar, it would be impossible to actually position it with any precision to a desired offset into process memory. Your window might be, say 1024 pixels high, and at best you can move the scrollbar a single pixel. That means at best you can divide your memory space down by a factor of 1024, and that still leaves a huge memory range per pixel. Then what? How do you focus in any more finely?

  6. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QScrollBar with quint64 value

    I think showing 2^64 items in your model is not possible anyway and is impractical. Maybe you should have two levels of the model -- top level presents "windows" or "memory pages" and lower level shows memory contents for that window/page.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  7. #6
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: QScrollBar with quint64 value

    The QAbstractItemModel and QModelIndex row numbers are declared int which gives a 32-bit value on most, if not all, Qt platforms. Negative row numbers are invalid so the maximum row count in these models is 2^31. I guess you could have a multi-level tree model presenting 2^64 leaf nodes.

  8. #7
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QScrollBar with quint64 value

    Seems sort of recursive to need all of process memory to build a model by which you can observe all of process memory.

    Reminds me of the time my friend saw a trash truck crash into a tree outside his house. There wasn't much damage, but a piece of the fiberglass door had broken off and was lying in the street. The driver got out, looked at it, and then tossed it into the back of the trash truck. We wondered how long that process could continue, feeding bits of the trash truck to itself, before it no longer was a trash truck.

Similar Threads

  1. QAbstractSlider with quint32 or quint64
    By RolandHughes in forum Qt Programming
    Replies: 2
    Last Post: 29th October 2014, 07:14
  2. quint64 conversion question
    By frankiefrank in forum Qt Programming
    Replies: 6
    Last Post: 30th November 2011, 09:10
  3. Replies: 1
    Last Post: 12th May 2010, 09:39
  4. QGraphicsView and QScrollBar
    By paolom in forum Qt Programming
    Replies: 3
    Last Post: 2nd October 2009, 08:19
  5. QScrollbar color
    By ntp in forum Qt Programming
    Replies: 0
    Last Post: 28th August 2008, 17:59

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.