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. KSensors from qt/kde 3 to qt/kde 4 -> Right-click menus on ksensors or the traybar do not work
Forum Updated to NodeBB v4.3 + New Features

KSensors from qt/kde 3 to qt/kde 4 -> Right-click menus on ksensors or the traybar do not work

Scheduled Pinned Locked Moved Solved General and Desktop
7 Posts 2 Posters 713 Views 2 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.
  • G Offline
    G Offline
    giusdbg
    wrote on last edited by giusdbg
    #1

    Screenshot_20230521_141734.png

    The port is starting to work, but still has big problems.

    • Right-click menus on ksensors or the traybar do not work and sometimes close the application.
    • Does not display the sensor in the traybar
    • Graphic indicators do not update.
    • Configuration and saving of sensors not tested.

    Whats wrong with new menu code?

    void LMSensorsDock::createMenu()
    {
    menu= new KMenu;
    menu->addTitle(KIcon( "ksensors" ), "KSensors");
    menu->contextMenu()->addAction(KIcon( "configure" ),i18n("&Configure"), this, SLOT(createConfigWidget() ));
    menu->contextMenu()->addSeparator();
    menu->contextMenu()->addAction(KIcon( "ksensors" ),i18n("&About KSensors"), this, SLOT(showAbout() ));
    menu->contextMenu()->addSeparator();
    if(!noDock) menu->contextMenu()->addAction(sensorsWidget ? i18n("&Minimize"):i18n("&Restore"), this, SLOT(minimizeRestoreWidget() ));
    menu->contextMenu()->addAction(SmallIcon("exit"),i18n("&Exit"), this, SLOT(close() ));
    }

    Original menu code

    void LMSensorsDock::createMenu()
    {
    menu= new KPopupMenu;
    menu->insertTitle(kapp->miniIcon(),"KSensors");
    menu->insertItem(SmallIcon("configure"),i18n("&Configure"), this, SLOT(createConfigWidget() ) ,0,101 );
    menu->insertSeparator();
    menu->insertItem(kapp->miniIcon() ,i18n("&About KSensors"), this, SLOT(showAbout() ) ,0,103 );
    menu->insertSeparator();
    if(!noDock) menu->insertItem(sensorsWidget ? i18n("&Minimize"):i18n("&Restore"), this, SLOT(minimizeRestoreWidget() ) ,0,100 );
    menu->insertItem(SmallIcon("exit"),i18n("&Exit"), this, SLOT(close()),0,102);
    }

    SGaistS 1 Reply Last reply
    0
    • G giusdbg

      Screenshot_20230521_141734.png

      The port is starting to work, but still has big problems.

      • Right-click menus on ksensors or the traybar do not work and sometimes close the application.
      • Does not display the sensor in the traybar
      • Graphic indicators do not update.
      • Configuration and saving of sensors not tested.

      Whats wrong with new menu code?

      void LMSensorsDock::createMenu()
      {
      menu= new KMenu;
      menu->addTitle(KIcon( "ksensors" ), "KSensors");
      menu->contextMenu()->addAction(KIcon( "configure" ),i18n("&Configure"), this, SLOT(createConfigWidget() ));
      menu->contextMenu()->addSeparator();
      menu->contextMenu()->addAction(KIcon( "ksensors" ),i18n("&About KSensors"), this, SLOT(showAbout() ));
      menu->contextMenu()->addSeparator();
      if(!noDock) menu->contextMenu()->addAction(sensorsWidget ? i18n("&Minimize"):i18n("&Restore"), this, SLOT(minimizeRestoreWidget() ));
      menu->contextMenu()->addAction(SmallIcon("exit"),i18n("&Exit"), this, SLOT(close() ));
      }

      Original menu code

      void LMSensorsDock::createMenu()
      {
      menu= new KPopupMenu;
      menu->insertTitle(kapp->miniIcon(),"KSensors");
      menu->insertItem(SmallIcon("configure"),i18n("&Configure"), this, SLOT(createConfigWidget() ) ,0,101 );
      menu->insertSeparator();
      menu->insertItem(kapp->miniIcon() ,i18n("&About KSensors"), this, SLOT(showAbout() ) ,0,103 );
      menu->insertSeparator();
      if(!noDock) menu->insertItem(sensorsWidget ? i18n("&Minimize"):i18n("&Restore"), this, SLOT(minimizeRestoreWidget() ) ,0,100 );
      menu->insertItem(SmallIcon("exit"),i18n("&Exit"), this, SLOT(close()),0,102);
      }

      SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      You might want to contact the KDE folks since you are using mainly their APIs.

      That said, current KDE is on KF5 with a steady work going on to KF6 and Qt 6 so you might want to consider targeting these versions.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      G 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        You might want to contact the KDE folks since you are using mainly their APIs.

        That said, current KDE is on KF5 with a steady work going on to KF6 and Qt 6 so you might want to consider targeting these versions.

        G Offline
        G Offline
        giusdbg
        wrote on last edited by
        #3

        @SGaist Hi.

        Okay.

        The reasons are/were

        • Below kmenu is qmenu, kmenu does rather little.

        • Porting from qt/kde 3 to qt/kde 4 (at least for me) is already very difficult and bordering on impossible, double or triple jumping I think would kill me.

        • 90% of problems are due to disappearance of objects, methods, events, and behavior changes in new qt versions.
          (connects, events, layout management, it's a hell of a battle).

        SGaistS 1 Reply Last reply
        0
        • G giusdbg

          @SGaist Hi.

          Okay.

          The reasons are/were

          • Below kmenu is qmenu, kmenu does rather little.

          • Porting from qt/kde 3 to qt/kde 4 (at least for me) is already very difficult and bordering on impossible, double or triple jumping I think would kill me.

          • 90% of problems are due to disappearance of objects, methods, events, and behavior changes in new qt versions.
            (connects, events, layout management, it's a hell of a battle).

          SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          The issue here is that you want to port to a version of Qt that has reached end of life quite a long time ago and for a version of KDE that is also deprecated.

          You might want to consider using ksensors as a base and rewrite the thing from scratch.

          Depending on what you want to do, did you check whether KSysGuard does what you want ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          G 2 Replies Last reply
          0
          • SGaistS SGaist

            The issue here is that you want to port to a version of Qt that has reached end of life quite a long time ago and for a version of KDE that is also deprecated.

            You might want to consider using ksensors as a base and rewrite the thing from scratch.

            Depending on what you want to do, did you check whether KSysGuard does what you want ?

            G Offline
            G Offline
            giusdbg
            wrote on last edited by
            #5

            @SGaist I fixed it, found some forum posts reporting problems with qsystemtryicon, and explaining how to fix it with activated events and such.
            Luckily kmenu and ksystemtrayicon are little more than a hat over qt.

            P.S. I made my assessments, and also seeing that I have to do the job myself, I decided to port to step 3 -> 4 -> 5 -> 6.

            G 1 Reply Last reply
            0
            • G giusdbg has marked this topic as solved on
            • G giusdbg

              @SGaist I fixed it, found some forum posts reporting problems with qsystemtryicon, and explaining how to fix it with activated events and such.
              Luckily kmenu and ksystemtrayicon are little more than a hat over qt.

              P.S. I made my assessments, and also seeing that I have to do the job myself, I decided to port to step 3 -> 4 -> 5 -> 6.

              G Offline
              G Offline
              giusdbg
              wrote on last edited by
              #6

              @SGaist As you can see I'm quite ahead, abandoning the race on the last lap doesn't make much sense

              Screenshot_20230521_141734.png

              1 Reply Last reply
              0
              • SGaistS SGaist

                The issue here is that you want to port to a version of Qt that has reached end of life quite a long time ago and for a version of KDE that is also deprecated.

                You might want to consider using ksensors as a base and rewrite the thing from scratch.

                Depending on what you want to do, did you check whether KSysGuard does what you want ?

                G Offline
                G Offline
                giusdbg
                wrote on last edited by
                #7

                @SGaist Just for information and if you are interested.

                After weeks of daily use of ksensors qt/kde 4, I started porting it to qt/kde 5.

                This time there are a ton of changes in the cmake configuration, in the kde api (several things have been eliminated, you have to use qt directly or rebuild from scratch) and some in qt (a few things even if delicate).

                It's much more difficult and heavier than I had hoped, on the other hand the progress is much faster, in leaps.

                After this port I would say that ksensors has definitely entered on modern/recent projects, at least more than many others.

                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 Extensions
                • Unsolved