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. how to increase the resolution of a tableview rendered into a pixmp ?
QtWS25 Last Chance

how to increase the resolution of a tableview rendered into a pixmp ?

Scheduled Pinned Locked Moved Solved General and Desktop
6 Posts 4 Posters 338 Views
  • 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.
  • S Offline
    S Offline
    sachinrd
    wrote on last edited by
    #1

    Hey Everyone,
    I am using the following snippet to save a tableview to a png image. how do i increase the resolution of the image ?

    QPixmap pixIndexPage(tableView->size().width(), tableView->size().height());
    QFile file("path/index.png");
    file..open(QIODevice::WriteOnly);
    pixIndexPage.save(&file, "PNG");
    
    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi
      Make the pixmap bigger, then it will have a higher resolution.
      You also have to call resize on the table view to make it use the new size.
      If the table view is in a layout this is not so easy as we cant resize it then.

      Can I ask what the issue is ? you render the GUI to pixmaps and they are blurry when you print them or
      why you need higher res ?

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi,

        AFAIR, the rendering resolution of a widget is tied to its size.

        What kind of high resolution do you have in mind ?

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        1
        • C Offline
          C Offline
          ChrisW67
          wrote on last edited by
          #4

          Maybe I missed something. Nothing in the code snippet puts anything in the pixmap, it just makes an uninitialized one of the same pixel size as the tableView widget.

          mrjjM 1 Reply Last reply
          1
          • C ChrisW67

            Maybe I missed something. Nothing in the code snippet puts anything in the pixmap, it just makes an uninitialized one of the same pixel size as the tableView widget.

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

            @ChrisW67
            Missed nothing :)
            there is no grab() or render() shown.
            but I assumed that poster would not be asking about raising the resolution unless
            there was actually something on the picture, so to speak.

            1 Reply Last reply
            0
            • S Offline
              S Offline
              sachinrd
              wrote on last edited by
              #6

              Thanks for your help guys. was able to increase the resolution by increasing the size of the pixmap.

              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