diff --git a/src/Gui/Action.cpp b/src/Gui/Action.cpp index 689fd2ee11..a1ca5fe9ea 100644 --- a/src/Gui/Action.cpp +++ b/src/Gui/Action.cpp @@ -25,6 +25,7 @@ #ifndef _PreComp_ # include +# include # include # include # include diff --git a/src/Gui/CommandView.cpp b/src/Gui/CommandView.cpp index c98678f9a6..01043608d1 100644 --- a/src/Gui/CommandView.cpp +++ b/src/Gui/CommandView.cpp @@ -2852,7 +2852,7 @@ void StdBoxSelection::activated(int iMsg) // Std_BoxElementSelection //=========================================================================== /* XPM */ -static char * cursor_box_element_select[] = { +static const char * cursor_box_element_select[] = { "32 32 6 1", " c None", ". c #FFFFFF", diff --git a/src/Gui/DlgActionsImp.cpp b/src/Gui/DlgActionsImp.cpp index 2621398440..b28c8f45c4 100644 --- a/src/Gui/DlgActionsImp.cpp +++ b/src/Gui/DlgActionsImp.cpp @@ -541,7 +541,7 @@ IconFolders::IconFolders(const QStringList& paths, QWidget* parent) removeButton->hide(); } - buttonMap.append(qMakePair(edit, removeButton)); + buttonMap.append(qMakePair(edit, removeButton)); connect(removeButton, SIGNAL(clicked()), this, SLOT(removeFolder())); } diff --git a/src/Gui/DlgEditFileIncludePropertyExternal.cpp b/src/Gui/DlgEditFileIncludePropertyExternal.cpp index b9d3be6301..82cdb62c7e 100644 --- a/src/Gui/DlgEditFileIncludePropertyExternal.cpp +++ b/src/Gui/DlgEditFileIncludePropertyExternal.cpp @@ -57,7 +57,7 @@ DlgEditFileIncludePropertyExternal::~DlgEditFileIncludePropertyExternal() int DlgEditFileIncludePropertyExternal::processFile() { - QFileInfo file = QString::fromUtf8(Prop.getValue()); + QFileInfo file(QString::fromUtf8(Prop.getValue())); assert(file.exists()); QDir tmp = QString::fromUtf8(App::Application::getUserCachePath().c_str()); diff --git a/src/Gui/DlgRevertToBackupConfigImp.cpp b/src/Gui/DlgRevertToBackupConfigImp.cpp index 073ce0a699..d7ed22d7ad 100644 --- a/src/Gui/DlgRevertToBackupConfigImp.cpp +++ b/src/Gui/DlgRevertToBackupConfigImp.cpp @@ -79,7 +79,7 @@ void DlgRevertToBackupConfigImp::showEvent(QShowEvent* event) const auto& backups = Application::Instance->prefPackManager()->configBackups(); for (const auto& backup : backups) { auto filename = backup.filename().string(); - auto modification_date = QDateTime::fromTime_t(fs::last_write_time(backup)); + auto modification_date = QDateTime::fromSecsSinceEpoch(fs::last_write_time(backup)); auto item = new QListWidgetItem(QLocale().toString(modification_date)); item->setData(Qt::UserRole, QString::fromStdString(backup.string())); ui->listWidget->addItem(item); diff --git a/src/Gui/DocumentRecovery.cpp b/src/Gui/DocumentRecovery.cpp index cf14da33b7..c2e40ba6bf 100644 --- a/src/Gui/DocumentRecovery.cpp +++ b/src/Gui/DocumentRecovery.cpp @@ -331,7 +331,7 @@ void DocumentRecovery::accept() << docs[i]->Label.getValue() << "'"); } else { - DocumentRecoveryCleaner().clearDirectory(xfi.absolutePath()); + DocumentRecoveryCleaner().clearDirectory(QFileInfo(xfi.absolutePath())); QDir().rmdir(xfi.absolutePath()); } diff --git a/src/Gui/DownloadManager.cpp b/src/Gui/DownloadManager.cpp index a4a62c569d..98a76aa0b8 100644 --- a/src/Gui/DownloadManager.cpp +++ b/src/Gui/DownloadManager.cpp @@ -188,7 +188,7 @@ void DownloadManager::updateRow() return; if (!m_iconProvider) m_iconProvider = new QFileIconProvider(); - QIcon icon = m_iconProvider->icon(item->m_output.fileName()); + QIcon icon = m_iconProvider->icon(QFileInfo(item->m_output.fileName())); if (icon.isNull()) icon = style()->standardIcon(QStyle::SP_FileIcon); item->fileIcon->setPixmap(icon.pixmap(48, 48)); diff --git a/src/Gui/EditorView.cpp b/src/Gui/EditorView.cpp index 5ed2f396e8..9699b4a239 100644 --- a/src/Gui/EditorView.cpp +++ b/src/Gui/EditorView.cpp @@ -65,7 +65,7 @@ public: QString fileName; EditorView::DisplayName displayName; QTimer* activityTimer; - uint timeStamp; + qint64 timeStamp; bool lock; bool aboutToClose; QStringList undos; @@ -191,7 +191,7 @@ void EditorView::OnChange(Base::Subject &rCaller,const char* rcReas void EditorView::checkTimestamp() { QFileInfo fi(d->fileName); - uint timeStamp = fi.lastModified().toTime_t(); + qint64 timeStamp = fi.lastModified().toSecsSinceEpoch(); if (timeStamp != d->timeStamp) { switch( QMessageBox::question( this, tr("Modified file"), tr("%1.\n\nThis has been modified outside of the source editor. Do you want to reload it?").arg(d->fileName), @@ -369,7 +369,7 @@ bool EditorView::open(const QString& fileName) file.close(); QFileInfo fi(fileName); - d->timeStamp = fi.lastModified().toTime_t(); + d->timeStamp = fi.lastModified().toSecsSinceEpoch(); d->activityTimer->setSingleShot(true); d->activityTimer->start(3000); @@ -530,7 +530,7 @@ bool EditorView::saveFile() d->textEdit->document()->setModified(false); QFileInfo fi(d->fileName); - d->timeStamp = fi.lastModified().toTime_t(); + d->timeStamp = fi.lastModified().toSecsSinceEpoch(); return true; } diff --git a/src/Gui/GuiApplication.cpp b/src/Gui/GuiApplication.cpp index 418a35aab2..423aed65ef 100644 --- a/src/Gui/GuiApplication.cpp +++ b/src/Gui/GuiApplication.cpp @@ -60,8 +60,8 @@ using namespace Gui; GUIApplication::GUIApplication(int & argc, char ** argv) : GUIApplicationNativeEventAware(argc, argv) { - connect(this, SIGNAL(commitDataRequest(QSessionManager &)), - SLOT(commitData(QSessionManager &)), Qt::DirectConnection); + connect(this, SIGNAL(commitDataRequest(QSessionManager&)), + SLOT(commitData(QSessionManager&)), Qt::DirectConnection); #if QT_VERSION < QT_VERSION_CHECK(6,0,0) setFallbackSessionManagementEnabled(false); #endif diff --git a/src/Gui/NaviCube.cpp b/src/Gui/NaviCube.cpp index 86b86ef0d3..4938d2d774 100644 --- a/src/Gui/NaviCube.cpp +++ b/src/Gui/NaviCube.cpp @@ -144,7 +144,7 @@ private: SbRotation rotateView(SbRotation, int axis, float rotAngle, SbVec3f customAxis = SbVec3f(0, 0, 0)) const; void rotateView(const SbRotation&); - QString str(char* str); + QString str(const char* str); char* enum2str(int); QMenu* createNaviCubeMenu(); public: @@ -1674,7 +1674,7 @@ bool NaviCubeImplementation::processSoEvent(const SoEvent* ev) { } -QString NaviCubeImplementation::str(char* str) { +QString NaviCubeImplementation::str(const char* str) { return QString::fromLatin1(str); } diff --git a/src/Gui/QSint/actionpanel/actionlabel.cpp b/src/Gui/QSint/actionpanel/actionlabel.cpp index 71f5b1e69d..7b1e60d951 100644 --- a/src/Gui/QSint/actionpanel/actionlabel.cpp +++ b/src/Gui/QSint/actionpanel/actionlabel.cpp @@ -105,8 +105,7 @@ QSize ActionLabel::sizeHint() const h += 4; w += 8; - QSize sizeHint = (style()->sizeFromContents(QStyle::CT_PushButton, &opt, QSize(w, h), this). - expandedTo(QApplication::globalStrut())); + QSize sizeHint = style()->sizeFromContents(QStyle::CT_PushButton, &opt, QSize(w, h), this); return sizeHint; } diff --git a/src/Gui/QuantitySpinBox.cpp b/src/Gui/QuantitySpinBox.cpp index 22039421b8..a28b184859 100644 --- a/src/Gui/QuantitySpinBox.cpp +++ b/src/Gui/QuantitySpinBox.cpp @@ -720,8 +720,7 @@ QSize QuantitySpinBox::sizeForText(const QString& txt) const QStyleOptionSpinBox opt; initStyleOption(&opt); QSize hint(w, h); - QSize size = style()->sizeFromContents(QStyle::CT_SpinBox, &opt, hint, this) - .expandedTo(QApplication::globalStrut()); + QSize size = style()->sizeFromContents(QStyle::CT_SpinBox, &opt, hint, this); return size; } @@ -750,8 +749,7 @@ QSize QuantitySpinBox::sizeHint() const QStyleOptionSpinBox opt; initStyleOption(&opt); QSize hint(w, h); - QSize size = style()->sizeFromContents(QStyle::CT_SpinBox, &opt, hint, this) - .expandedTo(QApplication::globalStrut()); + QSize size = style()->sizeFromContents(QStyle::CT_SpinBox, &opt, hint, this); return size; } @@ -781,8 +779,7 @@ QSize QuantitySpinBox::minimumSizeHint() const initStyleOption(&opt); QSize hint(w, h); - QSize size = style()->sizeFromContents(QStyle::CT_SpinBox, &opt, hint, this) - .expandedTo(QApplication::globalStrut()); + QSize size = style()->sizeFromContents(QStyle::CT_SpinBox, &opt, hint, this); return size; } diff --git a/src/Gui/Quarter/ContextMenu.cpp b/src/Gui/Quarter/ContextMenu.cpp index c85daca085..3b9c54cda0 100644 --- a/src/Gui/Quarter/ContextMenu.cpp +++ b/src/Gui/Quarter/ContextMenu.cpp @@ -31,6 +31,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \**************************************************************************/ +#include #include #include "ContextMenu.h" diff --git a/src/Gui/Quarter/QuarterWidgetP.cpp b/src/Gui/Quarter/QuarterWidgetP.cpp index c7031c4452..5f3267e5c8 100644 --- a/src/Gui/Quarter/QuarterWidgetP.cpp +++ b/src/Gui/Quarter/QuarterWidgetP.cpp @@ -38,6 +38,7 @@ #include "QuarterWidget.h" #include "eventhandlers/EventFilter.h" +#include #include #include #include diff --git a/src/Gui/SceneInspector.cpp b/src/Gui/SceneInspector.cpp index fa2bff7173..8871979d6d 100644 --- a/src/Gui/SceneInspector.cpp +++ b/src/Gui/SceneInspector.cpp @@ -91,7 +91,7 @@ void SceneModel::setNode(SoNode* node) void SceneModel::setNode(QModelIndex index, SoNode* node) { - this->setData(index, QVariant(QString::fromLatin1(node->getTypeId().getName()))); + this->setData(index, QVariant(QString::fromLatin1(QByteArray(node->getTypeId().getName())))); if (node->getTypeId().isDerivedFrom(SoGroup::getClassTypeId())) { auto group = static_cast(node); // insert SoGroup icon diff --git a/src/Gui/SoTextLabel.cpp b/src/Gui/SoTextLabel.cpp index 759ab9191c..62e2f0d8ee 100644 --- a/src/Gui/SoTextLabel.cpp +++ b/src/Gui/SoTextLabel.cpp @@ -407,7 +407,7 @@ void SoFrameLabel::drawImage() return; } - QFont font(QString::fromLatin1(name.getValue()), size.getValue()); + QFont font(QString::fromLatin1(QByteArray(name.getValue())), size.getValue()); QFontMetrics fm(font); int w = 0; int h = fm.height() * num; diff --git a/src/Gui/View3DInventor.cpp b/src/Gui/View3DInventor.cpp index c02cf12cf4..5aeb8954e4 100644 --- a/src/Gui/View3DInventor.cpp +++ b/src/Gui/View3DInventor.cpp @@ -872,7 +872,7 @@ void View3DInventor::windowStateChanged(MDIView* view) // must be hidden, hence we can start the timer. // Note: If view is top-level or fullscreen it doesn't necessarily hide the other view // e.g. if it is on a second monitor. - canStartTimer = (!this->isTopLevel() && !view->isTopLevel() && view->isMaximized()); + canStartTimer = (!this->isWindow() && !view->isWindow() && view->isMaximized()); } else if (isMinimized()) { // I am the active view but minimized canStartTimer = true; diff --git a/src/Tools/plugins/widget/customwidgets.cpp b/src/Tools/plugins/widget/customwidgets.cpp index 5c918d01e7..b31ecae8f7 100644 --- a/src/Tools/plugins/widget/customwidgets.cpp +++ b/src/Tools/plugins/widget/customwidgets.cpp @@ -1167,8 +1167,7 @@ QSize QuantitySpinBox::sizeHint() const QStyleOptionSpinBox opt; initStyleOption(&opt); QSize hint(w, h); - QSize size = style()->sizeFromContents(QStyle::CT_SpinBox, &opt, hint, this) - .expandedTo(QApplication::globalStrut()); + QSize size = style()->sizeFromContents(QStyle::CT_SpinBox, &opt, hint, this); return size; } @@ -1198,8 +1197,7 @@ QSize QuantitySpinBox::minimumSizeHint() const QStyleOptionSpinBox opt; initStyleOption(&opt); QSize hint(w, h); - QSize size = style()->sizeFromContents(QStyle::CT_SpinBox, &opt, hint, this) - .expandedTo(QApplication::globalStrut()); + QSize size = style()->sizeFromContents(QStyle::CT_SpinBox, &opt, hint, this); return size; }