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. Zooming QTableView
Forum Updated to NodeBB v4.3 + New Features

Zooming QTableView

Scheduled Pinned Locked Moved Solved General and Desktop
13 Posts 3 Posters 2.0k 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.
  • Christian EhrlicherC Offline
    Christian EhrlicherC Offline
    Christian Ehrlicher
    Lifetime Qt Champion
    wrote on last edited by
    #4

    Then you have to resize your header sizes accordingly.

    Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
    Visit the Qt Academy at https://academy.qt.io/catalog

    D 1 Reply Last reply
    0
    • Christian EhrlicherC Christian Ehrlicher

      Then you have to resize your header sizes accordingly.

      D Offline
      D Offline
      DzCode
      wrote on last edited by
      #5

      @Christian-Ehrlicher

      yes but I want to ask something.
      Is there any other way to do zooming instead of changing fonts?

      1 Reply Last reply
      0
      • Christian EhrlicherC Offline
        Christian EhrlicherC Offline
        Christian Ehrlicher
        Lifetime Qt Champion
        wrote on last edited by
        #6

        No, not that I'm aware of.

        Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
        Visit the Qt Academy at https://academy.qt.io/catalog

        D 1 Reply Last reply
        1
        • Christian EhrlicherC Christian Ehrlicher

          No, not that I'm aware of.

          D Offline
          D Offline
          DzCode
          wrote on last edited by
          #7

          @Christian-Ehrlicher

          I am asking this, because Icons and pixmaps in the decoration role does not change with the change of the font. image sizes also should change with zooming

          mrjjM 1 Reply Last reply
          0
          • D DzCode

            @Christian-Ehrlicher

            I am asking this, because Icons and pixmaps in the decoration role does not change with the change of the font. image sizes also should change with zooming

            mrjjM Offline
            mrjjM Offline
            mrjj
            Lifetime Qt Champion
            wrote on last edited by
            #8

            @DzCode
            Hi
            You could maybe subclass HeaderView and overwrite paintSection
            do your own image and text scaling.

            Do you also need the actual cells to scale this way ?
            You could add your own delegate and scale images and text too.

            D 1 Reply Last reply
            0
            • mrjjM mrjj

              @DzCode
              Hi
              You could maybe subclass HeaderView and overwrite paintSection
              do your own image and text scaling.

              Do you also need the actual cells to scale this way ?
              You could add your own delegate and scale images and text too.

              D Offline
              D Offline
              DzCode
              wrote on last edited by
              #9

              @mrjj

              I am resizing the images inside a proxymodel now.

              However, there is one thing left to solve my all problems.

              I am using checkstaterole of my model to make some columns checkable. There is problem about resizing them. I dont want to replace them with QCheckBox. I created checboxes with the help of the Qt::ItemIsUserCheckable flag. How can I resize them?

              mrjjM 1 Reply Last reply
              0
              • D DzCode

                @mrjj

                I am resizing the images inside a proxymodel now.

                However, there is one thing left to solve my all problems.

                I am using checkstaterole of my model to make some columns checkable. There is problem about resizing them. I dont want to replace them with QCheckBox. I created checboxes with the help of the Qt::ItemIsUserCheckable flag. How can I resize them?

                mrjjM Offline
                mrjjM Offline
                mrjj
                Lifetime Qt Champion
                wrote on last edited by mrjj
                #10

                @DzCode
                hi
                Ok that sounds good too.

                I have never tried to style the "checkable" but I think you can control it with a delegate and
                https://doc.qt.io/qt-5/qitemdelegate.html#drawCheck

                Update: nope, it wont care if given bigger or smaller rect.
                bascially it boils down to
                style->drawPrimitive(QStyle::PE_IndicatorItemViewItemCheck, &opt, painter, widget);

                D 1 Reply Last reply
                0
                • mrjjM mrjj

                  @DzCode
                  hi
                  Ok that sounds good too.

                  I have never tried to style the "checkable" but I think you can control it with a delegate and
                  https://doc.qt.io/qt-5/qitemdelegate.html#drawCheck

                  Update: nope, it wont care if given bigger or smaller rect.
                  bascially it boils down to
                  style->drawPrimitive(QStyle::PE_IndicatorItemViewItemCheck, &opt, painter, widget);

                  D Offline
                  D Offline
                  DzCode
                  wrote on last edited by
                  #11

                  @mrjj

                  I did it via stylesheet of QtableView::indicator.

                  Thanks both of you for your support

                  mrjjM 1 Reply Last reply
                  1
                  • D DzCode

                    @mrjj

                    I did it via stylesheet of QtableView::indicator.

                    Thanks both of you for your support

                    mrjjM Offline
                    mrjjM Offline
                    mrjj
                    Lifetime Qt Champion
                    wrote on last edited by
                    #12

                    @DzCode
                    Good work. So even using stylesheets it zooms fast enough ?

                    D 1 Reply Last reply
                    0
                    • mrjjM mrjj

                      @DzCode
                      Good work. So even using stylesheets it zooms fast enough ?

                      D Offline
                      D Offline
                      DzCode
                      wrote on last edited by
                      #13

                      @mrjj I didnt test it with chrono since I didnt have a time to, but for user perspective, there is no problem if you have less table

                      1 Reply Last reply
                      1

                      • Login

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