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. How to unselect all widgets from the window when you click somewhere in it?
Forum Updated to NodeBB v4.3 + New Features

How to unselect all widgets from the window when you click somewhere in it?

Scheduled Pinned Locked Moved General and Desktop
8 Posts 4 Posters 4.3k 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.
  • L Offline
    L Offline
    Leon
    wrote on last edited by
    #1

    So for example i have a Slider on a mainwindow.. But everytime i debug the app, Slider is selected ( "Screenshot":http://i51.tinypic.com/2lkw4f6.jpg ) The red thing around the slider...

    How can when i click on an empty space at that mainwindow every widget be unselected... ( For now i only have a slider but i would like to know how to unselect all )....

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

      The slider is not selected, it has focus. There is always a widget on your form that has focus, to make key navigation possible. If you put another widget on your form, you'll see that you can make that widget get the focus instead.

      1 Reply Last reply
      0
      • E Offline
        E Offline
        evergreen
        wrote on last edited by
        #3

        Can't you deal with it with QWidget::setFocus() ?

        1 Reply Last reply
        0
        • L Offline
          L Offline
          Leon
          wrote on last edited by
          #4

          Yes focus, right i couldn't explain it..
          Desktop Drapes has also a slider ( "Screenshot ":http://oi54.tinypic.com/vzxb1j.jpg)
          Do u know why the focus thing is different with "this":http://i51.tinypic.com/2lkw4f6.jpg one?

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

            Ah, you mean you don't like the visual representation of the focus? I can imagine you don't, the screenshot with just your slider looks quite ugly. But I have no idea what styles or style sheets you use to create that; it certainly isn't anything standard distributed by Qt.

            1 Reply Last reply
            0
            • L Offline
              L Offline
              Leon
              wrote on last edited by
              #6

              Yes it quite ugly so i changed it to NoFocus...
              Thanks Andre :)

              1 Reply Last reply
              0
              • H Offline
                H Offline
                HuXiKa
                wrote on last edited by
                #7

                I think you are looking for StyleSheets. Have a look on "this":http://thesmithfam.org/blog/2010/03/10/fancy-qslider-stylesheet/ and "this":http://doc.qt.nokia.com/4.6/stylesheet-examples.html#customizing-qslider.

                If you can find faults of spelling in the text above, you can keep them.

                1 Reply Last reply
                0
                • L Offline
                  L Offline
                  Leon
                  wrote on last edited by
                  #8

                  NoFocus Fancy QSlider Stylesheet :D
                  Seems good to me !

                  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