diff --git a/common/lc_library.cpp b/common/lc_library.cpp index 24619a25..a00aa371 100644 --- a/common/lc_library.cpp +++ b/common/lc_library.cpp @@ -315,9 +315,17 @@ void lcPiecesLibrary::ReadArchiveDescriptions(const QString& OfficialFileName, c QFileInfo UnofficialInfo(UnofficialFileName); mArchiveCheckSum[0] = OfficialInfo.size(); +#if (QT_VERSION >= QT_VERSION_CHECK(4, 7, 0)) mArchiveCheckSum[1] = OfficialInfo.lastModified().toMSecsSinceEpoch(); +#else + mArchiveCheckSum[1] = OfficialInfo.lastModified().toTime_t(); +#endif mArchiveCheckSum[2] = UnofficialInfo.size(); +#if (QT_VERSION >= QT_VERSION_CHECK(4, 7, 0)) mArchiveCheckSum[3] = UnofficialInfo.lastModified().toMSecsSinceEpoch(); +#else + mArchiveCheckSum[3] = UnofficialInfo.lastModified().toTime_t(); +#endif QString IndexFileName = QFileInfo(QDir(mCachePath), QLatin1String("index")).absoluteFilePath(); diff --git a/common/lc_mainwindow.cpp b/common/lc_mainwindow.cpp index dfd60c09..0d3f3c78 100644 --- a/common/lc_mainwindow.cpp +++ b/common/lc_mainwindow.cpp @@ -810,11 +810,15 @@ void lcMainWindow::Print(QPrinter* Printer) if (Printer->collateCopies()) { DocCopies = 1; +#if (QT_VERSION >= QT_VERSION_CHECK(4, 7, 0)) PageCopies = Printer->supportsMultipleCopies() ? 1 : Printer->copyCount(); +#endif } else { +#if (QT_VERSION >= QT_VERSION_CHECK(4, 7, 0)) DocCopies = Printer->supportsMultipleCopies() ? 1 : Printer->copyCount(); +#endif PageCopies = 1; } diff --git a/common/lc_shortcuts.cpp b/common/lc_shortcuts.cpp index 194a9f90..5af11d99 100644 --- a/common/lc_shortcuts.cpp +++ b/common/lc_shortcuts.cpp @@ -133,8 +133,10 @@ void lcMouseShortcuts::Reset() memset(mShortcuts, 0, sizeof(mShortcuts)); mShortcuts[LC_TOOL_ROTATE_VIEW].Modifiers = Qt::AltModifier; mShortcuts[LC_TOOL_ROTATE_VIEW].Button = Qt::LeftButton; +#if (QT_VERSION >= QT_VERSION_CHECK(4, 7, 0)) mShortcuts[LC_TOOL_PAN].Modifiers = Qt::AltModifier; mShortcuts[LC_TOOL_PAN].Button = Qt::MiddleButton; +#endif mShortcuts[LC_TOOL_ZOOM].Modifiers = Qt::AltModifier; mShortcuts[LC_TOOL_ZOOM].Button = Qt::RightButton; } diff --git a/common/lc_timelinewidget.cpp b/common/lc_timelinewidget.cpp index d9215c60..55f9aec4 100644 --- a/common/lc_timelinewidget.cpp +++ b/common/lc_timelinewidget.cpp @@ -178,8 +178,7 @@ void lcTimelineWidget::Update(bool Clear, bool UpdateItems) int Size = rowHeight(indexFromItem(PieceItem)); QImage Image(Size, Size, QImage::Format_ARGB32); - Image.fill(QColor::fromRgbF(1.0, 1.0, 1.0, 0.0)); - + Image.fill(0); float* Color = gColorList[ColorIndex].Value; QPainter Painter(&Image); Painter.setPen(Qt::NoPen); diff --git a/common/project.cpp b/common/project.cpp index a7fbca19..baf6ec8c 100644 --- a/common/project.cpp +++ b/common/project.cpp @@ -172,7 +172,9 @@ lcModel* Project::CreateNewModel(bool ShowModel) void Project::ShowModelListDialog() { QList> Models; +#if (QT_VERSION >= QT_VERSION_CHECK(4, 7, 0)) Models.reserve(mModels.GetSize()); +#endif for (int ModelIdx = 0; ModelIdx < mModels.GetSize(); ModelIdx++) { diff --git a/common/view.cpp b/common/view.cpp index b1912697..2059d982 100644 --- a/common/view.cpp +++ b/common/view.cpp @@ -2519,7 +2519,7 @@ void View::OnMiddleButtonDown() } gMainWindow->SetActiveView(this); - +#if (QT_VERSION >= QT_VERSION_CHECK(4, 7, 0)) lcTrackTool OverrideTool = GetOverrideTrackTool(Qt::MiddleButton); if (OverrideTool != LC_TRACKTOOL_NONE) @@ -2527,7 +2527,7 @@ void View::OnMiddleButtonDown() mTrackTool = OverrideTool; OnUpdateCursor(); } - +#endif OnButtonDown(LC_TRACKBUTTON_MIDDLE); } diff --git a/qt/lc_qarraydialog.cpp b/qt/lc_qarraydialog.cpp index 43dabeb4..a84e6e09 100644 --- a/qt/lc_qarraydialog.cpp +++ b/qt/lc_qarraydialog.cpp @@ -8,24 +8,24 @@ lcQArrayDialog::lcQArrayDialog(QWidget* Parent) { ui->setupUi(this); - ui->offset1x->setValidator(new QDoubleValidator()); - ui->offset1y->setValidator(new QDoubleValidator()); - ui->offset1z->setValidator(new QDoubleValidator()); - ui->offset2x->setValidator(new QDoubleValidator()); - ui->offset2y->setValidator(new QDoubleValidator()); - ui->offset2z->setValidator(new QDoubleValidator()); - ui->offset3x->setValidator(new QDoubleValidator()); - ui->offset3y->setValidator(new QDoubleValidator()); - ui->offset3z->setValidator(new QDoubleValidator()); - ui->rotation1x->setValidator(new QDoubleValidator()); - ui->rotation1y->setValidator(new QDoubleValidator()); - ui->rotation1z->setValidator(new QDoubleValidator()); - ui->rotation2x->setValidator(new QDoubleValidator()); - ui->rotation2y->setValidator(new QDoubleValidator()); - ui->rotation2z->setValidator(new QDoubleValidator()); - ui->rotation3x->setValidator(new QDoubleValidator()); - ui->rotation3y->setValidator(new QDoubleValidator()); - ui->rotation3z->setValidator(new QDoubleValidator()); + ui->offset1x->setValidator(new QDoubleValidator(ui->offset1x)); + ui->offset1y->setValidator(new QDoubleValidator(ui->offset1y)); + ui->offset1z->setValidator(new QDoubleValidator(ui->offset1z)); + ui->offset2x->setValidator(new QDoubleValidator(ui->offset2x)); + ui->offset2y->setValidator(new QDoubleValidator(ui->offset2y)); + ui->offset2z->setValidator(new QDoubleValidator(ui->offset2z)); + ui->offset3x->setValidator(new QDoubleValidator(ui->offset3x)); + ui->offset3y->setValidator(new QDoubleValidator(ui->offset3y)); + ui->offset3z->setValidator(new QDoubleValidator(ui->offset3z)); + ui->rotation1x->setValidator(new QDoubleValidator(ui->rotation1x)); + ui->rotation1y->setValidator(new QDoubleValidator(ui->rotation1y)); + ui->rotation1z->setValidator(new QDoubleValidator(ui->rotation1z)); + ui->rotation2x->setValidator(new QDoubleValidator(ui->rotation2x)); + ui->rotation2y->setValidator(new QDoubleValidator(ui->rotation2y)); + ui->rotation2z->setValidator(new QDoubleValidator(ui->rotation2z)); + ui->rotation3x->setValidator(new QDoubleValidator(ui->rotation3x)); + ui->rotation3y->setValidator(new QDoubleValidator(ui->rotation3y)); + ui->rotation3z->setValidator(new QDoubleValidator(ui->rotation3z)); mCounts[0] = 10; mCounts[1] = 1; diff --git a/qt/lc_qhtmldialog.cpp b/qt/lc_qhtmldialog.cpp index 7f524694..98410bdf 100644 --- a/qt/lc_qhtmldialog.cpp +++ b/qt/lc_qhtmldialog.cpp @@ -9,10 +9,10 @@ lcQHTMLDialog::lcQHTMLDialog(QWidget *parent, void *data) : { ui->setupUi(this); - ui->stepWidth->setValidator(new QIntValidator(0, 2048)); - ui->stepHeight->setValidator(new QIntValidator(0, 2048)); - ui->partImagesWidth->setValidator(new QIntValidator(0, 2048)); - ui->partImagesHeight->setValidator(new QIntValidator(0, 2048)); + ui->stepWidth->setValidator(new QIntValidator(0, 2048, ui->stepWidth)); + ui->stepHeight->setValidator(new QIntValidator(0, 2048, ui->stepHeight)); + ui->partImagesWidth->setValidator(new QIntValidator(0, 2048, ui->partImagesWidth)); + ui->partImagesHeight->setValidator(new QIntValidator(0, 2048, ui->partImagesHeight)); options = (lcHTMLDialogOptions*)data; diff --git a/qt/lc_qpreferencesdialog.cpp b/qt/lc_qpreferencesdialog.cpp index 09e278af..2c87730c 100644 --- a/qt/lc_qpreferencesdialog.cpp +++ b/qt/lc_qpreferencesdialog.cpp @@ -15,7 +15,7 @@ lcQPreferencesDialog::lcQPreferencesDialog(QWidget *parent, void *data) : { ui->setupUi(this); - ui->lineWidth->setValidator(new QDoubleValidator()); + ui->lineWidth->setValidator(new QDoubleValidator(ui->lineWidth)); connect(ui->gridStudColor, SIGNAL(clicked()), this, SLOT(colorClicked())); connect(ui->gridLineColor, SIGNAL(clicked()), this, SLOT(colorClicked())); connect(ui->categoriesTree, SIGNAL(itemSelectionChanged()), this, SLOT(updateParts())); @@ -617,9 +617,11 @@ void lcQPreferencesDialog::UpdateMouseTreeItem(int ItemIndex) Shortcut += tr("Left Button"); break; +#if (QT_VERSION >= QT_VERSION_CHECK(4, 7, 0)) case Qt::MiddleButton: Shortcut += tr("Middle Button"); break; +#endif case Qt::RightButton: Shortcut += tr("Right Button"); @@ -656,9 +658,11 @@ void lcQPreferencesDialog::on_mouseAssign_clicked() Button = Qt::LeftButton; break; +#if (QT_VERSION >= QT_VERSION_CHECK(4, 7, 0)) case 2: Button = Qt::MiddleButton; break; +#endif case 3: Button = Qt::RightButton; @@ -746,9 +750,11 @@ void lcQPreferencesDialog::MouseTreeItemChanged(QTreeWidgetItem* Current) ui->mouseButton->setCurrentIndex(1); break; +#if (QT_VERSION >= QT_VERSION_CHECK(4, 7, 0)) case Qt::MiddleButton: ui->mouseButton->setCurrentIndex(2); break; +#endif case Qt::RightButton: ui->mouseButton->setCurrentIndex(3); diff --git a/qt/lc_qpropertiesdialog.cpp b/qt/lc_qpropertiesdialog.cpp index deccbeb6..0dd0d47b 100644 --- a/qt/lc_qpropertiesdialog.cpp +++ b/qt/lc_qpropertiesdialog.cpp @@ -14,7 +14,7 @@ lcQPropertiesDialog::lcQPropertiesDialog(QWidget *parent, void *data) : { ui->setupUi(this); - ui->fogDensityEdit->setValidator(new QDoubleValidator()); + ui->fogDensityEdit->setValidator(new QDoubleValidator(ui->fogDensityEdit)); connect(ui->solidColorButton, SIGNAL(clicked()), this, SLOT(colorClicked())); connect(ui->gradient1ColorButton, SIGNAL(clicked()), this, SLOT(colorClicked())); diff --git a/qt/lc_qpropertiestree.cpp b/qt/lc_qpropertiestree.cpp index e57e3e41..e3a9bad9 100644 --- a/qt/lc_qpropertiestree.cpp +++ b/qt/lc_qpropertiestree.cpp @@ -424,7 +424,7 @@ QWidget *lcQPropertiesTree::createEditor(QWidget *parent, QTreeWidgetItem *item) QLineEdit *editor = new QLineEdit(parent); float value = item->data(0, PropertyValueRole).toFloat(); - editor->setValidator(new QDoubleValidator()); + editor->setValidator(new QDoubleValidator(editor)); editor->setText(lcFormatValueLocalized(value)); connect(editor, SIGNAL(returnPressed()), this, SLOT(slotReturnPressed())); diff --git a/qt/lc_qupdatedialog.cpp b/qt/lc_qupdatedialog.cpp index 5e378dbd..f8c6efc2 100644 --- a/qt/lc_qupdatedialog.cpp +++ b/qt/lc_qupdatedialog.cpp @@ -19,7 +19,11 @@ void lcDoInitialUpdateCheck() { QDateTime NextCheckTime = CheckTime.addDays(updateFrequency == 1 ? 1 : 7); +#if (QT_VERSION >= QT_VERSION_CHECK(4, 7, 0)) if (NextCheckTime > QDateTime::currentDateTimeUtc()) +#else + if (NextCheckTime > QDateTime::currentDateTime()) +#endif return; } @@ -147,7 +151,11 @@ void lcQUpdateDialog::replyFinished(QNetworkReply *reply) else ui->status->setText(tr("Error parsing update information.")); +#if (QT_VERSION >= QT_VERSION_CHECK(4, 7, 0)) settings.setValue("Updates/LastCheck", QDateTime::currentDateTimeUtc()); +#else + settings.setValue("Updates/LastCheck", QDateTime::currentDateTime()); +#endif updateReply = NULL; reply->deleteLater();