diff --git a/src/gui/image/qxpmhandler.cpp b/src/gui/image/qxpmhandler.cpp index be024d752dc..8f39d281e72 100644 --- a/src/gui/image/qxpmhandler.cpp +++ b/src/gui/image/qxpmhandler.cpp @@ -1137,7 +1137,7 @@ static bool write_xpm_image(const QImage &sourceImage, QIODevice *device, const s << '\"'; } s << "};" << Qt::endl; - return (s.status() == QTextStream::Ok); + return static_cast(s); } QXpmHandler::QXpmHandler() diff --git a/tests/manual/examples/widgets/draganddrop/fridgemagnets/dragwidget.cpp b/tests/manual/examples/widgets/draganddrop/fridgemagnets/dragwidget.cpp index a883e7c58af..f6fd06e96fb 100644 --- a/tests/manual/examples/widgets/draganddrop/fridgemagnets/dragwidget.cpp +++ b/tests/manual/examples/widgets/draganddrop/fridgemagnets/dragwidget.cpp @@ -21,9 +21,8 @@ DragWidget::DragWidget(QWidget *parent) int x = 5; int y = 5; - while (!inputStream.atEnd()) { - QString word; - inputStream >> word; + QString word; + while (inputStream >> word) { if (!word.isEmpty()) { DragLabel *wordLabel = new DragLabel(word, this); wordLabel->move(x, y);