![]() Registered Member ![]()
|
Hi, I'm starting a simple (but missing) plasmoid: Show current day of month at the panel.
To do it, I'm learning QML. After reading some tutorials and a lot of try&error, I've got the plasmoid to show current date&time, and it's refreshed on real time. But I can't get it to show only the day of the month. This is the "main.qml" I'm using:
This is the "CompactRepresentation.qml" that works (shows full date and time):
And this is the "CompactRepresentation.qml" that doesn't work (should show only the day of the month):
If run, it shows an empty plasmoid. In theory, the type of "data.Local.DateTime" is QDateTime, so it should be possible to access to its "date()" method, that returns a QDate type, and it has a "day()" method, that returns an int type. So what's wrong? Any suggestion to fix it? Thank you |
![]() KDE Developer ![]()
|
Maybe use Qt.formatDate()?
Cheers, _
anda_skoa, proud to be a member of KDE forums since 2008-Oct.
|
![]() Registered Member ![]()
|
Thank you, it worked. This is my final file "CompactRepresentation.qml":
And this is an example of my panel ("13" is the plasmoid): ![]() I'm sharing the plasmoid (file "day_of_month.zip"), for those who would like to have it in their panel: day_of_month.zip To install it, just download the file "day_of_month.zip" to some folder in your harddisk, open a shell, go to the folder and run: plasmapkg2 --install day_of_month.zip Then rigth-click on your kde panel, select "Add graphical elements", search for "Day of month", and double-click on the item found. The plasmoid will be added to your panel. Move it to your favourite place (perhaps near to the clock). |
Registered users: abc72656, Bing [Bot], daret, Google [Bot], Sogou [Bot], Yahoo [Bot]