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. Widgets UI different Mac & Windows
Forum Updated to NodeBB v4.3 + New Features

Widgets UI different Mac & Windows

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 3 Posters 1.2k Views 2 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.
  • S Offline
    S Offline
    SysTech
    wrote on last edited by
    #1

    Hi All,

    I'm wondering how people deal with this.

    I have a small app developed on Windows using Widgets and I carefully laid out the buttons and fields to ensure it worked.

    I got a request from the customer to see if I could make a mac version of the utility. I can compile it and run it but the window/control layouts while roughly the same, things don't fit. For example in windows I have a button that says:

    Set LED Intensity

    The button is fairly big and has lots of space to either side of the words. I compile for mac and this text doesn't fit in the button.

    I'm just wondering how people handle this? Do you have different layouts somehow for each OS? Or do you do a bunch of #ifdefs in code and reset style sheets based on OS? What is the best way?

    1 Reply Last reply
    0
    • CharbyC Offline
      CharbyC Offline
      Charby
      wrote on last edited by
      #2

      I think it really depends of your project needs, but Qt offers a wide range of solution :

      • one can use QWidget with native style if it is requested to keep a native look and feel for desktop application
      • or QML for modern UI for desktop and mobile when it is requested to have a unique UI along every OS - or QML using QtQuick.Controls with styling to try to mimic native (at least for desktop)
      • or even Canvas, or Qt3D...

      If you haven't seen it already, have a look to this great presentation from Milian Wolff during the last CPP conference showing how Qt supports modern UI.

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

        Hi,

        To add to @Charby, how did you do the layout of your UI ? By hand or using layouts ?

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

        S 1 Reply Last reply
        0
        • SGaistS SGaist

          Hi,

          To add to @Charby, how did you do the layout of your UI ? By hand or using layouts ?

          S Offline
          S Offline
          SysTech
          wrote on last edited by
          #4

          @SGaist

          I did this simple program by hand. I do realize layouts would help but the interesting point is that text doesn't fit where it used to fit under windows. Perhaps layouts fix that?

          1 Reply Last reply
          0
          • CharbyC Charby

            I think it really depends of your project needs, but Qt offers a wide range of solution :

            • one can use QWidget with native style if it is requested to keep a native look and feel for desktop application
            • or QML for modern UI for desktop and mobile when it is requested to have a unique UI along every OS - or QML using QtQuick.Controls with styling to try to mimic native (at least for desktop)
            • or even Canvas, or Qt3D...

            If you haven't seen it already, have a look to this great presentation from Milian Wolff during the last CPP conference showing how Qt supports modern UI.

            S Offline
            S Offline
            SysTech
            wrote on last edited by
            #5

            @Charby

            Thank you sir! I will check out the presentation.

            I have mainly used Widget and have not ventured yet into QML but perhaps it is time to learn.

            Thanks!

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

              Each platform has it's own font and font size recommendation. If you have the sizes of every button by hand, you can expect some things to be wrong from one platform to the other.

              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
              0

              • Login

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