[Kde-imaging] kdeextragear-libs-1/libkexif

Gilles Caulier caulier.gilles at free.fr
Wed Jun 9 22:33:31 CEST 2004


CVS commit by cgilles: 

Using KdialogBase in Kexif dialog. Using default button style from KDE API!


CCMAIL: digikam-devel at lists.sourceforge.net, kde-imaging at kde.org


  M +15 -33    kexif.cpp   1.2
  M +11 -7     kexif.h   1.2


--- kdeextragear-libs-1/libkexif/kexif.cpp  #1.1:1.2
@@ -54,11 +54,9 @@
 
 
-KExif::KExif(QWidget *parent, const char *name, WFlags fl)
-     : QWidget(parent, name, fl|Qt::WShowModal)
+KExif::KExif(QWidget *parent, const char *name)
+     : KDialogBase( Plain, i18n("Exif Informations"), Help|Close,
+                    Close, parent, name, true, true )
 {
-    int W=400, H=400;
-    resize(W, H);
-    move(QApplication::desktop()->width ()/2-(W/2), QApplication::desktop()->height()/2-(H/2));
-    QGridLayout* layout = new QGridLayout(this);
+    QGridLayout* layout = new QGridLayout(plainPage());
     layout->setSpacing(6);
     layout->setMargin(6);
@@ -66,9 +64,10 @@ KExif::KExif(QWidget *parent, const char
     // ------------------------------------------------------
 
-    mMainBox = new QGroupBox(1, Qt::Vertical, this);
-    layout->addWidget(mMainBox, 0, 0);
+    mMainBox = new QGroupBox(1, Qt::Vertical, plainPage());
 
     mTabWidget = new QTabWidget(mMainBox);
 
+    layout->addWidget(mMainBox, 0, 0);
+    
     connect(mTabWidget, SIGNAL(currentChanged(QWidget*)),
            this, SLOT(slot_tabPageChanged(QWidget*)));
@@ -76,6 +75,5 @@ KExif::KExif(QWidget *parent, const char
     // ------------------------------------------------------
 
-    QGroupBox *textBox = new QGroupBox(1, Qt::Vertical, this);
-    layout->addWidget(textBox, 1, 0);
+    QGroupBox *textBox = new QGroupBox(1, Qt::Vertical, plainPage());
 
     mTextEdit = new QTextEdit(textBox);
@@ -86,22 +84,10 @@ KExif::KExif(QWidget *parent, const char
                                          QSizePolicy::Minimum));
 
-    // ------------------------------------------------------
-
-    QButtonGroup *buttonGroup = new QButtonGroup(1, Qt::Horizontal,
-                                                 this);
-    layout->addWidget(buttonGroup, 2, 0);
-
-    QPushButton *okButton = new QPushButton(i18n("&Close"),
-                                            buttonGroup);
-    okButton->setSizePolicy(QSizePolicy(QSizePolicy::Fixed,
-                                        QSizePolicy::Fixed));
-    connect(okButton, SIGNAL(clicked()),
-            this, SLOT(slot_close()));
-
-    okButton->setFocus();
+    layout->addWidget(textBox, 1, 0);
 
     // ------------------------------------------------------
 
     mExifData = 0;
+    resize(500, 500);
 }
 
@@ -229,8 +215,4 @@ void KExif::slot_tabPageChanged(QWidget*
 }
 
-void KExif::slot_close()
-{
-    close();
-}
 
 #include "kexif.moc"

--- kdeextragear-libs-1/libkexif/kexif.h  #1.1:1.2
@@ -5,4 +5,5 @@
 //    Copyright (C) 2002-2004 Renchi Raju <renchi at pooh.tam.uiuc.edu>
 //                            Gilles CAULIER <caulier dot gilles at free.fr>
+//                            Ralf Hoelzer <kde at ralfhoelzer.com>
 //
 //    This program is free software; you can redistribute it and/or modify
@@ -29,4 +30,8 @@
 #include <qwidget.h>
 
+// Include files for KDE
+
+#include <kdialogbase.h>
+
 class QString;
 class QTabWidget;
@@ -36,5 +41,5 @@ class QGroupBox;
 class KExifData;
 
-class KExif : public QWidget
+class KExif : public KDialogBase
 {
     Q_OBJECT
@@ -42,6 +47,6 @@ class KExif : public QWidget
 public:
 
-    KExif(QWidget* parent=0, const char *name=0,
-          WFlags fl = WDestructiveClose);
+
+    KExif(QWidget* parent=0, const char *name=0);
     ~KExif();
 
@@ -62,5 +67,4 @@ private slots:
     void slot_tabPageChanged(QWidget*);
     void slot_showItemDescription(const QString& desc);
-    void slot_close();
 };
 




More information about the Kde-imaging mailing list