summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2020-02-14 11:28:19 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2020-02-14 12:52:44 +0100
commit132ea94fd23573b07fa9fbfb0a1e88173556e7ef (patch)
tree6c0a3df16f4f7be01b497cf27aaa813cbb0ad9d6
parent5b5da71586c8391fd74415ec9241c13489445b2a (diff)
downloadqtxmlpatterns-132ea94fd23573b07fa9fbfb0a1e88173556e7ef.tar.gz
Fix deprecation warnings
querymainwindow.cpp:69:82: warning: ‘void QComboBox::currentIndexChanged(int)’ is deprecated: Use currentIndexChanged(int, const QString &) instead [-Wdeprecated-declarations] data/qabstractdatetime.cpp:148:30: warning: ‘QDateTime::QDateTime(const QDate&)’ is deprecated: Use QDate::startOfDay() [-Wdeprecated-declarations] data/qgday.cpp:78:71: warning: ‘QDateTime::QDateTime(const QDate&)’ is deprecated: Use QDate::startOfDay() [-Wdeprecated-declarations] data/qgyear.cpp:83:71: warning: ‘QDateTime::QDateTime(const QDate&)’ is deprecated: Use QDate::startOfDay() [-Wdeprecated-declarations] data/qgmonth.cpp:77:71: warning: ‘QDateTime::QDateTime(const QDate&)’ is deprecated: Use QDate::startOfDay() [-Wdeprecated-declarations] data/qgmonthday.cpp:80:76: warning: ‘QDateTime::QDateTime(const QDate&)’ is deprecated: Use QDate::startOfDay() [-Wdeprecated-declarations] data/qgyearmonth.cpp:85:76: warning: ‘QDateTime::QDateTime(const QDate&)’ is deprecated: Use QDate::startOfDay() [-Wdeprecated-declarations] qqmlxmllistmodel.cpp:748:71: warning: ‘QQmlListProperty<T>::QQmlListProperty(QObject*, QList<T*>&) [with T = QQuickXmlListModelRole]’ is deprecated: Use constructor taking QList pointer, and gain improved performance [-Wdeprecated-declarations] connect(ui_defaultQueries, QOverload<int>::of(&QComboBox::currentIndexChanged), Change-Id: Ia4ed432369d25269075d12d06fdbf2e286d5119b Reviewed-by: Vitaly Fanaskov <vitaly.fanaskov@qt.io>
-rw-r--r--examples/xmlpatterns/recipes/querymainwindow.cpp2
-rw-r--r--src/imports/xmllistmodel/qqmlxmllistmodel.cpp2
-rw-r--r--src/xmlpatterns/data/qabstractdatetime.cpp2
-rw-r--r--src/xmlpatterns/data/qgday.cpp3
-rw-r--r--src/xmlpatterns/data/qgmonth.cpp3
-rw-r--r--src/xmlpatterns/data/qgyear.cpp3
-rw-r--r--src/xmlpatterns/data/qgyearmonth.cpp3
7 files changed, 11 insertions, 7 deletions
diff --git a/examples/xmlpatterns/recipes/querymainwindow.cpp b/examples/xmlpatterns/recipes/querymainwindow.cpp
index b968d28..dd20fb6 100644
--- a/examples/xmlpatterns/recipes/querymainwindow.cpp
+++ b/examples/xmlpatterns/recipes/querymainwindow.cpp
@@ -66,7 +66,7 @@ QueryMainWindow::QueryMainWindow()
ui_defaultQueries = findChild<QComboBox*>("defaultQueries");
QMetaObject::connectSlotsByName(this);
- connect(ui_defaultQueries, QOverload<int>::of(&QComboBox::currentIndexChanged),
+ connect(ui_defaultQueries, QOverload<int, const QString &>::of(&QComboBox::currentIndexChanged),
this, &QueryMainWindow::displayQuery);
loadInputFile();
diff --git a/src/imports/xmllistmodel/qqmlxmllistmodel.cpp b/src/imports/xmllistmodel/qqmlxmllistmodel.cpp
index a7ccf6c..516254e 100644
--- a/src/imports/xmllistmodel/qqmlxmllistmodel.cpp
+++ b/src/imports/xmllistmodel/qqmlxmllistmodel.cpp
@@ -745,7 +745,7 @@ QQuickXmlListModel::~QQuickXmlListModel()
QQmlListProperty<QQuickXmlListModelRole> QQuickXmlListModel::roleObjects()
{
Q_D(QQuickXmlListModel);
- QQmlListProperty<QQuickXmlListModelRole> list(this, d->roleObjects);
+ QQmlListProperty<QQuickXmlListModelRole> list(this, &d->roleObjects);
list.append = &QQuickXmlListModelPrivate::append_role;
list.clear = &QQuickXmlListModelPrivate::clear_role;
return list;
diff --git a/src/xmlpatterns/data/qabstractdatetime.cpp b/src/xmlpatterns/data/qabstractdatetime.cpp
index c608e20..87ac96a 100644
--- a/src/xmlpatterns/data/qabstractdatetime.cpp
+++ b/src/xmlpatterns/data/qabstractdatetime.cpp
@@ -145,7 +145,7 @@ QDateTime AbstractDateTime::create(AtomicValue::Ptr &errorMessage,
/* Only deal with time if time is needed. */
if(captTable.hour == -1)
{
- QDateTime result(date);
+ QDateTime result = date.startOfDay();
setUtcOffset(result, zoResult, offset);
return result;
}
diff --git a/src/xmlpatterns/data/qgday.cpp b/src/xmlpatterns/data/qgday.cpp
index 9bf2a95..a031879 100644
--- a/src/xmlpatterns/data/qgday.cpp
+++ b/src/xmlpatterns/data/qgday.cpp
@@ -75,7 +75,8 @@ GDay::Ptr GDay::fromLexical(const QString &lexical)
GDay::Ptr GDay::fromDateTime(const QDateTime &dt)
{
- QDateTime result(QDate(DefaultYear, DefaultMonth, dt.date().day()));
+ const QDate date(DefaultYear, DefaultMonth, dt.date().day());
+ QDateTime result(date.startOfDay());
copyTimeSpec(dt, result);
return GDay::Ptr(new GDay(result));
diff --git a/src/xmlpatterns/data/qgmonth.cpp b/src/xmlpatterns/data/qgmonth.cpp
index 985258b..460fcb2 100644
--- a/src/xmlpatterns/data/qgmonth.cpp
+++ b/src/xmlpatterns/data/qgmonth.cpp
@@ -74,7 +74,8 @@ GMonth::Ptr GMonth::fromLexical(const QString &lexical)
GMonth::Ptr GMonth::fromDateTime(const QDateTime &dt)
{
- QDateTime result(QDate(DefaultYear, dt.date().month(), DefaultDay));
+ const QDate date(DefaultYear, dt.date().month(), DefaultDay);
+ QDateTime result(date.startOfDay());
copyTimeSpec(dt, result);
return GMonth::Ptr(new GMonth(result));
diff --git a/src/xmlpatterns/data/qgyear.cpp b/src/xmlpatterns/data/qgyear.cpp
index 1a6faff..28698f8 100644
--- a/src/xmlpatterns/data/qgyear.cpp
+++ b/src/xmlpatterns/data/qgyear.cpp
@@ -80,7 +80,8 @@ GYear::Ptr GYear::fromLexical(const QString &lexical)
GYear::Ptr GYear::fromDateTime(const QDateTime &dt)
{
- QDateTime result(QDate(dt.date().year(), DefaultMonth, DefaultDay));
+ const QDate date(dt.date().year(), DefaultMonth, DefaultDay);
+ QDateTime result(date.startOfDay());
copyTimeSpec(dt, result);
return GYear::Ptr(new GYear(result));
diff --git a/src/xmlpatterns/data/qgyearmonth.cpp b/src/xmlpatterns/data/qgyearmonth.cpp
index 6dad8bc..2058ee6 100644
--- a/src/xmlpatterns/data/qgyearmonth.cpp
+++ b/src/xmlpatterns/data/qgyearmonth.cpp
@@ -82,7 +82,8 @@ GYearMonth::Ptr GYearMonth::fromLexical(const QString &lexical)
GYearMonth::Ptr GYearMonth::fromDateTime(const QDateTime &dt)
{
- QDateTime result(QDate(dt.date().year(), dt.date().month(), DefaultDay));
+ const QDate date(dt.date().year(), dt.date().month(), DefaultDay);
+ QDateTime result(date.startOfDay());
copyTimeSpec(dt, result);
return GYearMonth::Ptr(new GYearMonth(result));