Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. [SOLVED] Custom GUI appearance
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] Custom GUI appearance

Scheduled Pinned Locked Moved Mobile and Embedded
7 Posts 3 Posters 4.5k 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.
  • R Offline
    R Offline
    rizoritis
    wrote on last edited by
    #1

    Hello,

    When developing a GUI for Windows CE I first made a GUI on my desktop utilizing Windows XP. I understood that the GUI would take on the native appearance of the OS that it runs on, but the Windows CE environment is not very attractive. How do you create a standard GUI that looks the same on a desktop as it does on the Windows Embedded platform or any platform for that matter? Does this involve creating custom graphics for every single item used in the GUI (ie pushbuttons, drop down menus)?

    Thanks!

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andre
      wrote on last edited by
      #2

      There are a few routes:

      • use one of the other styles bundled with Qt or found in other places
      • create your own custom QStyle
      • use style sheets.

      In terms of color, styles may be adapted in the colors they use using the palette. That does not work for all styles though, especially the ones using native calls to render elements.

      1 Reply Last reply
      0
      • sierdzioS Offline
        sierdzioS Offline
        sierdzio
        Moderators
        wrote on last edited by
        #3

        You can select style at runtime using -style option (see "the docs":http://qt-project.org/doc/qt-5.0/qtwidgets/qstyle.html). There are several built-in styles you can choose, and that does not require any coding on your part.

        If you are after a different look, you can use QStyle subclasses, or QSS, to change the appearance easily - but that requires a bit more work.

        (Z(:^

        1 Reply Last reply
        0
        • R Offline
          R Offline
          rizoritis
          wrote on last edited by
          #4

          [quote author="sierdzio" date="1371557926"]You can select style at runtime using -style option (see "the docs":http://qt-project.org/doc/qt-5.0/qtwidgets/qstyle.html). There are several built-in styles you can choose, and that does not require any coding on your part.

          If you are after a different look, you can use QStyle subclasses, or QSS, to change the appearance easily - but that requires a bit more work.[/quote]

          Great! Makes life a lot easier. One question though, does not going with the native style slow the application down at all?

          1 Reply Last reply
          0
          • A Offline
            A Offline
            andre
            wrote on last edited by
            #5

            Nope, it should not, unless the style you choose is very complex or inefficiently implemented.

            1 Reply Last reply
            0
            • R Offline
              R Offline
              rizoritis
              wrote on last edited by
              #6

              Using the following code in my main():

              @ QApplication::setDesktopSettingsAware(false);
              QApplication::setStyle("plastique"); /Can choose from windows, plastique, motif, cde, cleanlooks, windowsxp, windowsvista, macintosh/
              QApplication app(argc, argv);@

              First question, does DesktopSettingsAware(false) actually do anything? I didnt really notice a difference.

              Second, on a Windows XP platform I was able to change between cleanlooks, motif, etc, however when trying macintosh, it did not work. I am assuming that this style is not available if you are not working on a mac however if I am using a windows ce platform, which styles would be available? What if I wanted the macintosh look on windows ce. Is that possible? I am trying to avoid the native Windows CE look at all costs because it is quite ugly...

              1 Reply Last reply
              0
              • sierdzioS Offline
                sierdzioS Offline
                sierdzio
                Moderators
                wrote on last edited by
                #7

                Mac is always tricky, I don't know the answer in that scenario. In general, default styles should be available everywhere (you can run Windows style on Linux, for example). This is usually restricted to "base" styles (so, default Windows instead of Win7 style, for example).

                Or you can go for QSS (see "this brilliant example":https://github.com/ColinDuquesnoy/QDarkStyleSheet), but be careful - QSS does introduce performance penalty that can be quite severe (app startup takes longer due to style parsing, for example).

                (Z(:^

                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