Skip to content

Commit 5540ae6

Browse files
author
spartucus
committed
Fix clang reinterpret_cast qintptr precision issue.
1 parent 63b6d4f commit 5540ae6

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/push/actioneditor.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ void ActionEditor::on_pushButtonOk_clicked()
108108
QJsonObject obj;
109109
for (auto itr = firstMap.cbegin(); itr != firstMap.end(); ++itr) {
110110
auto ok = false;
111-
auto in = itr.value().toInt(&ok);
111+
auto in = itr.value().toLongLong(&ok); // clang make qint64 to qint32, don't know why.
112112
if (ok) {
113113
if (QLineEdit *lineEdit = reinterpret_cast<QLineEdit*>(in)) {
114114
obj.insert(itr.key(), QJsonValue(lineEdit->text()));
@@ -119,7 +119,7 @@ void ActionEditor::on_pushButtonOk_clicked()
119119
QJsonArray array;
120120
for (auto i = 0; i < list.size(); ++i) {
121121
auto ok2 = false;
122-
auto in2 = list.at(i).toInt(&ok2);
122+
auto in2 = list.at(i).toLongLong(&ok2);
123123
if (ok2) {
124124
if (QLineEdit *lineEdit = reinterpret_cast<QLineEdit*>(in2)) {
125125
auto text = lineEdit->text();

0 commit comments

Comments
 (0)