Results 1 to 8 of 8

Thread: Increase the maximum limit of Qscroll area

  1. #1
    Join Date
    Apr 2011
    Location
    Gurgaon
    Posts
    32
    Thanks
    6
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Smile Increase the maximum limit of Qscroll area

    I have to print the hard disk values in a widget in the form of hexadecimal , just like in any hex editor.
    I am getting problem with the maximum size of QScrollarea. Can I customize the size of qscroll area because I have to display the disk in a single scroll area , from sector 0 to the last sector of the disk . The disk size is 500GB.

  2. #2
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Thanks
    3
    Thanked 452 Times in 435 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    15

    Default Re: Increase the maximum limit of Qscroll area

    I am getting problem with the maximum size of QScrollarea.
    What is the problem?
    When you know how to do it then you may do it wrong.
    When you don't know how to do it then it is not that you may do it wrong but you may not do it right.

  3. #3
    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: Increase the maximum limit of Qscroll area

    Quote Originally Posted by anupam View Post
    I am getting problem with the maximum size of QScrollarea. Can I customize the size of qscroll area because I have to display the disk in a single scroll area , from sector 0 to the last sector of the disk . The disk size is 500GB.
    Did you calculate how much RAM is needed to display all that data?
    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.


  4. #4
    Join Date
    Apr 2011
    Location
    Gurgaon
    Posts
    32
    Thanks
    6
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Increase the maximum limit of Qscroll area

    I have to show the data of whole hard disk in the form of hexadecimal just like
    :-
    000000 50 4b 03 04 0a 00 00 00 00 00 e5 5e 91 42 00 00
    000010 00 00 00 00 00 00 00 00 00 00 0d 00 10 00 4d 64
    .
    .
    .
    .
    121022000020 69 5f 31 36 5f 41 70 72 69 6c 2f 55 58 0c 00 22


    so I have used the QScroll area & draw the text with QPainter .
    Here 000000 , 0000010, 000020 to 121022000020 are the offset & next column is the corresponding byte for the offset position.
    So after increasing the range of integer the scroll area stops the showing the line .
    Because QPatiner takes maximum limit of integer in height() so this can also be a problem ....

    My problem is that , I have to show all hard disk data in a single scroll area..
    Please help me..
    Thanks in advance...

  5. #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: Increase the maximum limit of Qscroll area

    Displaying 500GB in hexadecimal form requires at least 2TB of memory (since each byte is converted into two hex digits and each character in QString is encoded using 16 bits). Does your machine have that much memory? Unless you know where to buy memory chips sized 512GB or more (and have a machine capable of using that much memory), you can't do it.

    The proper approach is to use QAbstractScrollArea, subclass it and reimplement the painting routine to only draw the part of the disk that you are currently displaying.
    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.


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

    anupam (17th June 2013)

  7. #6
    Join Date
    Apr 2011
    Location
    Gurgaon
    Posts
    32
    Thanks
    6
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Increase the maximum limit of Qscroll area

    QAbstractScrollArea does not take the value outside the range of integer, this is the main problem,
    & QPainter is also not painting outside of range of integer...
    Can I customiz the scroll area to take qint64 As well as QPainter..

    I just want to make a disk editor..

  8. #7
    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: Increase the maximum limit of Qscroll area

    Quote Originally Posted by anupam View Post
    QAbstractScrollArea does not take the value outside the range of integer, this is the main problem,
    No, it is not a problem.

    512GB = 512 * 2^30 = 2^39
    MAXINT = 2^31

    hence

    granularity is 2^39 / 2^31 = 2^8 = 256

    hence scrolling "by 1" moves the content "by 256"

    2^8 / 16 = 2^8 / 2^4 = 2^4 = 16

    hence scrolling "by 1" moves the content by 16 lines hence you have to guarantee that you can display at least 16 lines at once (asuming the font to be around 10pt high you need your viewport to be about 200pt or larger which is easily achievable). If that's not possible, implement your own scrollbar which takes qint64 as the value and your own abstract scroll area that uses your scrollbar class.

    QPainter is also not painting outside of range of integer...
    You are painting with the size of the viewport which is less than the height of your screen.
    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.


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

    anupam (18th June 2013)

  10. #8
    Join Date
    Apr 2011
    Location
    Gurgaon
    Posts
    32
    Thanks
    6
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Increase the maximum limit of Qscroll area

    Thanks , I am going to implement the first solution .

Similar Threads

  1. Replies: 2
    Last Post: 24th March 2016, 15:54
  2. How to increase available RAM for Qt Creator?
    By fezvez in forum Qt Tools
    Replies: 4
    Last Post: 19th April 2011, 21:37
  3. QTextEdit - how to limit maximum length?
    By Henrikas[MI] in forum Qt Programming
    Replies: 7
    Last Post: 21st September 2010, 20:38
  4. Replies: 33
    Last Post: 10th June 2010, 16:51
  5. About QScroll Area
    By franco.amato in forum Qt Programming
    Replies: 16
    Last Post: 26th January 2010, 22: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.