From 3b2b6961bcbe6c18a58434b1b262eaec51f3aa35 Mon Sep 17 00:00:00 2001 From: Marco Gittler Date: Sun, 3 Aug 2008 10:19:42 +0000 Subject: [PATCH] first classes for geometry widget svn path=/branches/KDE4/; revision=2355 --- src/CMakeLists.txt | 2 ++ src/clipdurationdialog.cpp | 1 - src/effectstackedit.cpp | 15 +++++++++-- src/geometryval.cpp | 38 ++++++++++++++++++++++++++ src/geometryval.h | 42 +++++++++++++++++++++++++++++ src/widgets/geometryval_ui.ui | 51 +++++++++++++++++++++++++++++++++++ 6 files changed, 146 insertions(+), 3 deletions(-) create mode 100644 src/geometryval.cpp create mode 100644 src/geometryval.h create mode 100644 src/widgets/geometryval_ui.ui diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b5fdf7f1..49ab15c3 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -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 ) diff --git a/src/clipdurationdialog.cpp b/src/clipdurationdialog.cpp index c350a8c7..73afbec7 100644 --- a/src/clipdurationdialog.cpp +++ b/src/clipdurationdialog.cpp @@ -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(); diff --git a/src/effectstackedit.cpp b/src/effectstackedit.cpp index d553a049..ca8ae5d0 100644 --- a/src/effectstackedit.cpp +++ b/src/effectstackedit.cpp @@ -30,6 +30,7 @@ #include "ui_colorval_ui.h" #include "ui_wipeval_ui.h" #include "complexparameter.h" +#include "geometryval.h" QMap 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 index 00000000..a2203626 --- /dev/null +++ b/src/geometryval.cpp @@ -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 +#include +#include +#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 index 00000000..7189269a --- /dev/null +++ b/src/geometryval.h @@ -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 +#include + +//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 index 00000000..47f1e0ca --- /dev/null +++ b/src/widgets/geometryval_ui.ui @@ -0,0 +1,51 @@ + + Geometryval + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + + Geometry + + + + + + + + 0 + 0 + + + + + + + + Qt::Horizontal + + + + + + + Keyframe + + + + + + + + -- 2.39.2