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. QPushButton differences between Qt 5.9.1 and Qt 5.14?

QPushButton differences between Qt 5.9.1 and Qt 5.14?

Scheduled Pinned Locked Moved Solved General and Desktop
qpushbuttonqicon
6 Posts 2 Posters 948 Views
  • 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.
  • M Offline
    M Offline
    mdresser
    wrote on 29 Mar 2021, 01:49 last edited by
    #1

    I have created a trivial app with one pushbutton using the UI designer in Qt Creator. It has on and off icons assigned, is checkable, and calls a single one line function:

    void MainWindow::on_pushButton_toggled(bool checked)
    {
        qDebug() << "Checked =" << checked;
    }
    

    I have two platforms setup: Ubuntu 16.04, Qt 5.9, Qt Creator 4.3 and Ubuntu 18.04, Qt 5.14, Qt Creator 4.11.

    On both platforms I can check the "checked" box in the designer and see both icons alternately so I know that I am pointing to the right place for the icon image files but when I run the application I get different results on the two platforms...

    On the older system everything works as expected: Each time I click the button the icon toggles and I get a debug message.

    On the newer system, the icon doesn't change. The background switches between two shades of gray and I get a debug message but I never see the second icon.

    Is this a bug or am I missing something...?

    1 Reply Last reply
    0
    • C Offline
      C Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on 29 Mar 2021, 14:33 last edited by
      #2

      Upgrade to 5.15. There was a bug in the fusion theme.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      1
      • M Offline
        M Offline
        mdresser
        wrote on 30 Mar 2021, 01:19 last edited by
        #3

        But then I read this:
        https://forum.qt.io/topic/120229/how-to-upgrade-qt-from-5-14-2-to-5-15-1
        which seems to say "we don't recommend it"
        I think I will live with a small bug for now rather than risk creating a big problem for myself. At least I know I'm not doing something stupid (this time at least!)
        Thanks, I will mark this solved.

        1 Reply Last reply
        0
        • C Offline
          C Offline
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on 30 Mar 2021, 04:51 last edited by
          #4

          @mdresser said in QPushButton differences between Qt 5.9.1 and Qt 5.14?:

          which seems to say "we don't recommend it"

          Where?

          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
          Visit the Qt Academy at https://academy.qt.io/catalog

          M 1 Reply Last reply 30 Mar 2021, 15:22
          0
          • C Christian Ehrlicher
            30 Mar 2021, 04:51

            @mdresser said in QPushButton differences between Qt 5.9.1 and Qt 5.14?:

            which seems to say "we don't recommend it"

            Where?

            M Offline
            M Offline
            mdresser
            wrote on 30 Mar 2021, 15:22 last edited by
            #5

            @Christian-Ehrlicher

            This is what I was reading. I realize that there is probably a safe way to do it but I am not enough of a Linux expert to know where the traps are and am not looking for adventure... I'll live with the bug until I'm doing a fresh install.

            You can install Qt to system folders, or add symlinks in /usr/lib pointing to your newer version.

            But I don't recommend it at all. Qt shipped with given distribution has been compiled and tested to work with other apps shipped by the distro. If you swap Qt version you may run into a myriad of problems, crashes etc. in many random apps.

            Best approach: find a PPA which ships updated KDE & Qt (KDE Neon comes to mind here) or switch to a different distribution which ships with modern enough Qt.

            (Z(:^
            1
            mariozio 23 Oct 2020, 06:30

            @sierdzio said in How to upgrade Qt from 5.14.2 to 5.15.1 ?:

            PPA which ships updated KDE & Qt (KDE Neon

            what about to compile them from scratch like this ?

            http://www.linuxfromscratch.org/blfs/view/svn/x/qt5.html
            0
            sierdzio Moderators 23 Oct 2020, 06:35

            Even there, they recommend installing to /opt ;-)

            But look further down, they provide installations on how to tell the system where to look for Qt instead of scanning /usr.

            Feel free to try it, sure. Or custom compilation - that's surely possible. My warning still stands - you are likely to break your system. It's a good training and adventure, though :-) Please report back if you make any progress.

            1 Reply Last reply
            0
            • M Offline
              M Offline
              mdresser
              wrote on 2 Apr 2021, 19:15 last edited by
              #6

              Follow-up:
              After noting that the PB background colour changed slightly when clicked, I added this when creating the pushbutton:

              bit.at(i)->setStyleSheet("QPushButton:checked { background-color : green;}");   // work-around for Qt 5.14 bug
              

              This made the checked state more obvious and curiously, the correct checked icon also appeared.

              1 Reply Last reply
              0

              2/6

              29 Mar 2021, 14:33

              topic:navigator.unread, 4
              • Login

              • Login or register to search.
              2 out of 6
              • First post
                2/6
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved