Announcement

Collapse
No announcement yet.

Porting Software To Qt5, KDE Frameworks 5

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Porting Software To Qt5, KDE Frameworks 5

    Phoronix: Porting Software To Qt5, KDE Frameworks 5

    For those interested in bringing their software (or helping in port open-source software) to KDE Frameworks 5 and Qt5, Aleix Pol has written a semi-detailed overview covering the general steps involved...

    http://www.phoronix.com/vr.php?view=MTcyNjE

  • #2
    He forgets to mention in that blog post that QSystemTryIcon is broken in QT5 and therefore porting any application that has a tray icon to QT5 is a no-go. Considering how many applications use this feature I wonder how QT5 can even be released as stable.

    Comment


    • #3
      Originally posted by eydee View Post
      He forgets to mention in that blog post that QSystemTryIcon is broken in QT5 and therefore porting any application that has a tray icon to QT5 is a no-go. Considering how many applications use this feature I wonder how QT5 can even be released as stable.
      In what way is QSystemTrayIcon broken? I did some work on it for Qt 5.3 and are not aware of any breakage.

      Comment


      • #4
        Originally posted by mgraesslin View Post
        In what way is QSystemTrayIcon broken? I did some work on it for Qt 5.3 and are not aware of any breakage.
        It only works under KDE. Here's the bug: https://bugreports.qt-project.org/br...mentOrder=desc

        Comment


        • #5
          And here's the other show-stopping bug: https://bugreports.qt-project.org/browse/QTBUG-31762

          (Sorry for double post, I can't edit the previous one as I can't even see it until a moderator approves it.)

          Comment


          • #6
            It is not

            Originally posted by mgraesslin View Post
            In what way is QSystemTrayIcon broken? I did some work on it for Qt 5.3 and are not aware of any breakage.
            Yes, absolutely, it is not broken, and mgraesslin is kwin maintainer btw...

            Comment


            • #7
              Originally posted by eydee View Post
              And here's the other show-stopping bug: https://bugreports.qt-project.org/browse/QTBUG-31762
              well bugs in QSystemTrayIcon can hardly be called show-stoppers. Anyway that's a Unity issue: Unity needs to provide a PlatformTheme plugin and replace the x-embedd based icon by a status notifier. That's what we do in Plasma - Unity could even just use our code to do it.

              Comment


              • #8
                Originally posted by mgraesslin View Post
                well bugs in QSystemTrayIcon can hardly be called show-stoppers. Anyway that's a Unity issue: Unity needs to provide a PlatformTheme plugin and replace the x-embedd based icon by a status notifier. That's what we do in Plasma - Unity could even just use our code to do it.
                Since the bug reports linked above by eydee have comments reporting breakage on LXDE, XFCE, KDE4, GNOME (2 and 3), Unity, OS X, Cinnamon, trayer and awesomewm, that simply isn't a credible assertion.

                It's broken here with trayer, no Unity in sight. You can't break Qt5 for every systemtray that isn't plasma-next and then say it's their problem.
                Last edited by FLHerne; 06-21-2014, 10:09 AM.

                Comment


                • #9
                  I'm not sure who is in the right or wrong here, and not that it's really my place but butt in, but... QSystemTrayIcon is clearly designed for a Qt based environment, which means it is definitely understandable why it works fine in KDE and maybe not so perfectly elsewhere. On the other hand, while Unity has plenty of problems, it isn't such a poorly designed environment that such a feature should fail. In other words, if QsystemTrayIcon is designed to work in more than just KDE, it shouldn't have issues in such a popular environment. If Unity is the one and only environment (including across other OSes) that fails, then the Unity devs are the ones that need to fix the issue.

                  Comment


                  • #10
                    Originally posted by schmidtbag View Post
                    QSystemTrayIcon is clearly designed for a Qt based environment, which means it is definitely understandable why it works fine in KDE and maybe not so perfectly elsewhere.
                    One of the main selling points of Qt is that it's cross-platform:
                    QSystemTrayIcon isn't 'clearly designed for a Qt based environment', it's the Qt framework's way to create a system-tray icon on Linux, OSX, Windows, and whatever other Qt-supported platforms have system-trays.

                    And re. a previous point that I forgot to respond to, in the real world shipping a stable release that has known, conspicuous glitches for the majority of your customers isn't an option. You just can't do that. So yes, this bug is definitely a 'showstopper' when it comes to releasing a Qt5 port.

                    Comment


                    • #11
                      Status Notifiers are the basis for Ubuntu's AppIndicatora, as a way to drop the legacy way to do system tray icons which was via xembed. Dropping of xembed icons has been known for months and is kind of crucial given that its an X-specification (hence the name. http://standards.freedesktop.org/xem...ec-latest.html) and now Qt and KDE both support Wayland which wouldn't have access to it. So you either support Wayland and X and tell people "Well your application will work under X, but not Wayland, which is fine since we support both.. but most of our users are really on Wayland so using xembed is kind of counter productive.." or you just say "Screw it. Everyone use Status Notifiers. They work everywhere."

                      Martin's post on it: http://blog.martin-graesslin.com/blo...n-plasma-next/

                      Marco Martin's post on it: http://notmart.org/blog/2014/06/syst...-next-and-gtk/


                      (Martin, feel free to correct me on anything here, its just what ive picked up on reading the mailing lists and dev posts)

                      Comment


                      • #12
                        Ubuntu's indicators are not remotely compatible with the Statusnotifiers (they were in the past but are not anymore and won't be any time soon again).
                        You don't need KDE for the status notifiers to work. DBus is all you need. In QML an implementation could look like (and that's a fast draft):
                        DBusInterface {
                        id: dbusInterface
                        destination: "org.kde.StatusNotifierWatcher"
                        path: "/StatusNotifierWatcher"
                        iface: "org.kde.StatusNotifierWatcher"
                        signalsEnabled: true
                        function rcStatusNotifierItemRegistered() {registeredElements=dbusInterface.getProperty("Reg isteredStatusNotifierItems");}
                        function rcStatusNotifierItemUnregistered() {registeredElements=dbusInterface.getProperty("Reg isteredStatusNotifierItems");}
                        }

                        Grid {
                        columns:5;
                        spacing:5
                        Repeater {
                        model:registeredElements.length;
                        Rectangle {
                        width:settings.smallIconSize;
                        height:settings.smallIconSize;
                        color:"transparent";
                        DBusInterface {id:dBus;
                        destination:registeredElements[index].slice(0,-19);
                        path:"/StatusNotifierItem";
                        iface:"org.kde.StatusNotifierItem";
                        signalsEnabled:true;
                        Component.onCompleted: (icon.status == Image.Ready) ? icon.iconName=dBus.getProperty("IconName") : icon.iconName="error"
                        function rcNewIcon() {
                        icon.iconName=dBus.getProperty("IconName");
                        (icon.iconName == "") ? iconItem.icon=dBus.getPixmapProperty("IconPixmap") : "";}
                        }


                        Icon {id:icon;
                        width:settings.smallIconSize; height:settings.smallIconSize;
                        iconName:"user-busy"}

                        IconItem {id:iconItem;
                        width:settings.smallIconSize; height:settings.smallIconSize;
                        iconicon.iconName == "") ? dBus.getPixmapProperty("IconPixmap") : ""}
                        // Window{id:toolTip;flags:Qt.ToolTip; color:activePalette.highlight; Text{anchors.centerInarent; text:"fsdfds"}}

                        MouseArea {
                        anchors.fillarent;
                        acceptedButtons:Qt.AllButtons;
                        hoverEnabled:true;
                        onWheel: if (wheel.angleDelta.y > 0) {dBus.call("Scroll", [5, "vertical"])}
                        else if (wheel.angleDelta.y < 0) {dBus.call("Scroll", [5, "horizontal"])}
                        onPressed: {
                        var globalCoordinares = icon.mapToItem(panelBackground, 0, 0)
                        if (mouse.button == Qt.LeftButton) {dBus.call("Activate", [globalCoordinares.x, panelBackground.y])}
                        // if (mouse.button == Qt.LeftButton) {dBus.call("Activate", [globalCoordinares.x, window.y-window.height]),console.log(dBus.getProperty("IconPixmap")[0])}
                        else if (mouse.button == Qt.RightButton) {dBus.call("ContextMenu", [globalCoordinares.x, panelBackground.y-panelBackground.height])}
                        else if (mouse.button == Qt.MiddleButton) {dBus.call("SecondaryActivate", [globalCoordinares.x, panelBackground.y-panelBackground.height])}}

                        // onEntered: {console.log("X: " + globalCoordinares.x + " y: " + globalCoordinares.y)}
                        //onExited:toolTip.close()
                        }
                        }
                        }
                        }

                        Comment


                        • #13
                          Originally posted by mgraesslin View Post
                          well bugs in QSystemTrayIcon can hardly be called show-stoppers. Anyway that's a Unity issue: Unity needs to provide a PlatformTheme plugin and replace the x-embedd based icon by a status notifier. That's what we do in Plasma - Unity could even just use our code to do it.
                          If you're making a tray based program, a tray that doesn't work is exactly that, a show stopper. The other important things have already been said by others. Qt is great because it's cross platform. I use it because I can make a GUI program that compiles on multiple operating systems. Working on KDE and windows only defeats the purpose of being cross platform. I hope these issues will some day be fixed, until then, I stick to Qt 4.

                          PS: I mostly use LXDE and XFCE, not Unity.

                          Comment


                          • #14
                            Originally posted by eydee View Post
                            If you're making a tray based program, a tray that doesn't work is exactly that, a show stopper. The other important things have already been said by others. Qt is great because it's cross platform. I use it because I can make a GUI program that compiles on multiple operating systems. Working on KDE and windows only defeats the purpose of being cross platform. I hope these issues will some day be fixed, until then, I stick to Qt 4.

                            PS: I mostly use LXDE and XFCE, not Unity.
                            I just realized- wouldn't it be cool to make an application that supports the new specification and have it run AS a traditional tray icon? Then everyone could have a sort of way out until the far-flung day where we've all moved on.

                            Just a thought- it sounds plausible if this becomes a big enough problem outside of Qt alone. Until then, it would be nice to have some flexibility, since that's one of the traditional values behind Qt, anyway.

                            Comment


                            • #15
                              Originally posted by scionicspectre View Post
                              I just realized- wouldn't it be cool to make an application that supports the new specification and have it run AS a traditional tray icon? Then everyone could have a sort of way out until the far-flung day where we've all moved on.

                              Just a thought- it sounds plausible if this becomes a big enough problem outside of Qt alone. Until then, it would be nice to have some flexibility, since that's one of the traditional values behind Qt, anyway.
                              I believe that is what is already happening. The X based tray mapping is done only under X - if you were running a Qt5 application under Wayland, it would be using the newer tray standard. I think.

                              What we really want is statusnotifiers everywhere, with the xembed version being dropped entirely. They keep it for compatibility, I guess - qt5 apps are supposed to run on really old systems as long as they provide the qt5 libs. Qt5 is an open project at least, so someone can contribute an implementation where if statusnotifiers aren't available it falls back to xembed.

                              Comment

                              Working...
                              X