From 7195badbe2ff943d730f7d79ab183acec8ce26c3 Mon Sep 17 00:00:00 2001 From: Arno Date: Wed, 17 Aug 2011 21:46:39 +0200 Subject: Center Dialogs on screen Since I'm now using a tiling window manager dialogs have to center themselves on the screen. Otherwise they end up at QPoint(0,0). Not very nice. Subclassed QDialog to SmDialog and converted all dialogs. --- smdialog.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 smdialog.cpp (limited to 'smdialog.cpp') diff --git a/smdialog.cpp b/smdialog.cpp new file mode 100644 index 0000000..064474c --- /dev/null +++ b/smdialog.cpp @@ -0,0 +1,15 @@ +/* + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version + 2 of the License, or (at your option) any later version. +*/ + +#include "smdialog.h" +#include "helper.h" + +SmDialog::SmDialog(QWidget *parent, Qt::WindowFlags f) : QDialog(parent, f) {} + +void SmDialog::showEvent(QShowEvent *){ + Helper::centerWidget(this); +} -- cgit v1.2.3-70-g09d2