summaryrefslogtreecommitdiffstats
path: root/helper.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'helper.cpp')
-rw-r--r--helper.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/helper.cpp b/helper.cpp
index 247baca..80a8bc2 100644
--- a/helper.cpp
+++ b/helper.cpp
@@ -17,6 +17,10 @@
#include <QPixmap>
#include <QTemporaryFile>
#include <QProcess>
+#include <QRect>
+#include <QWidget>
+#include <QDesktopWidget>
+#include <QApplication>
#include <stdio.h>
@@ -201,5 +205,11 @@ namespace Helper {
bool FileInfoListContains::operator ()(const QFileInfo &info, const QString &file) const {
return info.fileName() == file;
}
+
+ void centerWidget(QWidget *widget){
+ QRect widgetRect = widget->rect();
+ widgetRect.moveCenter(qApp->desktop()->screenGeometry().center());
+ widget->move(widgetRect.topLeft());
+ }
}