summaryrefslogtreecommitdiffstats
path: root/examples/widgets/draganddrop/draggabletext/dragwidget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/widgets/draganddrop/draggabletext/dragwidget.cpp')
-rw-r--r--examples/widgets/draganddrop/draggabletext/dragwidget.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/examples/widgets/draganddrop/draggabletext/dragwidget.cpp b/examples/widgets/draganddrop/draggabletext/dragwidget.cpp
index d56f91e9001..4142a564356 100644
--- a/examples/widgets/draganddrop/draggabletext/dragwidget.cpp
+++ b/examples/widgets/draganddrop/draggabletext/dragwidget.cpp
@@ -20,7 +20,12 @@ DragWidget::DragWidget(QWidget *parent)
: QWidget(parent)
{
QFile dictionaryFile(QStringLiteral(":/dictionary/words.txt"));
- dictionaryFile.open(QIODevice::ReadOnly);
+ if (!dictionaryFile.open(QIODevice::ReadOnly)) {
+ // This would be a build problem, as the dictionary is in the
+ // resource system.
+ qFatal("Could not open the dictionary file: %s",
+ qPrintable(dictionaryFile.errorString()));
+ }
QTextStream inputStream(&dictionaryFile);
int x = 5;