[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kdelibs/frameworks] kdeui/dialogs: Port away from KDialog
From:       Kevin Ottens <ervin+bluesystems () kde ! org>
Date:       2012-12-13 17:14:00
Message-ID: 20121213171400.C6AFEA60D6 () git ! kde ! org
[Download RAW message or body]

Git commit 9965c96671ca62bd815622a536fae34eed7155ec by Kevin Ottens.
Committed on 12/12/2012 at 17:02.
Pushed by ervin into branch 'frameworks'.

Port away from KDialog

M  +12   -11   kdeui/dialogs/kpixmapregionselectordialog.cpp
M  +2    -2    kdeui/dialogs/kpixmapregionselectordialog.h

http://commits.kde.org/kdelibs/9965c96671ca62bd815622a536fae34eed7155ec

diff --git a/kdeui/dialogs/kpixmapregionselectordialog.cpp \
b/kdeui/dialogs/kpixmapregionselectordialog.cpp index d3b7765..9678867 100644
--- a/kdeui/dialogs/kpixmapregionselectordialog.cpp
+++ b/kdeui/dialogs/kpixmapregionselectordialog.cpp
@@ -19,7 +19,7 @@
 
 #include "kpixmapregionselectordialog.h"
 
-#include <QDialog>
+#include <QDialogButtonBox>
 #include <QDesktopWidget>
 #include <QImage>
 #include <QLabel>
@@ -58,23 +58,24 @@ public:
 };
 
 KPixmapRegionSelectorDialog::KPixmapRegionSelectorDialog( QWidget *parent )
-  : KDialog( parent ),
+  : QDialog( parent ),
     d( new Private(this) )
 {
-  setCaption( i18n("Select Region of Image") );
-  setButtons( Help|Ok|Cancel );
+  setWindowTitle( i18n("Select Region of Image") );
 
-  QWidget *content = new QWidget(this);
-  QVBoxLayout * boxLayout = new QVBoxLayout(content);
-  boxLayout->setMargin(0);
+  QVBoxLayout *boxLayout = new QVBoxLayout(this);
 
-  QLabel *label = new QLabel(i18n("Please click and drag on the image to select the \
                region of interest:"), content);
-  d->pixmapSelectorWidget = new KPixmapRegionSelectorWidget(content);
+  QLabel *label = new QLabel(i18n("Please click and drag on the image to select the \
region of interest:"), this); +  d->pixmapSelectorWidget = new \
KPixmapRegionSelectorWidget(this); +
+  QDialogButtonBox *buttonBox = new QDialogButtonBox(this);
+  buttonBox->setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
+  connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
+  connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
 
   boxLayout->addWidget(label);
   boxLayout->addWidget(d->pixmapSelectorWidget);
-
-  setMainWidget(content);
+  boxLayout->addWidget(buttonBox);
 
   d->init();
 }
diff --git a/kdeui/dialogs/kpixmapregionselectordialog.h \
b/kdeui/dialogs/kpixmapregionselectordialog.h index e32a137..e0d7717 100644
--- a/kdeui/dialogs/kpixmapregionselectordialog.h
+++ b/kdeui/dialogs/kpixmapregionselectordialog.h
@@ -20,7 +20,7 @@
 #ifndef KPIXMAPREGIONSELECTORDIALOG_H
 #define KPIXMAPREGIONSELECTORDIALOG_H
 
-#include <kdialog.h>
+#include <QDialog>
 
 #include <kdeui_export.h>
 
@@ -43,7 +43,7 @@ class QImage;
  *
  * @author Antonio Larrosa <larrosa@kde.org>
  */
-class KDEUI_EXPORT KPixmapRegionSelectorDialog : public KDialog
+class KDEUI_EXPORT KPixmapRegionSelectorDialog : public QDialog
 {
 Q_OBJECT
 public:


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic