]> git.sesse.net Git - kdenlive/commitdiff
first classes for geometry widget
authorMarco Gittler <marco@gitma.de>
Sun, 3 Aug 2008 10:19:42 +0000 (10:19 +0000)
committerMarco Gittler <marco@gitma.de>
Sun, 3 Aug 2008 10:19:42 +0000 (10:19 +0000)
svn path=/branches/KDE4/; revision=2355

src/CMakeLists.txt
src/clipdurationdialog.cpp
src/effectstackedit.cpp
src/geometryval.cpp [new file with mode: 0644]
src/geometryval.h [new file with mode: 0644]
src/widgets/geometryval_ui.ui [new file with mode: 0644]

index b5fdf7f13e943bd999bc5c0f1782ec53da3c2af4..49ab15c3c0da6840a039b466894541fb9c9b2e79 100644 (file)
@@ -55,6 +55,7 @@ kde4_add_ui_files(kdenlive_UI
   widgets/keyframedialog_ui.ui
   widgets/clipdurationdialog_ui.ui
   widgets/managecaptures_ui.ui
+  widgets/geometryval_ui.ui
 )
  
 set(kdenlive_SRCS 
@@ -125,6 +126,7 @@ set(kdenlive_SRCS
   clipdurationdialog.cpp
   managecapturesdialog.cpp
   changespeedcommand.cpp
+  geometryval.cpp
 )
 
 kde4_add_kcfg_files(kdenlive_SRCS GENERATE_MOC kdenlivesettings.kcfgc )
index c350a8c78c79215577baf02c18f138e51010ad58..73afbec7e30a1cab25e6f1088e85625b0cdd5541 100644 (file)
@@ -112,7 +112,6 @@ GenTime ClipDurationDialog::duration() const {
 }
 
 void ClipDurationDialog::wheelEvent(QWheelEvent * event) {
-    kDebug() << "jaa";
     if (m_view.clip_position->underMouse()) {
         if (event->delta() > 0)
             slotPosUp();
index d553a04947ec05b851cf4fdb0940ea01baa86a18..ca8ae5d0f87af6be882e865b8d0da5639745afcc 100644 (file)
@@ -30,6 +30,7 @@
 #include "ui_colorval_ui.h"
 #include "ui_wipeval_ui.h"
 #include "complexparameter.h"
+#include "geometryval.h"
 
 QMap<QString, QImage> EffectStackEdit::iconCache;
 
@@ -137,7 +138,7 @@ void EffectStackEdit::transferParamDesc(const QDomElement& d, int , int) {
             bval->checkBox->setText(na.toElement().text());
             valueItems[paramName] = bval;
             uiItems.append(bval);
-        } else if (type == "complex" || type == "geometry") {
+        } else if (type == "complex") {
             /*QStringList names=nodeAtts.namedItem("name").nodeValue().split(";");
             QStringList max=nodeAtts.namedItem("max").nodeValue().split(";");
             QStringList min=nodeAtts.namedItem("min").nodeValue().split(";");
@@ -157,6 +158,13 @@ void EffectStackEdit::transferParamDesc(const QDomElement& d, int , int) {
             vbox->addWidget(pl);
             valueItems[paramName+"complex"] = pl;
             items.append(pl);
+        } else if (type == "geometry") {
+            Geometryval *geo = new Geometryval;
+            connect(geo, SIGNAL(parameterChanged()), this, SLOT(collectAllParameters()));
+            geo->setupParam(d, pa.attribute("name"), 0, 100);
+            vbox->addWidget(geo);
+            valueItems[paramName+"geometry"] = geo;
+            items.append(geo);
         } else if (type == "color") {
             Ui::Colorval_UI *cval = new Ui::Colorval_UI;
             cval->setupUi(toFillin);
@@ -323,9 +331,12 @@ void EffectStackEdit::collectAllParameters() {
         } else if (type == "color") {
             KColorButton *color = ((Ui::Colorval_UI*)valueItems[na.toElement().text()])->kcolorbutton;
             setValue.sprintf("0x%08x", color->color().rgba());
-        } else if (type == "complex" || type == "geometry") {
+        } else if (type == "complex") {
             ComplexParameter *complex = ((ComplexParameter*)valueItems[na.toElement().text()+"complex"]);
             namenode.item(i) = complex->getParamDesc();
+        } else if (type == "geometry") {
+            Geometryval *geom = ((Geometryval*)valueItems[na.toElement().text()+"geometry"]);
+            namenode.item(i) = geom->getParamDesc();
         } else if (type == "wipe") {
             Ui::Wipeval_UI *wp = (Ui::Wipeval_UI*)valueItems[na.toElement().text()];
             wipeInfo info;
diff --git a/src/geometryval.cpp b/src/geometryval.cpp
new file mode 100644 (file)
index 0000000..a220362
--- /dev/null
@@ -0,0 +1,38 @@
+/***************************************************************************
+                          geomeytrval.cpp  -  description
+                             -------------------
+    begin                : 03 Aug 2008
+    copyright            : (C) 2008 by Marco Gittler
+    email                : g.marco@freenet.de
+ ***************************************************************************/
+
+/***************************************************************************
+ *                                                                         *
+ *   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 "geometryval.h"
+#include <QGraphicsView>
+#include <QVBoxLayout>
+#include <QGraphicsScene>
+#include "graphicsscenerectmove.h"
+
+Geometryval::Geometryval(QWidget* parent): QWidget(parent) {
+    ui.setupUi(this);
+    QVBoxLayout* vbox = new QVBoxLayout(this);
+    ui.widget->setLayout(vbox);
+    QGraphicsView *view = new QGraphicsView(this);
+    vbox->addWidget(view);
+    //scene= new QGraphicsScene;
+
+    scene = new GraphicsSceneRectMove(this);
+    view->setScene(scene);
+}
+QDomElement Geometryval::getParamDesc() {}
+
+void Geometryval::setupParam(const QDomElement&, const QString& paramName, int, int) {}
diff --git a/src/geometryval.h b/src/geometryval.h
new file mode 100644 (file)
index 0000000..7189269
--- /dev/null
@@ -0,0 +1,42 @@
+/***************************************************************************
+                          geomeytrval.h  -  description
+                             -------------------
+    begin                : 03 Aug 2008
+    copyright            : (C) 2008 by Marco Gittler
+    email                : g.marco@freenet.de
+ ***************************************************************************/
+
+/***************************************************************************
+ *                                                                         *
+ *   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.                                   *
+ *                                                                         *
+ ***************************************************************************/
+
+#ifndef GEOMETRYVAL_H
+#define GEOMETRYVAL_H
+
+
+#include "ui_geometryval_ui.h"
+#include <QWidget>
+#include <QDomElement>
+
+//class QGraphicsScene;
+class GraphicsSceneRectMove;
+class Geometryval : public QWidget {
+public:
+    Geometryval(QWidget* parent = 0);
+    QDomElement getParamDesc();
+private:
+    Ui::Geometryval ui;
+    //QGraphicsScene* scene;
+    GraphicsSceneRectMove *scene;
+public slots:
+    void setupParam(const QDomElement&, const QString& paramName, int, int);
+signals:
+    void parameterChanged();
+};
+
+#endif
diff --git a/src/widgets/geometryval_ui.ui b/src/widgets/geometryval_ui.ui
new file mode 100644 (file)
index 0000000..47f1e0c
--- /dev/null
@@ -0,0 +1,51 @@
+<ui version="4.0" >
+ <class>Geometryval</class>
+ <widget class="QWidget" name="Geometryval" >
+  <property name="geometry" >
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>400</width>
+    <height>300</height>
+   </rect>
+  </property>
+  <property name="windowTitle" >
+   <string>Form</string>
+  </property>
+  <layout class="QGridLayout" name="gridLayout" >
+   <item row="0" column="0" >
+    <widget class="QLabel" name="label" >
+     <property name="text" >
+      <string>Geometry</string>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="0" >
+    <widget class="QWidget" native="1" name="widget" >
+     <property name="sizePolicy" >
+      <sizepolicy vsizetype="MinimumExpanding" hsizetype="MinimumExpanding" >
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+    </widget>
+   </item>
+   <item row="2" column="0" >
+    <widget class="QSlider" name="frame" >
+     <property name="orientation" >
+      <enum>Qt::Horizontal</enum>
+     </property>
+    </widget>
+   </item>
+   <item row="3" column="0" >
+    <widget class="QCheckBox" name="isKeyFrame" >
+     <property name="text" >
+      <string>Keyframe</string>
+     </property>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>