Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Deploying Application Created in MSVC 2019
Forum Updated to NodeBB v4.3 + New Features

Deploying Application Created in MSVC 2019

Scheduled Pinned Locked Moved Solved Installation and Deployment
7 Posts 3 Posters 953 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.
  • 1 Offline
    1 Offline
    168gr
    wrote on last edited by
    #1

    I have a fairly simple application, that I created in Microsoft Visual C++ 2019. It reads from some analog sampling hardware over a serial connection, and displays the data being read. The purpose is some physiologic monitoring of some medical hardware that is being developed.

    Anyway, the application works fine when run on the computer it was developed on - both when executed from within MSVC, and when executed normally direct from the deployment folder.

    When I try to deploy the completed application to another Windows computer, it runs, but the window is distorted and the application is essentially unusable.

    Qt 5.13.2 is installed. MSVC 2019 has the Qt extension. I compiled/built for release:

    alt text

    When I run it from within MSVC 2019, it looks exactly as it did in QT Designer (launched from within MSVC 2019):

    alt text

    I then used the command-line windeployqt utility as follows ...

    alt text

    ... and moved the whole folder to another computer which has the Visual C++ redistributable files installed on it (VC_redist.x64.exe straight from Microsoft). The program runs and functions, but it looks squished:

    alt text

    What gives? What am I doing wrong? Thank you.

    Chris KawaC 1 Reply Last reply
    0
    • 1 Offline
      1 Offline
      168gr
      wrote on last edited by 168gr
      #2

      Quick update - deployed to a 3rd computer. This one is a MS Surface Pro tablet.

      The application runs and looks a little better, but still not quite right.

      alt text

      I was under the impression that a central point of Qt was that you could develop an app that looks the same across multiple platforms. But here I am on three Windows PCs and I'm getting three different looks. Is there something else I need to configure when building the application to ensure consistent look/scaling/fontsize/etc on any computer it's run on?

      J.HilkJ 1 Reply Last reply
      0
      • 1 168gr

        Quick update - deployed to a 3rd computer. This one is a MS Surface Pro tablet.

        The application runs and looks a little better, but still not quite right.

        alt text

        I was under the impression that a central point of Qt was that you could develop an app that looks the same across multiple platforms. But here I am on three Windows PCs and I'm getting three different looks. Is there something else I need to configure when building the application to ensure consistent look/scaling/fontsize/etc on any computer it's run on?

        J.HilkJ Offline
        J.HilkJ Offline
        J.Hilk
        Moderators
        wrote on last edited by
        #3

        @168gr seems like a windows display scaling problem
        check your resolution on the different devices and the Scaling factor of "text, apps & Elements"


        Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


        Q: What's that?
        A: It's blue light.
        Q: What does it do?
        A: It turns blue.

        1 1 Reply Last reply
        1
        • 1 168gr

          I have a fairly simple application, that I created in Microsoft Visual C++ 2019. It reads from some analog sampling hardware over a serial connection, and displays the data being read. The purpose is some physiologic monitoring of some medical hardware that is being developed.

          Anyway, the application works fine when run on the computer it was developed on - both when executed from within MSVC, and when executed normally direct from the deployment folder.

          When I try to deploy the completed application to another Windows computer, it runs, but the window is distorted and the application is essentially unusable.

          Qt 5.13.2 is installed. MSVC 2019 has the Qt extension. I compiled/built for release:

          alt text

          When I run it from within MSVC 2019, it looks exactly as it did in QT Designer (launched from within MSVC 2019):

          alt text

          I then used the command-line windeployqt utility as follows ...

          alt text

          ... and moved the whole folder to another computer which has the Visual C++ redistributable files installed on it (VC_redist.x64.exe straight from Microsoft). The program runs and functions, but it looks squished:

          alt text

          What gives? What am I doing wrong? Thank you.

          Chris KawaC Offline
          Chris KawaC Offline
          Chris Kawa
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @168gr said in Deploying Application Created in MSVC 2019:

          What gives? What am I doing wrong? Thank you.

          You're probably hardcoding widget sizes. See High DPI Displays. To fix this "Replace hard-coded sizes in layouts and drawing code with values calculated from font metrics or screen size".

          1 1 Reply Last reply
          2
          • J.HilkJ J.Hilk

            @168gr seems like a windows display scaling problem
            check your resolution on the different devices and the Scaling factor of "text, apps & Elements"

            1 Offline
            1 Offline
            168gr
            wrote on last edited by
            #5

            @J-Hilk said in Deploying Application Created in MSVC 2019:

            @168gr seems like a windows display scaling problem
            check your resolution on the different devices and the Scaling factor of "text, apps & Elements"

            Thanks, that was it.

            Development desktop: Scale/layout 100% 2560x1080
            Laptop: Scale/layout 250% 3840x2160
            Tablet: Scale/layout 150% 1920x1080

            Changed the laptop and tablet to 100%, and the app looks perfect.

            Except ... now the app is TINY on the laptop, which is a 3840x2160 display. I mean, it's about 1/12th the screen now.

            Is there some mechanism to overcome this issue and get the entire app to scale correctly, or is this just how it is?

            Thanks again. I appreciate your help (and so quickly, too).

            J.HilkJ 1 Reply Last reply
            1
            • 1 168gr

              @J-Hilk said in Deploying Application Created in MSVC 2019:

              @168gr seems like a windows display scaling problem
              check your resolution on the different devices and the Scaling factor of "text, apps & Elements"

              Thanks, that was it.

              Development desktop: Scale/layout 100% 2560x1080
              Laptop: Scale/layout 250% 3840x2160
              Tablet: Scale/layout 150% 1920x1080

              Changed the laptop and tablet to 100%, and the app looks perfect.

              Except ... now the app is TINY on the laptop, which is a 3840x2160 display. I mean, it's about 1/12th the screen now.

              Is there some mechanism to overcome this issue and get the entire app to scale correctly, or is this just how it is?

              Thanks again. I appreciate your help (and so quickly, too).

              J.HilkJ Offline
              J.HilkJ Offline
              J.Hilk
              Moderators
              wrote on last edited by
              #6

              @168gr
              the link @Chris-Kawa posted should contain all the information you need to make your App High-DPI capable .

              Read through it, and if you have questions, don't hesitate to come back and ask 😉


              Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


              Q: What's that?
              A: It's blue light.
              Q: What does it do?
              A: It turns blue.

              1 Reply Last reply
              1
              • Chris KawaC Chris Kawa

                @168gr said in Deploying Application Created in MSVC 2019:

                What gives? What am I doing wrong? Thank you.

                You're probably hardcoding widget sizes. See High DPI Displays. To fix this "Replace hard-coded sizes in layouts and drawing code with values calculated from font metrics or screen size".

                1 Offline
                1 Offline
                168gr
                wrote on last edited by
                #7

                @Chris-Kawa said in Deploying Application Created in MSVC 2019:

                @168gr said in Deploying Application Created in MSVC 2019:

                What gives? What am I doing wrong? Thank you.

                You're probably hardcoding widget sizes. See High DPI Displays. To fix this "Replace hard-coded sizes in layouts and drawing code with values calculated from font metrics or screen size".

                Excellent, thank you. Setting the QT_AUTO_SCREEN_SCALE_FACTOR environment variable was an instant (if inelegant) fix. I'll look into the other options more closely. Appreciate the help.

                1 Reply Last reply
                2

                • Login

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