Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [Solved] update checkable QPushButton without toggle event
Qt 6.12 LTS is out! See what's new in the release blog

[Solved] update checkable QPushButton without toggle event

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

    Hi all,
    having a checkable QPushButton (with different On/Off Icons via Designer), I need to update it, triggered by an extra thread, but without producing an toggle event again as it happens with QPushButton::setChecked ...think of a download bar with progress and a Pause/Resume toggle button.
    Underlying download may signal new state, I want the button state adapt to like with setChecked, but latter would raise a toggle event, that would be hard to filter from user click onto the button.

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      Are you aware that you can "block signals":http://doc.trolltech.com/main-snapshot/qobject.html#blockSignals?

      1 Reply Last reply
      0
      • ? Offline
        ? Offline
        A Former User
        wrote on last edited by
        #3

        You mean QObject::blockSignals()?
        no, I wasn't -- cool -- thanks!

        hope this works for me, if so, how can I put thread as solved?

        1 Reply Last reply
        0
        • ? Offline
          ? Offline
          A Former User
          wrote on last edited by
          #4

          Just add a "solved" tag. Others prepend a [solved] before the title of the thread.

          1 Reply Last reply
          0
          • ? Offline
            ? Offline
            A Former User
            wrote on last edited by
            #5

            found another (cleaner) option: to distinguish between clicked and toggled, former does not react to setChecked()

            1 Reply Last reply
            1

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt
            • Unsolved