how to convert these 3 pages of kde plasmoid 5 to plasmoid 6

I have a plasmoid written for kde 5.0 and now it doesn’t work under kde 6.0. please help me convert it to plasmoid version 6.0. I have tried my best debugging using plasmawindowed and plasmoidviewer:

config.qml:

import QtQuick 2.15
import org.kde.plasma.configuration 2.1

ConfigModel {
  ConfigCategory {
    name: "General"
    icon: "go-home"
    source: "config/general.qml"
  }
}

general.qml

import QtQuick 2.15
import QtQuick.Layouts 1.15
import QtQuick.Controls 2.15
import org.kde.plasma.plasmoid 2.1
import org.kde.plasma.core 2.1 as PlasmaCore
import org.kde.plasma.components 3.1 as PlasmaComponents

Item {
    property alias cfg_widgetWidth: widgetWidth.value
    property alias cfg_showTooltip: showTooltip.checked
    property alias cfg_updateInterval: updateInterval.value
    property alias cfg_mainText: mainText.text
    property alias cfg_tooltipText: tooltipText.text

    anchors.centerIn: parent

    ColumnLayout {

        RowLayout {
            Label { text: "Widget width" }
            SpinBox {
                id: widgetWidth
                from: 10
                to: 10000
                stepSize: 10
                suffix: ""
            }
        }

        RowLayout {
            CheckBox {
                id: showTooltip
                text: "Show tooltip"
            }
        }

        RowLayout {
            Label { text: "Update Interval (seconds)" }
            SpinBox {
                id: updateInterval
                from: 0.001
                to: 86399
                stepSize: 1
                suffix: " s"
            }
        }

        RowLayout {
            Label { text: "Main" }
            TextField {
                id: mainText
                Layout.fillWidth: true
                placeholderText: "HTML & CSS are supported"
                text: ""
            }
        }

        RowLayout {
            Label { text: "Tooltip" }
            TextField {
                id: tooltipText
                Layout.fillWidth: true
                placeholderText: "HTML & CSS are supported"
                text: ""
            }
        }
    }
}

main.qml

import QtQuick 2.15
import QtQuick.Layouts 1.15
import org.kde.plasma.plasmoid 2.1
import org.kde.plasma.core 2.1 as PlasmaCore
import org.kde.plasma.components 3.1 as PlasmaComponents

import "../lib/pdp.js" as Parser

Item {
    id: root

    property bool showTooltip: plasmoid.configuration.showTooltip
    property int updateInterval: plasmoid.configuration.updateInterval * 1000
    property int widgetWidth: plasmoid.configuration.widgetWidth
    property string mainText: plasmoid.configuration.mainText
    property string tooltipText: plasmoid.configuration.tooltipText

    Plasmoid.preferredRepresentation: Plasmoid.fullRepresentation
    Layout.preferredHeight: persianDateLabel.height + 8
    Layout.preferredWidth: widgetWidth
    Layout.maximumHeight: persianDateLabel.height + 8
    Layout.maximumWidth: widgetWidth
    anchors.left: parent.left

    FontLoader {
        source: "../fonts/Vazir.ttf"
    }

    PlasmaCore.DataSource {
        id: localTime
        engine: "time"
        connectedSources: ["Local"]
        interval: updateInterval
    }
    
    PlasmaComponents.Label {
        id: persianDateLabel
        smooth: true
        font.family: "Vazir"
        font.pointSize: -1
        font.pixelSize: parent.height * 0.6
        textFormat: Text.RichText
        text: Parser.parse(mainText, localTime.data.Local.DateTime, true)
        wrapMode: Text.NoWrap
        anchors.centerIn: parent
    }

    PlasmaCore.ToolTipArea {
        anchors.fill: parent
        visible: showTooltip
        textFormat: Text.RichText
        mainText: ""
        subText: Parser.parse(tooltipText, localTime.data.Local.DateTime, true)
    }
}

I have used ChatGPT but the answer doesn’t work.

I tried ChatGPT but it didn’t work. Manual debugging didn’t work as well.

New contributor

Masoud Yousefvand is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật