From 55e7cd4bab104417eb85c834dac525217da2c3c0 Mon Sep 17 00:00:00 2001 From: leo Date: Tue, 16 Feb 2016 23:11:52 +0000 Subject: [PATCH] Warning fixes for VS 2015. --- common/image.cpp | 2 +- common/lc_application.cpp | 4 ++-- common/lc_category.cpp | 26 ++++++++++++++------------ common/lc_category.h | 2 +- common/lc_file.cpp | 12 ++++++------ common/lc_file.h | 12 ++++++------ common/lc_glextensions.cpp | 7 +++++++ common/lc_glwidget.h | 2 +- common/lc_library.cpp | 10 +++++----- common/lc_mainwindow.cpp | 6 ++++-- common/lc_mesh.cpp | 2 +- common/lc_model.cpp | 10 +++++----- common/lc_model.h | 4 ++-- common/lc_profile.cpp | 11 ----------- common/lc_profile.h | 1 - common/lc_shortcuts.cpp | 2 ++ common/light.cpp | 1 + common/minifig.cpp | 2 +- common/piece.h | 2 ++ common/project.cpp | 2 +- common/str.h | 10 +--------- common/texfont.cpp | 2 +- qt/lc_qaboutdialog.cpp | 2 +- qt/lc_qaboutdialog.h | 2 +- qt/lc_qcolorlist.cpp | 2 ++ qt/lc_qeditgroupsdialog.cpp | 6 ++++++ qt/lc_qmodellistdialog.cpp | 2 ++ qt/lc_qpartstree.cpp | 4 +++- qt/lc_qpreferencesdialog.cpp | 2 ++ qt/lc_qpropertiestree.cpp | 6 ++++++ qt/lc_qselectdialog.cpp | 2 ++ qt/lc_qupdatedialog.cpp | 2 ++ 32 files changed, 91 insertions(+), 71 deletions(-) diff --git a/common/image.cpp b/common/image.cpp index 4a955531..fc4c40aa 100644 --- a/common/image.cpp +++ b/common/image.cpp @@ -149,7 +149,7 @@ bool Image::FileLoad(lcMemFile& File) QImage Image; unsigned char* Buffer = File.mBuffer + File.mPosition; - int BufferLength = File.mFileSize - File.mPosition; + size_t BufferLength = File.mFileSize - File.mPosition; if (!Image.loadFromData(Buffer, BufferLength)) return false; diff --git a/common/lc_application.cpp b/common/lc_application.cpp index 822f1765..4cf208fd 100644 --- a/common/lc_application.cpp +++ b/common/lc_application.cpp @@ -133,7 +133,7 @@ bool lcApplication::LoadPiecesLibrary(const char* LibPath, const char* LibraryIn strcpy(LibraryPath, LibraryInstallPath); - int i = strlen(LibraryPath) - 1; + size_t i = strlen(LibraryPath) - 1; if ((LibraryPath[i] != '\\') && (LibraryPath[i] != '/')) strcat(LibraryPath, "/"); @@ -152,7 +152,7 @@ bool lcApplication::LoadPiecesLibrary(const char* LibPath, const char* LibraryIn strcpy(LibraryPath, LDrawPath); - int i = strlen(LibraryPath) - 1; + size_t i = strlen(LibraryPath) - 1; if ((LibraryPath[i] != '\\') && (LibraryPath[i] != '/')) strcat(LibraryPath, "/"); diff --git a/common/lc_category.cpp b/common/lc_category.cpp index b76d7209..265582a2 100644 --- a/common/lc_category.cpp +++ b/common/lc_category.cpp @@ -24,11 +24,12 @@ void lcLoadDefaultCategories(bool BuiltInLibrary) void lcSaveDefaultCategories() { - lcMemFile File; + QByteArray ByteArray; + QTextStream Stream(&ByteArray, QIODevice::WriteOnly); - lcSaveCategories(File, gCategories); + lcSaveCategories(Stream, gCategories); - lcSetProfileBuffer(LC_PROFILE_CATEGORIES, File); + lcSetProfileBuffer(LC_PROFILE_CATEGORIES, ByteArray); } void lcResetCategories(lcArray& Categories, bool BuiltInLibrary) @@ -130,26 +131,27 @@ bool lcLoadCategories(lcFile& File, lcArray& Categories) bool lcSaveCategories(const QString& FileName, const lcArray& Categories) { - lcDiskFile File; + QFile File(FileName); - if (!File.Open(FileName, "wt")) + if (!File.open(QIODevice::WriteOnly)) return false; - return lcSaveCategories(File, Categories); + QTextStream Stream(&File); + + return lcSaveCategories(Stream, Categories); } -bool lcSaveCategories(lcFile& File, const lcArray& Categories) +bool lcSaveCategories(QTextStream& Stream, const lcArray& Categories) { - char Line[1024]; + QString Format("%1=%2\r\n"); for (int CategoryIdx = 0; CategoryIdx < Categories.GetSize(); CategoryIdx++) { lcLibraryCategory& Category = Categories[CategoryIdx]; - - sprintf(Line, "%s=%s\n", (const char*)Category.Name, (const char*)Category.Keywords); - - File.WriteLine(Line); + Stream << Format.arg((const char*)Category.Name, (const char*)Category.Keywords); } + Stream.flush(); + return true; } diff --git a/common/lc_category.h b/common/lc_category.h index 33fe9fab..8ac366e5 100644 --- a/common/lc_category.h +++ b/common/lc_category.h @@ -20,6 +20,6 @@ void lcResetCategories(lcArray& Categories, bool BuiltInLibra bool lcLoadCategories(const QString& FileName, lcArray& Categories); bool lcLoadCategories(lcFile& File, lcArray& Categories); bool lcSaveCategories(const QString& FileName, const lcArray& Categories); -bool lcSaveCategories(lcFile& File, const lcArray& Categories); +bool lcSaveCategories(QTextStream& Stream, const lcArray& Categories); #endif // _LC_CATEGORY_H_ diff --git a/common/lc_file.cpp b/common/lc_file.cpp index 08735c82..139ddc67 100644 --- a/common/lc_file.cpp +++ b/common/lc_file.cpp @@ -80,7 +80,7 @@ void lcMemFile::Close() mBuffer = NULL; } -size_t lcMemFile::ReadBuffer(void* Buffer, long Bytes) +size_t lcMemFile::ReadBuffer(void* Buffer, size_t Bytes) { if (Bytes == 0 || mPosition > mFileSize) return 0; @@ -98,7 +98,7 @@ size_t lcMemFile::ReadBuffer(void* Buffer, long Bytes) return BytesToRead; } -size_t lcMemFile::WriteBuffer(const void* Buffer, long Bytes) +size_t lcMemFile::WriteBuffer(const void* Buffer, size_t Bytes) { if (Bytes == 0) return 0; @@ -238,14 +238,14 @@ void lcDiskFile::Close() mFile = NULL; } -size_t lcDiskFile::ReadBuffer(void* pBuf, long Bytes) +size_t lcDiskFile::ReadBuffer(void* Buffer, size_t Bytes) { - return fread(pBuf, 1, Bytes, mFile); + return fread(Buffer, 1, Bytes, mFile); } -size_t lcDiskFile::WriteBuffer(const void* pBuf, long Bytes) +size_t lcDiskFile::WriteBuffer(const void* Buffer, size_t Bytes) { - return fwrite(pBuf, 1, Bytes, mFile); + return fwrite(Buffer, 1, Bytes, mFile); } bool lcDiskFile::Open(const QString& FileName, const char* Mode) diff --git a/common/lc_file.h b/common/lc_file.h index b8805aad..200beba4 100644 --- a/common/lc_file.h +++ b/common/lc_file.h @@ -28,8 +28,8 @@ public: WriteBuffer(Buffer, strlen(Buffer)); } - virtual size_t ReadBuffer(void* Buffer, long Bytes) = 0; - virtual size_t WriteBuffer(const void* Buffer, long Bytes) = 0; + virtual size_t ReadBuffer(void* Buffer, size_t Bytes) = 0; + virtual size_t WriteBuffer(const void* Buffer, size_t Bytes) = 0; virtual void CopyFrom(lcMemFile& Source) = 0; lcuint8 ReadU8() @@ -447,8 +447,8 @@ public: void Close(); char* ReadLine(char* Buffer, size_t BufferSize); - size_t ReadBuffer(void* Buffer, long Bytes); - size_t WriteBuffer(const void* Buffer, long Bytes); + size_t ReadBuffer(void* Buffer, size_t Bytes); + size_t WriteBuffer(const void* Buffer, size_t Bytes); void CopyFrom(lcFile& Source); void CopyFrom(lcMemFile& Source); @@ -476,8 +476,8 @@ public: void Close(); char* ReadLine(char* Buffer, size_t BufferSize); - size_t ReadBuffer(void* Buffer, long Bytes); - size_t WriteBuffer(const void* Buffer, long Bytes); + size_t ReadBuffer(void* Buffer, size_t Bytes); + size_t WriteBuffer(const void* Buffer, size_t Bytes); void CopyFrom(lcMemFile& Source); diff --git a/common/lc_glextensions.cpp b/common/lc_glextensions.cpp index bce2cdab..fdb1f1d5 100644 --- a/common/lc_glextensions.cpp +++ b/common/lc_glextensions.cpp @@ -150,6 +150,13 @@ static bool lcIsGLExtensionSupported(const GLubyte* Extensions, const char* Name static void APIENTRY lcGLDebugCallback(GLenum Source, GLenum Type, GLuint Id, GLenum Severity, GLsizei Length, const GLchar* Message, GLvoid* UserParam) { + Q_UNUSED(Source); + Q_UNUSED(Type); + Q_UNUSED(Id); + Q_UNUSED(Severity); + Q_UNUSED(Length); + Q_UNUSED(UserParam); + qDebug() << Message; } diff --git a/common/lc_glwidget.h b/common/lc_glwidget.h index f1bfe0ae..224f96ba 100644 --- a/common/lc_glwidget.h +++ b/common/lc_glwidget.h @@ -85,7 +85,7 @@ public: virtual void OnForwardButtonDown() { } virtual void OnForwardButtonUp() { } virtual void OnMouseMove() { } - virtual void OnMouseWheel(float Direction) { } + virtual void OnMouseWheel(float Direction) { Q_UNUSED(Direction); } lcInputState mInputState; int mWidth; diff --git a/common/lc_library.cpp b/common/lc_library.cpp index 166e7a21..d3f08e3a 100644 --- a/common/lc_library.cpp +++ b/common/lc_library.cpp @@ -162,7 +162,7 @@ bool lcPiecesLibrary::Load(const char* LibraryPath) { strcpy(mLibraryPath, LibraryPath); - int i = strlen(mLibraryPath) - 1; + size_t i = strlen(mLibraryPath) - 1; if ((mLibraryPath[i] != '\\') && (mLibraryPath[i] != '/')) strcat(mLibraryPath, "/"); @@ -425,7 +425,7 @@ bool lcPiecesLibrary::OpenDirectory(const char* Path) { strcpy(FileName, Path); strcat(FileName, "parts/"); - int PathLength = strlen(FileName); + size_t PathLength = strlen(FileName); g_App->GetFileList(FileName, FileList); @@ -498,7 +498,7 @@ bool lcPiecesLibrary::OpenDirectory(const char* Path) for (int DirectoryIdx = 0; DirectoryIdx < (int)(sizeof(PrimitiveDirectories) / sizeof(PrimitiveDirectories[0])); DirectoryIdx++) { strcpy(FileName, Path); - int PathLength = strlen(FileName); + size_t PathLength = strlen(FileName); strcat(FileName, PrimitiveDirectories[DirectoryIdx]); PathLength += strchr(PrimitiveDirectories[DirectoryIdx], '/') - PrimitiveDirectories[DirectoryIdx] + 1; @@ -540,7 +540,7 @@ bool lcPiecesLibrary::OpenDirectory(const char* Path) strcpy(FileName, Path); strcat(FileName, "parts/textures/"); - int PathLength = strlen(FileName); + size_t PathLength = strlen(FileName); g_App->GetFileList(FileName, FileList); @@ -2354,7 +2354,7 @@ void lcPiecesLibrary::GetPatternedPieces(PieceInfo* Parent, lcArray& if (Pieces.GetSize() == 0) { strcpy(Name, Parent->m_strName); - int Len = strlen(Name); + size_t Len = strlen(Name); if (Name[Len-1] < '0' || Name[Len-1] > '9') Name[Len-1] = 'P'; diff --git a/common/lc_mainwindow.cpp b/common/lc_mainwindow.cpp index 63e68dde..b9ccdbec 100644 --- a/common/lc_mainwindow.cpp +++ b/common/lc_mainwindow.cpp @@ -733,6 +733,8 @@ void lcMainWindow::ActionTriggered() void lcMainWindow::PartsTreeItemChanged(QTreeWidgetItem* Current, QTreeWidgetItem* Previous) { + Q_UNUSED(Previous); + if (!Current) return; @@ -756,7 +758,7 @@ void lcMainWindow::PartSearchChanged(const QString& Text) { const QByteArray TextConv = Text.toLocal8Bit(); const char* SearchString = TextConv.data(); - int Length = strlen(SearchString); + size_t Length = strlen(SearchString); if (!Length) return; @@ -1144,7 +1146,7 @@ bool lcMainWindow::DoDialog(LC_DIALOG_TYPE Type, void* Data) case LC_DIALOG_ABOUT: { - lcQAboutDialog Dialog(this, Data); + lcQAboutDialog Dialog(this); return Dialog.exec() == QDialog::Accepted; } break; diff --git a/common/lc_mesh.cpp b/common/lc_mesh.cpp index b481772d..0c41e451 100644 --- a/common/lc_mesh.cpp +++ b/common/lc_mesh.cpp @@ -379,7 +379,7 @@ bool lcMesh::FileSave(lcMemFile& File) if (Section.Texture) { - int Length = strlen(Section.Texture->mName); + size_t Length = strlen(Section.Texture->mName); File.WriteU16(Length); File.WriteBuffer(Section.Texture->mName, Length); } diff --git a/common/lc_model.cpp b/common/lc_model.cpp index 6f882faa..1dd41406 100644 --- a/common/lc_model.cpp +++ b/common/lc_model.cpp @@ -47,7 +47,7 @@ void lcModelProperties::SaveDefaults() lcSetProfileInt(LC_PROFILE_DEFAULT_AMBIENT_COLOR, lcColorFromVector3(mAmbientColor)); } -void lcModelProperties::SaveLDraw(QTextStream& Stream, bool MPD) const +void lcModelProperties::SaveLDraw(QTextStream& Stream) const { QLatin1String LineEnding("\r\n"); @@ -274,11 +274,11 @@ void lcModel::UpdatePieceInfo(lcArray& UpdatedModels) mPieceInfo->m_fDimensions[5] = BoundingBox[2]; } -void lcModel::SaveLDraw(QTextStream& Stream, bool MPD, bool SelectedOnly) const +void lcModel::SaveLDraw(QTextStream& Stream, bool SelectedOnly) const { QLatin1String LineEnding("\r\n"); - mProperties.SaveLDraw(Stream, MPD); + mProperties.SaveLDraw(Stream); if (mCurrentStep != GetLastStep()) Stream << QLatin1String("0 !LEOCAD MODEL CURRENT_STEP") << mCurrentStep << LineEnding; @@ -918,7 +918,7 @@ void lcModel::Copy() QByteArray File; QTextStream Stream(&File, QIODevice::WriteOnly); - SaveLDraw(Stream, false, true); + SaveLDraw(Stream, true); g_App->ExportClipboard(File); } @@ -1265,7 +1265,7 @@ void lcModel::SaveCheckpoint(const QString& Description) ModelHistoryEntry->Description = Description; QTextStream Stream(&ModelHistoryEntry->File); - SaveLDraw(Stream, false, false); + SaveLDraw(Stream, false); mUndoHistory.InsertAt(0, ModelHistoryEntry); mRedoHistory.DeleteAll(); diff --git a/common/lc_model.h b/common/lc_model.h index fd411ab0..d8089700 100644 --- a/common/lc_model.h +++ b/common/lc_model.h @@ -56,7 +56,7 @@ public: return true; } - void SaveLDraw(QTextStream& Stream, bool MPD) const; + void SaveLDraw(QTextStream& Stream) const; void ParseLDrawLine(QTextStream& Stream); QString mName; @@ -213,7 +213,7 @@ public: void RemoveFocusPieceFromGroup(); void ShowEditGroupsDialog(); - void SaveLDraw(QTextStream& Stream, bool MPD, bool SelectedOnly) const; + void SaveLDraw(QTextStream& Stream, bool SelectedOnly) const; void LoadLDraw(QIODevice& Device, Project* Project); bool LoadBinary(lcFile* File); void Merge(lcModel* Other); diff --git a/common/lc_profile.cpp b/common/lc_profile.cpp index f7487b5c..7864a2f8 100644 --- a/common/lc_profile.cpp +++ b/common/lc_profile.cpp @@ -222,14 +222,3 @@ void lcSetProfileBuffer(LC_PROFILE_KEY Key, const QByteArray& Buffer) Settings.setValue(QString("%1/%2").arg(Entry.mSection, Entry.mKey), Buffer); } - -void lcSetProfileBuffer(LC_PROFILE_KEY Key, const lcMemFile& Buffer) // todo: deprecated -{ - lcProfileEntry& Entry = gProfileEntries[Key]; - QSettings Settings; - QByteArray Value = QByteArray::fromRawData((const char*)Buffer.mBuffer, Buffer.GetLength()); - - LC_ASSERT(Entry.mType == LC_PROFILE_ENTRY_BUFFER); - - Settings.setValue(QString("%1/%2").arg(Entry.mSection, Entry.mKey), Value); -} diff --git a/common/lc_profile.h b/common/lc_profile.h index 454afbf5..bfaf0004 100644 --- a/common/lc_profile.h +++ b/common/lc_profile.h @@ -111,6 +111,5 @@ void lcSetProfileInt(LC_PROFILE_KEY Key, int Value); void lcSetProfileFloat(LC_PROFILE_KEY Key, float Value); void lcSetProfileString(LC_PROFILE_KEY Key, const QString& Value); void lcSetProfileBuffer(LC_PROFILE_KEY Key, const QByteArray& Buffer); -void lcSetProfileBuffer(LC_PROFILE_KEY Key, const lcMemFile& Buffer); #endif // LC_PROFILE_H diff --git a/common/lc_shortcuts.cpp b/common/lc_shortcuts.cpp index a01fdc47..eef178f2 100644 --- a/common/lc_shortcuts.cpp +++ b/common/lc_shortcuts.cpp @@ -58,6 +58,8 @@ bool lcKeyboardShortcuts::Save(QTextStream& Stream) Stream << gCommands[CommandIdx].ID << QLatin1String("=") << mShortcuts[CommandIdx] << QLatin1String("\n"); } + Stream.flush(); + return true; } diff --git a/common/light.cpp b/common/light.cpp index df1155d0..6390074a 100644 --- a/common/light.cpp +++ b/common/light.cpp @@ -53,6 +53,7 @@ lcLight::~lcLight() void lcLight::SaveLDraw(QTextStream& Stream) const { + Q_UNUSED(Stream); } void lcLight::CreateName(const lcArray& Lights) diff --git a/common/minifig.cpp b/common/minifig.cpp index 41424bec..a5ea8036 100644 --- a/common/minifig.cpp +++ b/common/minifig.cpp @@ -118,7 +118,7 @@ void MinifigWizard::ParseSettings(lcFile& Settings) char Line[1024]; bool FoundSection = false; const char* SectionName = SectionNames[SectionIndex]; - int SectionNameLength = strlen(SectionName); + size_t SectionNameLength = strlen(SectionName); // Find start of section while (Settings.ReadLine(Line, sizeof(Line))) diff --git a/common/piece.h b/common/piece.h index f576b7ec..55b773bb 100644 --- a/common/piece.h +++ b/common/piece.h @@ -64,6 +64,8 @@ public: virtual bool IsSelected(lcuint32 Section) const { + Q_UNUSED(Section); + return (mState & LC_PIECE_SELECTION_MASK) != 0; } diff --git a/common/project.cpp b/common/project.cpp index 57a4f4f4..ce92b41d 100644 --- a/common/project.cpp +++ b/common/project.cpp @@ -300,7 +300,7 @@ bool Project::Save(const QString& FileName) if (MPD) Stream << QLatin1String("0 FILE ") << Model->GetProperties().mName << QLatin1String("\r\n"); - Model->SaveLDraw(Stream, MPD, false); + Model->SaveLDraw(Stream, false); Model->SetSaved(); if (MPD) diff --git a/common/str.h b/common/str.h index 878a3022..c6d57933 100644 --- a/common/str.h +++ b/common/str.h @@ -13,7 +13,7 @@ public: { m_pData = NULL; *this = str; } ~String(); - int GetLength() const + size_t GetLength() const { return strlen(m_pData); } bool IsEmpty() const { return m_pData[0] == '\0'; } @@ -48,8 +48,6 @@ public: // simple sub-string extraction String& Mid(int first, int count) const; - String& Mid(int first) const - { return Mid(first, GetLength() - first); } String& Left(int count) const; String& Right(int count) const; @@ -107,12 +105,6 @@ public: } return m_pData; } - void ReleaseBuffer(int len = -1) - { - if (len == -1) - len = strlen(m_pData); - m_pData[len] = '\0'; - } protected: char* m_pData; diff --git a/common/texfont.cpp b/common/texfont.cpp index cb937217..99d0a71a 100644 --- a/common/texfont.cpp +++ b/common/texfont.cpp @@ -181,7 +181,7 @@ void TexFont::GetStringDimensions(int* cx, int* cy, const char* Text) const void TexFont::PrintText(lcContext* Context, float Left, float Top, float Z, const char* Text) const { - int Length = strlen(Text); + size_t Length = strlen(Text); if (!Length) return; diff --git a/qt/lc_qaboutdialog.cpp b/qt/lc_qaboutdialog.cpp index 8ca2922d..eddd09a5 100644 --- a/qt/lc_qaboutdialog.cpp +++ b/qt/lc_qaboutdialog.cpp @@ -5,7 +5,7 @@ #include "preview.h" #include "lc_glextensions.h" -lcQAboutDialog::lcQAboutDialog(QWidget *parent, void *data) : +lcQAboutDialog::lcQAboutDialog(QWidget *parent) : QDialog(parent), ui(new Ui::lcQAboutDialog) { diff --git a/qt/lc_qaboutdialog.h b/qt/lc_qaboutdialog.h index 5f53cf5c..6c3a00f5 100644 --- a/qt/lc_qaboutdialog.h +++ b/qt/lc_qaboutdialog.h @@ -12,7 +12,7 @@ class lcQAboutDialog : public QDialog Q_OBJECT public: - explicit lcQAboutDialog(QWidget *parent, void *data); + explicit lcQAboutDialog(QWidget *parent); ~lcQAboutDialog(); private: diff --git a/qt/lc_qcolorlist.cpp b/qt/lc_qcolorlist.cpp index 264ef133..ad4110c9 100644 --- a/qt/lc_qcolorlist.cpp +++ b/qt/lc_qcolorlist.cpp @@ -291,6 +291,8 @@ void lcQColorList::resizeEvent(QResizeEvent *event) void lcQColorList::paintEvent(QPaintEvent *event) { + Q_UNUSED(event); + QPainter painter(this); painter.fillRect(rect(), palette().brush(QPalette::Base)); diff --git a/qt/lc_qeditgroupsdialog.cpp b/qt/lc_qeditgroupsdialog.cpp index 9f8eccc4..f7de3fb1 100644 --- a/qt/lc_qeditgroupsdialog.cpp +++ b/qt/lc_qeditgroupsdialog.cpp @@ -69,6 +69,8 @@ void lcQEditGroupsDialog::on_newGroup_clicked() void lcQEditGroupsDialog::onItemClicked(QTreeWidgetItem *item, int column) { + Q_UNUSED(column); + if (item->flags() & Qt::ItemIsEditable) { mClickTimer.stop(); @@ -87,6 +89,8 @@ void lcQEditGroupsDialog::onItemClicked(QTreeWidgetItem *item, int column) void lcQEditGroupsDialog::onItemDoubleClicked(QTreeWidgetItem *item, int column) { + Q_UNUSED(column); + if (item->flags() & Qt::ItemIsEditable) { mEditableDoubleClicked = true; @@ -95,6 +99,8 @@ void lcQEditGroupsDialog::onItemDoubleClicked(QTreeWidgetItem *item, int column) void lcQEditGroupsDialog::timerEvent(QTimerEvent *event) { + Q_UNUSED(event); + mClickTimer.stop(); if (!mEditableDoubleClicked) { diff --git a/qt/lc_qmodellistdialog.cpp b/qt/lc_qmodellistdialog.cpp index bde4e9dd..693ba67b 100644 --- a/qt/lc_qmodellistdialog.cpp +++ b/qt/lc_qmodellistdialog.cpp @@ -156,5 +156,7 @@ void lcQModelListDialog::on_MoveDown_clicked() void lcQModelListDialog::on_ModelList_itemDoubleClicked(QListWidgetItem* Item) { + Q_UNUSED(Item); + accept(); } diff --git a/qt/lc_qpartstree.cpp b/qt/lc_qpartstree.cpp index bb243913..f16a228b 100644 --- a/qt/lc_qpartstree.cpp +++ b/qt/lc_qpartstree.cpp @@ -180,7 +180,7 @@ void lcQPartsTree::itemExpanded(QTreeWidgetItem *expandedItem) continue; const char* desc = patternedInfo->m_strDescription; - int len = strlen(partInfo->m_strDescription); + size_t len = strlen(partInfo->m_strDescription); if (!strncmp(patternedInfo->m_strDescription, partInfo->m_strDescription, len)) desc += len; @@ -252,6 +252,8 @@ void lcQPartsTree::setCurrentPart(PieceInfo *part) void lcQPartsTree::startDrag(Qt::DropActions supportedActions) { + Q_UNUSED(supportedActions); + PieceInfo *info = (PieceInfo*)currentItem()->data(0, PieceInfoRole).value(); if (!info) diff --git a/qt/lc_qpreferencesdialog.cpp b/qt/lc_qpreferencesdialog.cpp index 8f7ecfc4..e2dbb001 100644 --- a/qt/lc_qpreferencesdialog.cpp +++ b/qt/lc_qpreferencesdialog.cpp @@ -392,6 +392,8 @@ void lcQPreferencesDialog::on_resetCategories_clicked() bool lcQPreferencesDialog::eventFilter(QObject *object, QEvent *event) { + Q_UNUSED(object); + if (event->type() == QEvent::KeyPress) { QKeyEvent *keyEvent = static_cast(event); diff --git a/qt/lc_qpropertiestree.cpp b/qt/lc_qpropertiestree.cpp index b45d40f8..d660a937 100644 --- a/qt/lc_qpropertiestree.cpp +++ b/qt/lc_qpropertiestree.cpp @@ -147,6 +147,8 @@ void lcQPropertiesTreeDelegate::slotEditorDestroyed(QObject *object) QWidget *lcQPropertiesTreeDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &style, const QModelIndex &index) const { + Q_UNUSED(style); + if (index.column() == 1 && m_treeWidget) { QTreeWidgetItem *item = m_treeWidget->indexToItem(index); @@ -967,6 +969,8 @@ void lcQPropertiesTree::SetPiece(const lcArray& Selection, lcObject* void lcQPropertiesTree::SetCamera(lcObject* Focus) { + Q_UNUSED(Focus); + if (mWidgetMode != LC_PROPERTY_WIDGET_CAMERA) { SetEmpty(); @@ -1057,6 +1061,8 @@ void lcQPropertiesTree::SetCamera(lcObject* Focus) void lcQPropertiesTree::SetLight(lcObject* Focus) { + Q_UNUSED(Focus); + SetEmpty(); mFocus = NULL; diff --git a/qt/lc_qselectdialog.cpp b/qt/lc_qselectdialog.cpp index cbcd18d0..7fec00b2 100644 --- a/qt/lc_qselectdialog.cpp +++ b/qt/lc_qselectdialog.cpp @@ -132,6 +132,8 @@ void lcQSelectDialog::on_selectInvert_clicked() void lcQSelectDialog::itemChanged(QTreeWidgetItem *item, int column) { + Q_UNUSED(column); + QTreeWidgetItem* ParentItem = item->parent(); if (!ParentItem) diff --git a/qt/lc_qupdatedialog.cpp b/qt/lc_qupdatedialog.cpp index 055f8326..4b6d6f73 100644 --- a/qt/lc_qupdatedialog.cpp +++ b/qt/lc_qupdatedialog.cpp @@ -79,6 +79,8 @@ void lcQUpdateDialog::reject() void lcQUpdateDialog::finished(int result) { + Q_UNUSED(result); + if (initialUpdate) deleteLater(); }