Fixed warnings.
This commit is contained in:
+1
-1
@@ -41,7 +41,7 @@ void lcGroup::CreateName(const std::vector<std::unique_ptr<lcGroup>>& Groups)
|
||||
|
||||
int Max = 0;
|
||||
QString Prefix = QApplication::tr("Group #");
|
||||
const int Length = Prefix.length();
|
||||
const qsizetype Length = Prefix.length();
|
||||
|
||||
for (const std::unique_ptr<lcGroup>& Group : Groups)
|
||||
{
|
||||
|
||||
@@ -18,14 +18,21 @@ lcAboutDialog::lcAboutDialog(QWidget* Parent)
|
||||
#endif
|
||||
|
||||
lcViewWidget* Widget = gMainWindow->GetActiveView()->GetWidget();
|
||||
QSurfaceFormat Format = Widget->context()->format();
|
||||
|
||||
QOpenGLContext* Context = Widget->context();
|
||||
QOpenGLFunctions* Functions = Context->functions();
|
||||
QSurfaceFormat Format = Context->format();
|
||||
qDebug() << Format;
|
||||
int ColorDepth = Format.redBufferSize() + Format.greenBufferSize() + Format.blueBufferSize() + Format.alphaBufferSize();
|
||||
|
||||
const QString QtVersionFormat = tr("Qt Version %1 (compiled with %2)\n\n");
|
||||
const QString QtVersion = QtVersionFormat.arg(qVersion(), QT_VERSION_STR);
|
||||
|
||||
const QString VersionFormat = tr("OpenGL Version %1 (GLSL %2)\n%3 - %4\n\n");
|
||||
const QString Version = VersionFormat.arg(QString((const char*)glGetString(GL_VERSION)), QString((const char*)glGetString(GL_SHADING_LANGUAGE_VERSION)), QString((const char*)glGetString(GL_RENDERER)), QString((const char*)glGetString(GL_VENDOR)));
|
||||
const QString GLVersion(reinterpret_cast<const char*>(Functions->glGetString(GL_VERSION)));
|
||||
const QString ShaderVersion(reinterpret_cast<const char*>(Functions->glGetString(GL_SHADING_LANGUAGE_VERSION)));
|
||||
const QString Renderer(reinterpret_cast<const char*>(Functions->glGetString(GL_RENDERER)));
|
||||
const QString Vendor(reinterpret_cast<const char*>(Functions->glGetString(GL_VENDOR)));
|
||||
const QString Version = VersionFormat.arg(GLVersion, ShaderVersion, Renderer, Vendor);
|
||||
const QString BuffersFormat = tr("Color Buffer: %1 bits\nDepth Buffer: %2 bits\nStencil Buffer: %3 bits\n\n");
|
||||
const QString Buffers = BuffersFormat.arg(QString::number(ColorDepth), QString::number(Format.depthBufferSize()), QString::number(Format.stencilBufferSize()));
|
||||
|
||||
|
||||
@@ -1578,8 +1578,8 @@ int lcBlenderPreferences::GetBlenderAddon(const QString& BlenderDir)
|
||||
qint64 DataSize = File.size();
|
||||
const qint64 BufferSize = Q_INT64_C(1000);
|
||||
char Buf[BufferSize];
|
||||
int BytesRead;
|
||||
int ReadSize = qMin(DataSize, BufferSize);
|
||||
qint64 BytesRead;
|
||||
qint64 ReadSize = qMin(DataSize, BufferSize);
|
||||
while (ReadSize > 0 && (BytesRead = File.read(Buf, ReadSize)) > 0)
|
||||
{
|
||||
DataSize -= BytesRead;
|
||||
@@ -1883,7 +1883,7 @@ void lcBlenderPreferences::ReadStdOut(const QString& StdOutput, QString& Errors)
|
||||
const QString SaveAddonVersion = mAddonVersion;
|
||||
const QString SaveVersion = mBlenderVersion;
|
||||
|
||||
int EditListItems = mPathLineEditList.size();
|
||||
qsizetype EditListItems = mPathLineEditList.size();
|
||||
for (const QString& StdOutLine : StdOutLines)
|
||||
{
|
||||
if (StdOutLine.isEmpty())
|
||||
@@ -3625,7 +3625,7 @@ int lcBlenderPreferences::ShowMessage(QWidget* Parent, const QString& Header, c
|
||||
QWidget* TextWidget = BoxLayoutItem->widget();
|
||||
if (TextWidget)
|
||||
{
|
||||
int FixedWidth = Body.length() * FontWidth;
|
||||
qsizetype FixedWidth = Body.length() * FontWidth;
|
||||
if (FixedWidth == MinimumWidth)
|
||||
{
|
||||
int Index = (MinimumWidth / FontWidth) - 1;
|
||||
@@ -3634,7 +3634,7 @@ int lcBlenderPreferences::ShowMessage(QWidget* Parent, const QString& Header, c
|
||||
}
|
||||
else if (FixedWidth < MinimumWidth)
|
||||
FixedWidth = MinimumWidth;
|
||||
TextWidget->setFixedWidth(FixedWidth);
|
||||
TextWidget->setFixedWidth(static_cast<int>(FixedWidth));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -106,7 +106,7 @@ bool lcLoadCategories(const QByteArray& Buffer, std::vector<lcLibraryCategory>&
|
||||
|
||||
for (QString Line = Stream.readLine(); !Line.isNull(); Line = Stream.readLine())
|
||||
{
|
||||
int Equals = Line.indexOf('=');
|
||||
qsizetype Equals = Line.indexOf('=');
|
||||
|
||||
if (Equals == -1)
|
||||
continue;
|
||||
|
||||
+1
-1
@@ -283,7 +283,7 @@ public:
|
||||
void WriteQString(const QString& String)
|
||||
{
|
||||
QByteArray Data = String.toUtf8();
|
||||
WriteU32(Data.size());
|
||||
WriteU32(static_cast<quint32>(Data.size()));
|
||||
WriteBuffer(Data, Data.size());
|
||||
}
|
||||
|
||||
|
||||
@@ -359,7 +359,7 @@ void lcMinifigDialog::PieceButtonClicked()
|
||||
if (Search == mPieceButtons.end())
|
||||
return;
|
||||
|
||||
int ItemIndex = std::distance(mPieceButtons.begin(), Search);
|
||||
int ItemIndex = static_cast<int>(std::distance(mPieceButtons.begin(), Search));
|
||||
PieceInfo* CurrentInfo = mMinifigWizard->mMinifig.Parts[ItemIndex];
|
||||
|
||||
QPoint Position = PieceButton->mapToGlobal(PieceButton->rect().bottomLeft());
|
||||
@@ -411,7 +411,9 @@ void lcMinifigDialog::ColorChanged(int Index)
|
||||
SetCurrentTemplateModified();
|
||||
UpdateTemplateCombo();
|
||||
|
||||
mMinifigWizard->SetColorIndex(std::distance(mColorPickers.begin(), Search), Index);
|
||||
int ItemIndex = static_cast<int>(std::distance(mColorPickers.begin(), Search));
|
||||
|
||||
mMinifigWizard->SetColorIndex(ItemIndex, Index);
|
||||
mView->Redraw();
|
||||
}
|
||||
|
||||
@@ -425,6 +427,8 @@ void lcMinifigDialog::AngleChanged(double Value)
|
||||
SetCurrentTemplateModified();
|
||||
UpdateTemplateCombo();
|
||||
|
||||
mMinifigWizard->SetAngle(std::distance(mSpinBoxes.begin(), Search), Value);
|
||||
int ItemIndex = static_cast<int>(std::distance(mSpinBoxes.begin(), Search));
|
||||
|
||||
mMinifigWizard->SetAngle(ItemIndex, Value);
|
||||
mView->Redraw();
|
||||
}
|
||||
|
||||
+1
-1
@@ -2769,7 +2769,7 @@ void lcModel::ShowEditGroupsDialog()
|
||||
|
||||
QString lcModel::GetGroupName(const QString& Prefix)
|
||||
{
|
||||
const int Length = Prefix.length();
|
||||
const qsizetype Length = Prefix.length();
|
||||
int Max = 0;
|
||||
|
||||
for (const std::unique_ptr<lcGroup>& Group : mGroups)
|
||||
|
||||
@@ -339,7 +339,7 @@ bool lcObjectProperty<T>::LoadFromDataStream(QDataStream& Stream)
|
||||
|
||||
mKeys.resize(KeyCount);
|
||||
|
||||
size_t DataSize = KeyCount * sizeof(lcObjectPropertyKey<T>);
|
||||
qsizetype DataSize = KeyCount * sizeof(lcObjectPropertyKey<T>);
|
||||
|
||||
if (Stream.readRawData(reinterpret_cast<char*>(mKeys.data()), DataSize) != DataSize)
|
||||
return false;
|
||||
|
||||
@@ -107,7 +107,7 @@ bool lcKeyboardShortcuts::Load(QTextStream& Stream)
|
||||
|
||||
for (QString Line = Stream.readLine(); !Line.isNull(); Line = Stream.readLine())
|
||||
{
|
||||
int Equals = Line.indexOf('=');
|
||||
qsizetype Equals = Line.indexOf('=');
|
||||
|
||||
if (Equals == -1)
|
||||
continue;
|
||||
@@ -231,7 +231,7 @@ bool lcMouseShortcuts::Load(const QStringList& FullShortcuts)
|
||||
|
||||
for (const QString& FullShortcut : FullShortcuts)
|
||||
{
|
||||
int Equals = FullShortcut.indexOf('=');
|
||||
qsizetype Equals = FullShortcut.indexOf('=');
|
||||
|
||||
if (Equals == -1)
|
||||
continue;
|
||||
|
||||
@@ -195,6 +195,6 @@ void lcStringCache::DrawStrings(lcContext* Context, const lcMatrix44* Transforms
|
||||
|
||||
Context->BindTexture2D(mTexture);
|
||||
Context->SetColor(0.0f, 0.0f, 0.0f, 1.0f);
|
||||
Context->DrawPrimitives(GL_TRIANGLES, 0, Strings.size() * 6);
|
||||
Context->DrawPrimitives(GL_TRIANGLES, 0, static_cast<int>(Strings.size()) * 6);
|
||||
}
|
||||
|
||||
|
||||
@@ -903,8 +903,9 @@ void lcQPreferencesDialog::updateCommandList()
|
||||
|
||||
const QString identifier = tr(gCommands[actionIdx].ID);
|
||||
|
||||
int pos = identifier.indexOf(QLatin1Char('.'));
|
||||
int subPos = identifier.indexOf(QLatin1Char('.'), pos + 1);
|
||||
qsizetype pos = identifier.indexOf(QLatin1Char('.'));
|
||||
qsizetype subPos = identifier.indexOf(QLatin1Char('.'), pos + 1);
|
||||
|
||||
if (subPos == -1)
|
||||
subPos = pos;
|
||||
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@
|
||||
QString lcFormatValue(float Value, int Precision)
|
||||
{
|
||||
QString String = QString::number(Value, 'f', Precision);
|
||||
const int Dot = String.indexOf('.');
|
||||
const qsizetype Dot = String.indexOf('.');
|
||||
|
||||
if (Dot != -1)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user