Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Does Qt has this control?
Forum Updated to NodeBB v4.3 + New Features

Does Qt has this control?

Scheduled Pinned Locked Moved General and Desktop
6 Posts 5 Posters 2.5k Views 1 Watching
  • 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.
  • L Offline
    L Offline
    lloydqt
    wrote on last edited by
    #1

    Hi,

    I would like to add a control shown in the picture to my application. I don't know the name of this kind of control. It is used in different contexts like to indicate progress in download accelerators, or to represent a very large matrix of data. I believe somebody should have written it already in Qt, if you know please share.

    Thanks,
    Lloyd

    !http://cdn.ghacks.net/wp-content/uploads/2009/05/disk_defragmentation_software-499x358.jpg(controlPic)!

    1 Reply Last reply
    0
    • J Offline
      J Offline
      joonhwan
      wrote on last edited by
      #2

      Though I have no idea the exact kind of widget is already implmented, I'd like to say QTableView(a table without any horizontal or vertical header) might be a good starting point to consider for your own implentation.
      Use custom item delegator to handle propert painting and implement 'virtual control'-like behavior.

      joonhwan at gmail dot com

      1 Reply Last reply
      0
      • JeroentjehomeJ Offline
        JeroentjehomeJ Offline
        Jeroentjehome
        wrote on last edited by
        #3

        What might be easier is to use the QTableView, but without the custom delegates. When you have the clusters correspond to a column count and a row count you are able to use backgroundrole to indicate the background colour. When text is requested, leave it blank. the QTableView will also handle the scrollbars etc automatic.
        greetz

        Greetz, Jeroen

        1 Reply Last reply
        0
        • L Offline
          L Offline
          lloydqt
          wrote on last edited by
          #4

          Thanks. Will it be able to supports 1000s of cells? Isn't it better to implement in a windows paint event?

          1 Reply Last reply
          0
          • L Offline
            L Offline
            lgeyer
            wrote on last edited by
            #5

            If you just want to show colored squares indicating some sort of status then yes, I would go with a custom widget which reimplements its paintEvent() on does the drawing on its own.

            Although QTableView would support thousands of cells the custom widget will be more performant and less code to write.

            1 Reply Last reply
            0
            • G Offline
              G Offline
              giesbert
              wrote on last edited by
              #6

              [quote author="lloydqt" date="1337747153"]Thanks. Will it be able to supports 1000s of cells? Isn't it better to implement in a windows paint event?[/quote]

              That depends :-)

              How many cells do you need? How often do you update them? In theory, QTableView supports this number of cells. But it depends on update frequency, hardware you run on etc to make that decission. Surely, you can do it in a more optimzed way by implementing a special widget by hand but it will also cost more :-)

              Nokia Certified Qt Specialist.
              Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved