aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/lumina-desktop/panel-plugins/clock/LClock.cpp
diff options
context:
space:
mode:
authorKen Moore <ken@ixsystems.com>2019-10-29 08:16:05 -0400
committerGitHub <noreply@github.com>2019-10-29 08:16:05 -0400
commitbbf4e940ff2e1c257ffd78c10d85b3681eb72f46 (patch)
tree480c429c743606f09a837ebc652ca57a69c42119 /src-qt5/core/lumina-desktop/panel-plugins/clock/LClock.cpp
parentMerge pull request #705 from lbartoletti/shortcut_lumina_photo (diff)
parentremove QSignalMapper. Use lambda func instead. (diff)
downloadlumina-bbf4e940ff2e1c257ffd78c10d85b3681eb72f46.tar.gz
lumina-bbf4e940ff2e1c257ffd78c10d85b3681eb72f46.tar.bz2
lumina-bbf4e940ff2e1c257ffd78c10d85b3681eb72f46.zip
Merge pull request #706 from lbartoletti/fix_deprecated
Fix deprecated
Diffstat (limited to 'src-qt5/core/lumina-desktop/panel-plugins/clock/LClock.cpp')
-rw-r--r--src-qt5/core/lumina-desktop/panel-plugins/clock/LClock.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src-qt5/core/lumina-desktop/panel-plugins/clock/LClock.cpp b/src-qt5/core/lumina-desktop/panel-plugins/clock/LClock.cpp
index 2972ea86..d45853d1 100644
--- a/src-qt5/core/lumina-desktop/panel-plugins/clock/LClock.cpp
+++ b/src-qt5/core/lumina-desktop/panel-plugins/clock/LClock.cpp
@@ -79,7 +79,7 @@ void LClock::updateTime(bool adjustformat){
if( this->layout()->direction() == QBoxLayout::TopToBottom ){
//different routine for vertical text (need newlines instead of spaces)
for(int i=0; i<label.count("\n")+1; i++){
- if(this->size().width() < (this->fontMetrics().width(label.section("\n",i,i))+10 )&& label.section("\n",i,i).contains(" ")){
+ if(this->size().width() < (this->fontMetrics().horizontalAdvance(label.section("\n",i,i))+10 )&& label.section("\n",i,i).contains(" ")){
label.replace(label.section("\n",i,i), label.section("\n",i,i).replace(" ", "\n"));
i--;
}
@@ -100,12 +100,12 @@ void LClock::updateTime(bool adjustformat){
int wid = 0;
int lwid = 0;
for(int i=0; i<lines.length(); i++){
- lwid = metrics.width(lines[i]);
+ lwid = metrics.horizontalAdvance(lines[i]);
if(lwid>wid){ wid = lwid; }
}
qDebug() << "Verify Clock width:" << lines.length() << wid << lines;
this->setMinimumWidth(wid);
- this->setMaximumWidth(wid + (4*metrics.width("O")));
+ this->setMaximumWidth(wid + (4*metrics.horizontalAdvance("O")));
}else{
//vertical layout
this->setMinimumHeight(metrics.lineSpacing() * lines.length());
bgstack15