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. Is there a slot for enabling/disabling a widget?

Is there a slot for enabling/disabling a widget?

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 8.7k 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
    Little Red Wolf
    wrote on last edited by
    #1

    In the QtDesigner, I have a checkbox that when clicked I would like to enable two dependent widgets (two LineTexts). It seems I can wire the checkbox's clicked signal to those line text widgets, but they don't have a slot for enabling/disabling. How can I achieve this within QtDesigner and without having to write additional code?

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

      ;-)

      Yes, there are slots exist for enabling/disabling a widget. You can find them in the manual of QWidget.

      And you can connect the signal "clicked(bool)" instead of "clicked()" to them under Qt Designer.

      Debao

      1 Reply Last reply
      0
      • M Offline
        M Offline
        m_pahlevanzadeh
        wrote on last edited by
        #3

        Which slot? clciked(bool) signal have 4 slot: clear(), selectAll(), stepDown() and stepUp(), all of them can't enable widget.

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

          QWidget and all its sub-classes have following two slots:

          @
          setDisabled((bool disable))
          setEnabled((bool enable))
          @

          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