[Uml-devel] KDE/kdesdk/umbrello/umbrello

Andi Fischer andi.fischer at hispeed.ch
Sat Jun 28 08:09:25 UTC 2008


SVN commit 825421 by fischer:

Adding new function because of porting Q3ButtonGroup to QButtonGroup.

 M  +23 -11    dialog_utils.cpp  
 M  +11 -6     dialog_utils.h  


--- trunk/KDE/kdesdk/umbrello/umbrello/dialog_utils.cpp #825420:825421
@@ -5,32 +5,33 @@
  *   the Free Software Foundation; either version 2 of the License, or     *
  *   (at your option) any later version.                                   *
  *                                                                         *
- *   copyright (C) 2004-2006                                               *
+ *   copyright (C) 2004-2008                                               *
  *   Umbrello UML Modeller Authors <uml-devel at uml.sf.net>                  *
  ***************************************************************************/
 
 // own header
 #include "dialog_utils.h"
 
-// qt/kde includes
+// qt includes
 #include <q3groupbox.h>
-#include <qlayout.h>
-#include <qlabel.h>
-#include <qlineedit.h>
+#include <QtGui/QLayout>
+#include <QtGui/QLabel>
+#include <QtGui/QLineEdit>
+#include <QtGui/QGridLayout>
+
+// kde includes
 #include <kinputdialog.h>
 #include <kmessagebox.h>
 #include <klocale.h>
 #include <klineedit.h>
 
-//Added by qt3to4:
-#include <QGridLayout>
-
 // app includes
 #include "uml.h"
 #include "umlwidget.h"
 
 namespace Dialog_Utils {
 
+/* deprecated */
 KLineEdit* makeLabeledEditField(Q3GroupBox *containingBox, QGridLayout *layout, int row,QLabel * &label, const QString& labelText, KLineEdit * &editField, const QString& editFieldText /* = QString() */)
 {
     label = new QLabel(labelText, containingBox);
@@ -41,17 +42,28 @@
     return editField;
 }
 
+KLineEdit* makeLabeledEditField(QGroupBox *containingBox, QGridLayout *layout, int row,QLabel * &label, const QString& labelText, KLineEdit * &editField, const QString& editFieldText /* = QString() */)
+{
+    label = new QLabel(labelText, containingBox);
+    layout->addWidget(label, row, 0);
+    editField = new KLineEdit(editFieldText, containingBox);
+    layout->addWidget(editField, row, 1 );
+    label->setBuddy(editField);
+    return editField;
+}
 
+
 void askNameForWidget(UMLWidget * &targetWidget, const QString& dialogTitle,
-                      const QString& dialogPrompt, const QString& defaultName) {
-
+                      const QString& dialogPrompt, const QString& defaultName)
+{
     bool pressedOK = false;
 
     QString name = KInputDialog::getText(dialogTitle, dialogPrompt, defaultName, &pressedOK, UMLApp::app());
 
     if (pressedOK) {
         targetWidget->setName(name);
-    } else {
+    }
+    else {
         targetWidget->cleanup();
         delete targetWidget;
         targetWidget = NULL;
--- trunk/KDE/kdesdk/umbrello/umbrello/dialog_utils.h #825420:825421
@@ -5,19 +5,19 @@
  *   the Free Software Foundation; either version 2 of the License, or     *
  *   (at your option) any later version.                                   *
  *                                                                         *
- *   copyright (C) 2004-2006                                               *
+ *   copyright (C) 2004-2008                                               *
  *   Umbrello UML Modeller Authors <uml-devel at uml.sf.net>                  *
  ***************************************************************************/
 
 #ifndef DIALOG_UTILS_H
 #define DIALOG_UTILS_H
 
-#include <qstring.h>
-//Added by qt3to4:
-#include <QLabel>
-#include <QGridLayout>
+#include <QtCore/QString>
+#include <QtGui/QLabel>
+#include <QtGui/QGridLayout>
 
 class Q3GroupBox;
+class QGroupBox;
 class QGridLayout;
 class QLabel;
 class UMLWidget;
@@ -43,11 +43,16 @@
  * @param editFieldText         Initialization text in the editField (optional.)
  * @return a pointer to the KLineEdit so you can setFocus() if necessary
  */
-KLineEdit* makeLabeledEditField(Q3GroupBox *containingBox, QGridLayout *layout, int row,
+KLineEdit* makeLabeledEditField(Q3GroupBox *containingBox, QGridLayout *layout, int row,  /* deprecated */
                                 QLabel * &label, const QString& labelText,
                                 KLineEdit * &editField,
                                 const QString& editFieldText = QString());
 
+KLineEdit* makeLabeledEditField(QGroupBox *containingBox, QGridLayout *layout, int row,
+                                QLabel * &label, const QString& labelText,
+                                KLineEdit * &editField,
+                                const QString& editFieldText = QString());
+
 /**
  * Helper function for requesting a name for an UMLWidget using a dialog.
  *




More information about the umbrello-devel mailing list