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. Color and Icon
Forum Updated to NodeBB v4.3 + New Features

Color and Icon

Scheduled Pinned Locked Moved General and Desktop
9 Posts 4 Posters 6.1k 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
    Revu
    wrote on last edited by
    #1

    Hi Everybody...Am here for a help regarding color and icon set-up for the widgets.
    Let me know if someone know how to change the color,shape and font of the main window and its child window?

    Every fall is to raise higher than Before.

    1 Reply Last reply
    0
    • G Offline
      G Offline
      goetz
      wrote on last edited by
      #2

      For the first two: search Assistant for "palette" and "font" properties (hint: there is a tab called "index"). You will see from QMainWidget's API docs which one is the parent widget.

      The shape is always a rectangle.

      http://www.catb.org/~esr/faqs/smart-questions.html

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

        You might use a mask on the widget to influence the shape.

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

          @Volker: I read those documents but not clear.
          @Andre: How could I proceed with a mask?

          [EDIT: fixed @-chars, Volker]

          Every fall is to raise higher than Before.

          1 Reply Last reply
          0
          • G Offline
            G Offline
            goetz
            wrote on last edited by
            #5

            You can set colors in the palette and the fonts in font.

            If you do not understand something, then please ask more precisely.

            http://www.catb.org/~esr/faqs/smart-questions.html

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

              [quote author="Revu" date="1298634031"]@Andre: How could I proceed with a mask?[/quote]

              What part of the documentation (you did read the documentation on it, didn't you?) isn't clear to you?

              1 Reply Last reply
              0
              • R Offline
                R Offline
                Revu
                wrote on last edited by
                #7

                Sorry for the trouble.
                I read about Palette.I tried to change the background color of the pushbutton.
                How to change the background color of the frame and the color of the fonts on the button?

                Thank You

                Every fall is to raise higher than Before.

                1 Reply Last reply
                0
                • G Offline
                  G Offline
                  giesbert
                  wrote on last edited by
                  #8

                  Have you really read the doc for the "QPalette":http://doc.qt.nokia.com/4.7/qpalette.html ?

                  @
                  QPushButton* p = ...

                  QPalette pal = p->palette();
                  QColor myTextColor = Qt::red;
                  QColor myButtonBackground = Qt::green;
                  
                  pal.setColor(QPalette::ButtonText, myTextColor); // set the text color of a button
                  pal.setColor(QPalette::Button, myButtonBackground); // set the text color of a button
                  
                  p->setPalette(pal);
                  

                  @

                  The roles are also described in the "documentation":http://doc.qt.nokia.com/4.7/qpalette.html#ColorRole-enum

                  For changing the button border 3-d effects, use

                  • QPalette::Light
                  • QPalette::Midlight
                  • QPalette::Dark
                  • QPalette::Mid
                  • QPalette::Shadow

                  Nokia Certified Qt Specialist.
                  Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

                  1 Reply Last reply
                  0
                  • R Offline
                    R Offline
                    Revu
                    wrote on last edited by
                    #9

                    @Geroif:
                    Yes I had read and changed the color of the button.Anyway thank you for that piece of code.

                    Every fall is to raise higher than Before.

                    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