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. Change style
Forum Updated to NodeBB v4.3 + New Features

Change style

Scheduled Pinned Locked Moved General and Desktop
5 Posts 2 Posters 2.4k 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.
  • A Offline
    A Offline
    aVoX
    wrote on last edited by
    #1

    Hello!

    In the 'Examples' folder of my QtSDK installation I found a nice program that shows how to change the appearance using style sheets. If I understand the code correctly, other changes can be done using styles. Can I somehow create my own style? (not style sheet).
    I am going to use widgets in an OpenGL game and I want to apply some changes, for example increasing the windows' title bars' size; setting minimize, maximize and close buttons to left aligned; and other general layout-dedicated things that can't be done from within a style sheet.

    Thanks in advance, aVoX.

    PS: I am totally new to Qt so if you leave a reply, please add an idiot-proof description.

    1 Reply Last reply
    0
    • D Offline
      D Offline
      dbzhang800
      wrote on last edited by
      #2

      Of course you can, and you can find demoes such as examples/widgets/styles .

      But be aware that developing a fully functional custom style is a major undertaking that typically requires 3000 to 5000 lines of C++ code. For this reason, it is often easier and more convenient to use Qt style sheets whenever possible

      1 Reply Last reply
      0
      • A Offline
        A Offline
        aVoX
        wrote on last edited by
        #3

        Thanks for your answer!
        I tried to execute the demo at widgets\styles but somehow it does not seem to compile the files, because there is no executable in the path specified and the output window says "Failed to start program. Path or permissions wrong?"
        What could be the problem?

        1 Reply Last reply
        0
        • D Offline
          D Offline
          dbzhang800
          wrote on last edited by
          #4

          I have no idea why the example does work under your computer. Do other examples work?

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

            [quote author="1+1=2" date="1333230079"]I have no idea why the example does work under your computer. Do other examples work?[/quote]

            Most of the other examples work perfectly.

            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