diff options
Diffstat (limited to 'src-qt5/desktop-utils')
9 files changed, 16 insertions, 16 deletions
diff --git a/src-qt5/desktop-utils/lumina-archiver/MainUI.cpp b/src-qt5/desktop-utils/lumina-archiver/MainUI.cpp index eeb0f507..f67fc058 100644 --- a/src-qt5/desktop-utils/lumina-archiver/MainUI.cpp +++ b/src-qt5/desktop-utils/lumina-archiver/MainUI.cpp @@ -367,7 +367,7 @@ void MainUI::UpdateTree(){ } if(changed){ - int wid = ui->tree_contents->fontMetrics().width("W")*5; + int wid = ui->tree_contents->fontMetrics().horizontalAdvance("W")*5; ui->tree_contents->setColumnWidth(2, wid); for(int i=1; i<2; i++){ui->tree_contents->resizeColumnToContents(i); QApplication::processEvents(); wid+= ui->tree_contents->columnWidth(i); } //qDebug() << "Set column 0 width:" << wid << ui->tree_contents->viewport()->width(); diff --git a/src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp b/src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp index c99a781e..df5b1170 100644 --- a/src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp +++ b/src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp @@ -143,7 +143,7 @@ void MainUI::SyncFileInfo(){ } ui->label_file_owner->setText(INFO->owner()); ui->label_file_group->setText(INFO->group()); - ui->label_file_created->setText( INFO->created().toString(Qt::SystemLocaleLongDate) ); + ui->label_file_created->setText( INFO->birthTime().toString(Qt::SystemLocaleLongDate) ); ui->label_file_modified->setText( INFO->lastModified().toString(Qt::SystemLocaleLongDate) ); //Get the file permissions QString perms; @@ -220,7 +220,7 @@ void MainUI::SyncZfsInfo(){ ui->tree_zfs_snaps->clear(); for(int i=0; i<snaps.length(); i++){ QFileInfo finfo(snaps[i].section("::::",1,-1)); - ui->tree_zfs_snaps->addTopLevelItem( new QTreeWidgetItem(QStringList() << snaps[i].section("::::",0,0) << finfo.created().toString(Qt::SystemLocaleShortDate) << finfo.lastModified().toString(Qt::SystemLocaleShortDate) ) ); + ui->tree_zfs_snaps->addTopLevelItem( new QTreeWidgetItem(QStringList() << snaps[i].section("::::",0,0) << finfo.birthTime().toString(Qt::SystemLocaleShortDate) << finfo.lastModified().toString(Qt::SystemLocaleShortDate) ) ); ui->tree_zfs_snaps->resizeColumnToContents(0); } ui->tree_zfs_snaps->setVisible(!snaps.isEmpty()); diff --git a/src-qt5/desktop-utils/lumina-fm/Browser.cpp b/src-qt5/desktop-utils/lumina-fm/Browser.cpp index 26d95faa..6974208a 100644 --- a/src-qt5/desktop-utils/lumina-fm/Browser.cpp +++ b/src-qt5/desktop-utils/lumina-fm/Browser.cpp @@ -210,7 +210,7 @@ void Browser::loadDirectory(QString dir, bool force){ watcher->addPath(directory.absoluteFilePath(files[i])); QString path = directory.absoluteFilePath(files[i]); oldFiles << path; //add to list for next time - bool reloaditem = !dirupdate || lastcheck.isNull() || (QFileInfo(path).lastModified() > lastcheck || QFileInfo(path).created() > lastcheck); + bool reloaditem = !dirupdate || lastcheck.isNull() || (QFileInfo(path).lastModified() > lastcheck || QFileInfo(path).birthTime() > lastcheck); //if(dirupdate){ qDebug() << "Reload Item:" << reloaditem << path.section("/",-1); } //reloaditem = true; if(old.contains(path)){ old.removeAll(path); } //still in existance diff --git a/src-qt5/desktop-utils/lumina-fm/BrowserModel.cpp b/src-qt5/desktop-utils/lumina-fm/BrowserModel.cpp index d79da006..aeb65bae 100644 --- a/src-qt5/desktop-utils/lumina-fm/BrowserModel.cpp +++ b/src-qt5/desktop-utils/lumina-fm/BrowserModel.cpp @@ -75,7 +75,7 @@ QVariant BrowserModel::data(const QModelIndex &index, int role) const{ else if(index.column()==1){ return QVariant(info->fileSize()); } else if(index.column()==2){ return QVariant(info->mimetype()); } else if(index.column()==3){ return QVariant(info->lastModified()->toString(Qt::DefaultLocaleShortDate)); } - else if(index.column()==4){ return QVariant(info->created()->toString(Qt::DefaultLocaleShortDate)); } + else if(index.column()==4){ return QVariant(info->birthTime()->toString(Qt::DefaultLocaleShortDate)); } case Qt::ToolTipRole: return QVariant(info->absoluteFilePath()); case Qt::StatusTipRole: diff --git a/src-qt5/desktop-utils/lumina-fm/BrowserWidget.cpp b/src-qt5/desktop-utils/lumina-fm/BrowserWidget.cpp index 65dbdb16..45f3d3e1 100644 --- a/src-qt5/desktop-utils/lumina-fm/BrowserWidget.cpp +++ b/src-qt5/desktop-utils/lumina-fm/BrowserWidget.cpp @@ -103,7 +103,7 @@ void BrowserWidget::showDetails(bool show){ connect(treeWidget, SIGNAL(sortColumnChanged(int)), this, SIGNAL(setTreeWidgetSortColumn(int, bool)) ); retranslate(); treeWidget->sortItems(treeSortColumn, Qt::AscendingOrder); - treeWidget->setColumnWidth(0, treeWidget->fontMetrics().width("W")*20); + treeWidget->setColumnWidth(0, treeWidget->fontMetrics().horizontalAdvance("W")*20); if(!BROWSER->currentDirectory().isEmpty()){ emit dirChange("", true); } }else if(!show && listWidget==0){ listWidget = new DDListWidget(this); @@ -405,11 +405,11 @@ void BrowserWidget::itemDataAvailable(const QIcon* ico, LFileInfo *info){ it->setText(1, info->isDir() ? "" : LUtils::BytesToDisplaySize(info->size()) ); //size (1) it->setText(2, info->mimetype() ); //type (2) it->setText(3, DTtoString(info->lastModified() )); //modification date (3) - it->setText(4, DTtoString(info->created()) ); //creation date (4) + it->setText(4, DTtoString(info->birthTime()) ); //creation date (4) //Now all the hidden data it->setWhatsThis(0, info->absoluteFilePath()); it->setWhatsThis(3, info->lastModified().toString("yyyyMMddhhmmsszzz") ); //sorts by this actually - it->setWhatsThis(4, info->created().toString("yyyyMMddhhmmsszzz") ); //sorts by this actually + it->setWhatsThis(4, info->birthTime().toString("yyyyMMddhhmmsszzz") ); //sorts by this actually num = treeWidget->topLevelItemCount(); } if(num < numItems){ diff --git a/src-qt5/desktop-utils/lumina-fm/ScrollDialog.h b/src-qt5/desktop-utils/lumina-fm/ScrollDialog.h index eefe62f4..27f40c24 100644 --- a/src-qt5/desktop-utils/lumina-fm/ScrollDialog.h +++ b/src-qt5/desktop-utils/lumina-fm/ScrollDialog.h @@ -48,7 +48,7 @@ public: void setText(QString txt){ label->setPlainText(txt); - //this->resize( label->fontMetrics().width(txt.section("\n",0,0))+30, this->height()); + //this->resize( label->fontMetrics().horizontalAdvance(txt.section("\n",0,0))+30, this->height()); } }; diff --git a/src-qt5/desktop-utils/lumina-screenshot/MainUI.cpp b/src-qt5/desktop-utils/lumina-screenshot/MainUI.cpp index 88192943..5e859f73 100644 --- a/src-qt5/desktop-utils/lumina-screenshot/MainUI.cpp +++ b/src-qt5/desktop-utils/lumina-screenshot/MainUI.cpp @@ -22,9 +22,9 @@ MainUI::MainUI() IMG = new ImageEditor(this); ui->scrollArea->setWidget(IMG); areaOverlay = 0; - ui->label_zoom_percent->setMinimumWidth( ui->label_zoom_percent->fontMetrics().width("200%") ); + ui->label_zoom_percent->setMinimumWidth( ui->label_zoom_percent->fontMetrics().horizontalAdvance("200%") ); setupIcons(); - ui->spin_monitor->setMaximum(QApplication::desktop()->screenCount()); + ui->spin_monitor->setMaximum(QGuiApplication::screens().count()); if(ui->spin_monitor->maximum()<2){ ui->spin_monitor->setEnabled(false); ui->radio_monitor->setEnabled(false); @@ -241,7 +241,7 @@ void MainUI::getPixmap(){ //Grab the whole screen cpic = scrn->grabWindow(QApplication::desktop()->winId()); }else if(cwin==0 && ui->radio_monitor->isChecked()){ - QRect geom = QApplication::desktop()->screenGeometry(ui->spin_monitor->value()-1); + QRect geom = QGuiApplication::screens().at(ui->spin_monitor->value()-1)->availableGeometry(); cpic = scrn->grabWindow(QApplication::desktop()->winId(), geom.x(), geom.y(), geom.width(), geom.height() ); }else if(cwin==0 && ui->radio_area->isChecked()){ //Grab the section of the screen which was selected @@ -329,7 +329,7 @@ void MainUI::closeEvent(QCloseEvent *ev){ //qDebug() << "Close Event:" << ui->check_show_popups->isChecked() << picSaved; if(ui->check_show_popups->isChecked() && !picSaved){ //Ask what to do about the unsaved changed - QMessageBox dialog( QMessageBox::Warning, tr("Unsaved Screenshot"), + QMessageBox dialog( QMessageBox::Warning, tr("Unsaved Screenshot"), tr("The current screenshot has not been saved yet. Do you want to save or discard your changes?"), QMessageBox::Discard | QMessageBox::Save | QMessageBox::Cancel, this); dialog.setDefaultButton(QMessageBox::Cancel); diff --git a/src-qt5/desktop-utils/lumina-textedit/PlainTextEditor.cpp b/src-qt5/desktop-utils/lumina-textedit/PlainTextEditor.cpp index 07b99f27..0aedb1a0 100644 --- a/src-qt5/desktop-utils/lumina-textedit/PlainTextEditor.cpp +++ b/src-qt5/desktop-utils/lumina-textedit/PlainTextEditor.cpp @@ -30,7 +30,7 @@ PlainTextEditor::PlainTextEditor(QSettings *set, QWidget *parent) : QPlainTextEd hasChanges = readonly = false; lastSaveContents.clear(); matchleft = matchright = -1; - this->setTabStopWidth( 8 * this->fontMetrics().width(" ") ); //8 character spaces per tab (UNIX standard) + this->setTabStopDistance( 8 * QFontMetricsF(this->font()).width(' ') ); //8 character spaces per tab (UNIX standard) //this->setObjectName("PlainTextEditor"); //this->setStyleSheet("QPlainTextEdit#PlainTextEditor{ }"); SYNTAX = new Custom_Syntax(settings, this->document()); @@ -171,7 +171,7 @@ int PlainTextEditor::LNWWidth(){ //qDebug() << "point 1" << this->document()->defaultFont(); while(lines>=10){ chars++; lines/=10; } QFontMetrics metrics(this->document()->defaultFont()); - return (metrics.width("9")*chars); //make sure to add a tiny bit of padding + return (metrics.horizontalAdvance("9")*chars); //make sure to add a tiny bit of padding } void PlainTextEditor::paintLNW(QPaintEvent *ev){ diff --git a/src-qt5/desktop-utils/lumina-textedit/syntaxSupport.cpp b/src-qt5/desktop-utils/lumina-textedit/syntaxSupport.cpp index 6a3acfed..fa6ed8f4 100644 --- a/src-qt5/desktop-utils/lumina-textedit/syntaxSupport.cpp +++ b/src-qt5/desktop-utils/lumina-textedit/syntaxSupport.cpp @@ -75,7 +75,7 @@ void SyntaxFile::SetupDocument(QPlainTextEdit* editor){ if(formatObj.contains("tab_width")){ int num = formatObj.value("tab_width").toInt(); if(num<=0){ num = 8; } //UNIX Standard of 8 characters per tab - editor->setTabStopWidth( num * QFontMetrics(editor->document()->defaultFont()).width(" ") ); + editor->setTabStopDistance( num * QFontMetricsF(editor->document()->defaultFont() ).width(" ") ); } } |