summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/svg/embedded/fluidlauncher/fluidlauncher.cpp4
-rw-r--r--examples/svg/opengl/framebufferobject/glwidget.cpp4
2 files changed, 4 insertions, 4 deletions
diff --git a/examples/svg/embedded/fluidlauncher/fluidlauncher.cpp b/examples/svg/embedded/fluidlauncher/fluidlauncher.cpp
index 23d569d..ae36595 100644
--- a/examples/svg/embedded/fluidlauncher/fluidlauncher.cpp
+++ b/examples/svg/embedded/fluidlauncher/fluidlauncher.cpp
@@ -48,11 +48,11 @@
**
****************************************************************************/
+#include <QScreen>
#include <QXmlStreamReader>
#include "fluidlauncher.h"
-
#define DEFAULT_INPUT_TIMEOUT 10000
#define SIZING_FACTOR_HEIGHT 6/10
#define SIZING_FACTOR_WIDTH 6/10
@@ -68,7 +68,7 @@ FluidLauncher::FluidLauncher(QStringList* args)
setCurrentWidget(pictureFlowWidget);
pictureFlowWidget->setFocus();
- QRect screen_size = QApplication::desktop()->screenGeometry();
+ QRect screen_size = QGuiApplication::primaryScreen()->geometry();
QObject::connect(pictureFlowWidget, SIGNAL(itemActivated(int)), this, SLOT(launchApplication(int)));
QObject::connect(pictureFlowWidget, SIGNAL(inputReceived()), this, SLOT(resetInputTimeout()));
diff --git a/examples/svg/opengl/framebufferobject/glwidget.cpp b/examples/svg/opengl/framebufferobject/glwidget.cpp
index a3c0d51..38ee5db 100644
--- a/examples/svg/opengl/framebufferobject/glwidget.cpp
+++ b/examples/svg/opengl/framebufferobject/glwidget.cpp
@@ -228,8 +228,8 @@ void GLWidget::draw()
const QString str1(tr("A simple OpenGL framebuffer object example."));
const QString str2(tr("Use the mouse wheel to zoom, press buttons and move mouse to rotate, double-click to flip."));
QFontMetrics fm(p.font());
- p.drawText(width()/2 - fm.width(str1)/2, 20, str1);
- p.drawText(width()/2 - fm.width(str2)/2, 20 + fm.lineSpacing(), str2);
+ p.drawText(width()/2 - fm.horizontalAdvance(str1)/2, 20, str1);
+ p.drawText(width()/2 - fm.horizontalAdvance(str2)/2, 20 + fm.lineSpacing(), str2);
}
void GLWidget::mousePressEvent(QMouseEvent *e)