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. Runmode resolution seems to be scaled comparing to design mode

Runmode resolution seems to be scaled comparing to design mode

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 3 Posters 477 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.
  • P Offline
    P Offline
    Philipp DE
    wrote on last edited by
    #1

    I am trying to do my first steps with qt5. Many years ago I was working with Borland C++ Builder and now I like to restart with qt5.

    I just started to design with qt designer of my test application.

    Then I compiled and test my code.

    I was wondering that the outout is not looking exactly as design mode. It seems that design mode for example is 200% and the run mode is 100% or the run mode will run in a different resolution.
    The window seems to be scaled smaller which is resposible for the problem.

    Please have a look at the image:

    qt5.jpg

    The label "Ampel 1", "Ampel 2" and "Test" are not shown completly. There are missing few pixel at the bottom and everything is smaller.

    Is there any way to prevent these problems or what can I do to let the application have the same dimensions as inside the designmode.

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

      You forgot to set a layout on your main widget.

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

      1 Reply Last reply
      1
      • P Offline
        P Offline
        Philipp DE
        wrote on last edited by
        #3

        Hi,

        thanks for the feedback. When I do a right mouse click on the main window, there I can choose some layout options. For example Layout Horizontally. When I set this and start the application again I have still the "scaling" effect.

        Is do you mean any other layout property?

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

          Please read the documentation on how to use the designer.

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

          1 Reply Last reply
          1
          • P Offline
            P Offline
            Philipp DE
            wrote on last edited by
            #5

            Thanks for the feedback. I understood the reason.

            In my example I put an traffic light image into a QLabel and used buttons which I styled to circle as light and placed them on the image. (this was pixel finetuning)

            When I think about the layout functionality I think my way with the images and buttons will not work with qt.

            I have not worked yet with painting functions in qt5. I think that qt5 will have canvas or equivalent for drawing pictures (traffic light) and place them into a grafic widget or equivalet.

            mrjjM 1 Reply Last reply
            0
            • P Philipp DE

              Thanks for the feedback. I understood the reason.

              In my example I put an traffic light image into a QLabel and used buttons which I styled to circle as light and placed them on the image. (this was pixel finetuning)

              When I think about the layout functionality I think my way with the images and buttons will not work with qt.

              I have not worked yet with painting functions in qt5. I think that qt5 will have canvas or equivalent for drawing pictures (traffic light) and place them into a grafic widget or equivalet.

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

              Hi

              • I think that qt5 will have canvas or equivalent for drawing pictures (traffic light) and place them into a grafic widget or equivalet.

              You can always just subclass Qwidget and add a paintEvent to it.
              Then use
              https://doc.qt.io/qt-5/qpainter.html
              to paint anything you like including images.

              In Qt its very easy to make custom Widgets.

              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