diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/gui/openglwindow/main.cpp | 2 | ||||
-rw-r--r-- | examples/opengl/hellogl_es2/glwidget.cpp | 12 | ||||
-rw-r--r-- | examples/widgets/doc/src/treemodelcompleter.qdoc | 2 |
3 files changed, 8 insertions, 8 deletions
diff --git a/examples/gui/openglwindow/main.cpp b/examples/gui/openglwindow/main.cpp index 237680a889..aa1c6d7fa1 100644 --- a/examples/gui/openglwindow/main.cpp +++ b/examples/gui/openglwindow/main.cpp @@ -144,7 +144,7 @@ void TriangleWindow::render() m_program->bind(); QMatrix4x4 matrix; - matrix.perspective(60, 4.0/3.0, 0.1, 100.0); + matrix.perspective(60.0f, 4.0f/3.0f, 0.1f, 100.0f); matrix.translate(0, 0, -2); matrix.rotate(100.0f * m_frame / screen()->refreshRate(), 0, 1, 0); diff --git a/examples/opengl/hellogl_es2/glwidget.cpp b/examples/opengl/hellogl_es2/glwidget.cpp index a5c22447f0..7267cfd124 100644 --- a/examples/opengl/hellogl_es2/glwidget.cpp +++ b/examples/opengl/hellogl_es2/glwidget.cpp @@ -308,12 +308,12 @@ void GLWidget::paintGL() bubble->drawBubble(&painter); } - QString framesPerSecond; - framesPerSecond.setNum(frames /(time.elapsed() / 1000.0), 'f', 2); - - painter.setPen(Qt::white); - - painter.drawText(20, 40, framesPerSecond + " fps"); + if (const int elapsed = time.elapsed()) { + QString framesPerSecond; + framesPerSecond.setNum(frames /(elapsed / 1000.0), 'f', 2); + painter.setPen(Qt::white); + painter.drawText(20, 40, framesPerSecond + " fps"); + } painter.end(); diff --git a/examples/widgets/doc/src/treemodelcompleter.qdoc b/examples/widgets/doc/src/treemodelcompleter.qdoc index 9411371d12..82ed9a3e79 100644 --- a/examples/widgets/doc/src/treemodelcompleter.qdoc +++ b/examples/widgets/doc/src/treemodelcompleter.qdoc @@ -83,7 +83,7 @@ \snippet tools/treemodelcompleter/treemodelcompleter.cpp 2 As mentioned earlier, the \c splitPath() function is reimplemented because - the default implementation is more suited to QDirModel or list models. In + the default implementation is more suited to QFileSystemModel or list models. In order for QCompleter to split the path into a list of strings that are matched at each level, we split it using QString::split() with \c sep as its separator. |