Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    What widget to use to build a BIG Excel like grid?

    General and Desktop
    5
    7
    7231
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D
      djfm last edited by

      Hello,

      I'm going to experiment with writing a simple spreadsheet application. I have tried the existing ones and NONE could handle reasonably fast an excel file with 130,000 lines and lots of columns, so I thought this would be a good exercise.

      I have not done Qt in a while and with version 5 out I thought things may have changed.
      What would you use to make a HUGE grid?

      I was thinking of using a QGraphicsView and develop custom widgets for the cells but maybe there is something easier?
      Any advice?

      Thanks in advance and long live the best GUI toolkit!

      1 Reply Last reply Reply Quote 0
      • M
        MuldeR last edited by

        QTableView?

        http://qt-project.org/doc/qt-4.8/qtableview.html#details

        My OpenSource software at: http://muldersoft.com/

        Qt v4.8.6 MSVC 2013, static/shared: http://goo.gl/BXqhrS

        Go visit the coop: http://youtu.be/Jay...

        1 Reply Last reply Reply Quote 0
        • P
          prady_80 last edited by

          You Could use a QTableView (as MulderR suggests) with a custom model and try lazy loading it or check if already supports lazy loading (I presume it does).

          1 Reply Last reply Reply Quote 0
          • D
            djfm last edited by

            Thank you, that's what I'm trying. Problem is I have to customize its behaviour heavily and there are some things I might not be able to handle, such as merging cells for instance.

            1 Reply Last reply Reply Quote 0
            • Chris Kawa
              Chris Kawa Moderators last edited by

              Merging is easy: "setSpan":http://qt-project.org/doc/qt-5.0/qtwidgets/qtableview.html#setSpan
              Some customization is possible through delegates. What exactly do you need?

              1 Reply Last reply Reply Quote 0
              • D
                djfm last edited by

                Oh thanks, it should do it then :) I just need to figure out the various events I need to intercept now to emulate excel behaviour, such as when editing a formula and clicking elsewhere the current editor widget needs to keep its textcursor position, its a load of fun!

                1 Reply Last reply Reply Quote 0
                • P
                  panosk last edited by

                  [quote author="djfm" date="1365618877"]I have tried the existing ones and NONE could handle reasonably fast an excel file with 130,000 lines and lots of columns[/quote]

                  I'm not sure here if you mean you have tried existing examples, but anyway, here is an example spreadsheet app you may find useful as a reference:
                  http://qt-project.org/doc/qt-5.0/qtwidgets/itemviews-spreadsheet.html

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post