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. General design
Qt 6.11 is out! See what's new in the release blog

General design

Scheduled Pinned Locked Moved Unsolved General and Desktop
9 Posts 3 Posters 2.3k 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.
  • X Offline
    X Offline
    Xav12358
    wrote on last edited by Xav12358
    #1

    Hello,
    I have a problem of design between the designer and the result.
    Here is the designer:
    http://www.hostingpics.net/viewer.php?id=821087imagedesigner.png

    and here is the result:
    http://www.hostingpics.net/viewer.php?id=586226imageresukt.png

    Why there is these difference in the theme?
    How can I keep the theme from the designer?

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mostefa
      wrote on last edited by mostefa
      #2

      @Xav12358

      I think that you have to play with stretch property

      alt text
      you can put

      4 for the first element
      1 for the second element

      for example

      To understand what is stretch factor have a look at this link from qt doc:

      http://doc.qt.io/qt-4.8/layout.html#stretch-factors

      Hope this can help !

      mrjjM 1 Reply Last reply
      0
      • M mostefa

        @Xav12358

        I think that you have to play with stretch property

        alt text
        you can put

        4 for the first element
        1 for the second element

        for example

        To understand what is stretch factor have a look at this link from qt doc:

        http://doc.qt.io/qt-4.8/layout.html#stretch-factors

        Hope this can help !

        mrjjM Offline
        mrjjM Offline
        mrjj
        Lifetime Qt Champion
        wrote on last edited by
        #3
        • How can I keep the theme from the designer?

        You cannot. The dark style used in
        Designer is not there as a selectable style when run outside.
        Its a custom fusion based style.
        You can re-create it with style sheets.

        1 Reply Last reply
        1
        • X Offline
          X Offline
          Xav12358
          wrote on last edited by
          #4

          Thank you for the replay but my problem was about the color and the theme of the elements.

          M 1 Reply Last reply
          0
          • X Xav12358

            Thank you for the replay but my problem was about the color and the theme of the elements.

            M Offline
            M Offline
            mostefa
            wrote on last edited by
            #5

            @Xav12358

            How are you changing the color in qt designer?

            1 Reply Last reply
            0
            • X Offline
              X Offline
              Xav12358
              wrote on last edited by
              #6

              @mrjj
              I try to use that line to change the color and the theme but it is not working:

                  QApplication a(argc, argv);
              
                  MainWindow w;
                  w.show();
              
                      a.setStyle("plastique");
              
              M 1 Reply Last reply
              0
              • X Xav12358

                @mrjj
                I try to use that line to change the color and the theme but it is not working:

                    QApplication a(argc, argv);
                
                    MainWindow w;
                    w.show();
                
                        a.setStyle("plastique");
                
                M Offline
                M Offline
                mostefa
                wrote on last edited by mostefa
                #7

                @Xav12358 said in General design:

                @mrjj
                I try to use that line to change the color and the theme but it is not working:

                    QApplication a(argc, argv);
                
                    MainWindow w;
                    w.show();
                
                        a.setStyle("plastique");
                

                Are you in qt4 or qt5?

                If qt5 you have to use QStyleFactory

                QApplication::setStyle(QStyleFactory::create("Plastique"));
                

                Have a look at this link from qt doc:

                http://doc.qt.io/qt-5/qstylefactory.html#details

                Depending or operating system styles are available to find which styles are available you can add this line :

                qDebug() << QStyleFactory::keys();
                

                For example for my operating system i have these available styles:

                ("Windows", "Motif", "CDE", "Plastique", "GTK+", "Cleanlooks")

                1 Reply Last reply
                2
                • X Offline
                  X Offline
                  Xav12358
                  wrote on last edited by
                  #8

                  Ok I get it , only Windows and fusion are available.
                  Noow it works.
                  Thank you really much.

                  M 1 Reply Last reply
                  0
                  • X Xav12358

                    Ok I get it , only Windows and fusion are available.
                    Noow it works.
                    Thank you really much.

                    M Offline
                    M Offline
                    mostefa
                    wrote on last edited by
                    #9

                    @Xav12358 said in General design:

                    Ok I get it , only Windows and fusion are available.
                    Noow it works.
                    Thank you really much.

                    You are welcome !

                    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