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. Different of deviceWidth() between QScreen in Qt4 and Qt5

Different of deviceWidth() between QScreen in Qt4 and Qt5

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 4 Posters 1.2k 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.
  • V Offline
    V Offline
    victor wang
    wrote on last edited by A Former User
    #1

    I have an example that using function "deviceWidth".
    This example is develop on qt4.
    But now i'm using qt5 to develop it.
    And i got some problem!
    I didn't know is there any similar function which is in qt5 and same as the function "deviceWidth()" at qt4.
    Please help!

    J.HilkJ jsulmJ mrjjM 3 Replies Last reply
    0
    • V victor wang

      I have an example that using function "deviceWidth".
      This example is develop on qt4.
      But now i'm using qt5 to develop it.
      And i got some problem!
      I didn't know is there any similar function which is in qt5 and same as the function "deviceWidth()" at qt4.
      Please help!

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

      @victor-wang

      I'll be as vague in my answer as you are in your error description and answer:

      Yes

      @victor-wang said in the different of deviceWidth() between Qscreen in qt5 and in qt4:

      And i got some problem!

      That is not much to go by, I could guess... but that that doesn't help me nor you.


      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
      0
      • V victor wang

        I have an example that using function "deviceWidth".
        This example is develop on qt4.
        But now i'm using qt5 to develop it.
        And i got some problem!
        I didn't know is there any similar function which is in qt5 and same as the function "deviceWidth()" at qt4.
        Please help!

        jsulmJ Offline
        jsulmJ Offline
        jsulm
        Lifetime Qt Champion
        wrote on last edited by
        #3

        @victor-wang "And i got some problem!", "Please help!" - I would like to help you, but I can't as you did not say what the problem is ("And i got some problem" - is not a problem description).

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0
        • V victor wang

          I have an example that using function "deviceWidth".
          This example is develop on qt4.
          But now i'm using qt5 to develop it.
          And i got some problem!
          I didn't know is there any similar function which is in qt5 and same as the function "deviceWidth()" at qt4.
          Please help!

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

          @victor-wang
          Hi, as you can see from the other responses
          the wording of the post is not optimal :)

          I assume you mean.

          In the Qt4 sample, the function deviceWidth() is used.
          What function can i use instead in Qt5 ?

          To that, i think , this will give the same info

          QScreen *screen = QGuiApplication::primaryScreen();
          QRect  screenGeometry = screen->geometry();
          int height = screenGeometry.height();
          int width = screenGeometry.width();
          
          1 Reply Last reply
          3

          • Login

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