Announcement

Collapse
No announcement yet.

Basic widget output not showing in panel

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Basic widget output not showing in panel

    When I take the most basic QML plasmoid

    Code:
    import QtQuick 2.0
    
    Item {
        id: main
        Text {
        id: greeting
        anchors.centerIn: main
        text: "hello world"
        }
    }
    and put it on the desktop, everything looks fine. But when I put it into the panel, the output is not shown in the panel, but is only displayed when I click on the empty icon.

    Click image for larger version

Name:	widget.png
Views:	1
Size:	179.2 KB
ID:	649132

    But I want the information to be shown in the panel, just like the System Monitor plasmoids.

    When I compare my code with the System Monitors, I cannot find the crucial bit that would change the display behavior.

    Can someone tell me what's missing here?

    (And a side question: What's the best forum or mailing list to discuss Plasoid development?)

    #2
    Originally posted by ralph.b View Post
    But I want the information to be shown in the panel, just like the System Monitor plasmoids.

    When I compare my code with the System Monitors, I cannot find the crucial bit that would change the display behavior.

    Can someone tell me what's missing here?
    Development/Tutorials/Plasma5/QML2/GettingStarted: https://techbase.kde.org/Development...GettingStarted -> https://techbase.kde.org/Development...epresentations

    ... if compactRepresentation is not present, a default one will be created (the plasmoid icon) if fullRepresentation is not defined, the root item will be picked instead...
    Your code doesn't have the compactRepresentation (and the icon is not set ?) -> An empty icon will be shown when you add the plasmoid to the panel. When you click the (empty) icon the text will be shown...


    An older clock example: https://www.kubuntuforums.net/showth...p?61798-Clocks -> https://www.kubuntuforums.net/showth...l=1#post371535 -> http://askubuntu.com/questions/61124...-non-tiny-font


    /tmp/mypanelclock/metadata.desktop: http://pastebin.com/PZe812VR
    /tmp/mypanelclock/contents/ui/main.qml: http://pastebin.com/WqwD49N5
    /tmp/mypanelclock/contents/ui/CompactRepresentation.qml: http://pastebin.com/9Ky7Fgj2

    Last edited by Rog131; Sep 13, 2016, 01:11 PM.
    Before you edit, BACKUP !

    Why there are dead links ?
    1. Thread: Please explain how to access old kubuntu forum posts
    2. Thread: Lost Information

    Comment


      #3
      Originally posted by Rog131 View Post
      Development/Tutorials/Plasma5/QML2/GettingStarted: https://techbase.kde.org/Development...GettingStarted -> https://techbase.kde.org/Development...epresentations

      Your code doesn't have the compactRepresentation (and the icon is not set ?) -> An empty icon will be shown when you add the plasmoid to the panel. When you click the (empty) icon the text will be shown...
      Thanks very much for the link. I know that page and about representations, but it didn't work for me. But I'll retry if you think that's it. (But note that System Monitor CPU also does not have a compact representation as far as I can tell.)

      Comment


        #4
        Originally posted by ralph.b View Post
        Thanks very much for the link. I know that page and about representations, but it didn't work for me. But I'll retry if you think that's it. (But note that System Monitor CPU also does not have a compact representation as far as I can tell.)
        If you mean the 'org.kde.plasma.systemmonitor.cpu' - it has - /usr/share/plasma/plasmoids/org.kde.plasma.systemmonitor.cpu/contents/ui/Applet.qml:
        Code:
        Plasmoid.preferredRepresentation: plasmoid.fullRepresentation
        So - disabling the preferred representation:


        Now it will show the Icon as default.
        Last edited by Rog131; Sep 14, 2016, 01:11 AM.
        Before you edit, BACKUP !

        Why there are dead links ?
        1. Thread: Please explain how to access old kubuntu forum posts
        2. Thread: Lost Information

        Comment


          #5
          Thanks for your efforts in convincing me. OK, so any representation will do, not just compact.

          BTW, the reason it wasn't working for me when I tested with representations is that I didn't log out after installing the updated widget, so KDE used an old version without representations. Apparently that's normal behavior.

          Comment

          Working...
          X