]> git.sesse.net Git - kdenlive/commitdiff
rect in titlewidget
authorMarco Gittler <marco@gitma.de>
Tue, 26 Feb 2008 00:19:11 +0000 (00:19 +0000)
committerMarco Gittler <marco@gitma.de>
Tue, 26 Feb 2008 00:19:11 +0000 (00:19 +0000)
svn path=/branches/KDE4/; revision=1947

src/titlewidget.cpp
src/titlewidget.h
src/widgets/titlewidget_ui.ui

index 0f0e9a41358b370bd217f6db916cedd1b8363465..b0b9b6f90a970b198c22787f91e688dd1da80a5f 100644 (file)
@@ -7,6 +7,7 @@
 TitleWidget::TitleWidget (QDialog *parent):QDialog(parent){
        setupUi(this);
        connect (newTextButton,SIGNAL(clicked()), this, SLOT( slotNewText()));
+       connect (newRectButton,SIGNAL(clicked()), this, SLOT( slotNewRect()));
        connect (kcolorbutton, SIGNAL ( clicked()), this, SLOT( slotChangeBackground()) ) ;
        connect (horizontalSlider, SIGNAL ( valueChanged(int) ), this, SLOT( slotChangeBackground()) ) ;
        connect (ktextedit, SIGNAL(textChanged()), this , SLOT (textChanged()));
@@ -35,22 +36,35 @@ TitleWidget::TitleWidget (QDialog *parent):QDialog(parent){
        update();
 }
 
-void TitleWidget::slotNewText(){
+void TitleWidget::slotNewRect(){
        
+       QGraphicsRectItem * ri=graphicsView->scene()->addRect(-50,-50,100,100);
+       ri->setFlags(QGraphicsItem::ItemIsMovable|QGraphicsItem::ItemIsSelectable);
+
+}
+void TitleWidget::slotNewText(){
        QGraphicsTextItem *tt=graphicsView->scene()->addText("Text here");
        tt->setFlags(QGraphicsItem::ItemIsMovable|QGraphicsItem::ItemIsSelectable);
        tt->setTextInteractionFlags (Qt::TextEditorInteraction);
        kDebug() << tt->metaObject()->className();
        /*QGraphicsRectItem * ri=graphicsView->scene()->addRect(-50,-50,100,100);
        ri->setFlags(QGraphicsItem::ItemIsMovable|QGraphicsItem::ItemIsSelectable);*/
-
+       
 }
+
 void TitleWidget::selectionChanged(){
        QList<QGraphicsItem*> l=graphicsView->scene()->selectedItems();
        if (l.size()>0){
+               kDebug() << (l[0])->type();
                if ((l[0])->type()==8){
                        ktextedit->setHtml(((QGraphicsTextItem*)l[0])->toHtml());
                        toolBox->setCurrentIndex(1);
+               }else
+               if ((l[0])->type()==3){
+                       
+                       toolBox->setCurrentIndex(2);
+               }else{
+                       toolBox->setCurrentIndex(0);
                }
        }
 }
index 3f883617e8aaeaf4a67dab4db4ebd42805f29c1a..82c6fc63389358fb77f8aa446f98a50ad7f12db7 100644 (file)
@@ -10,6 +10,7 @@ public:
                TitleWidget(QDialog *parent=0);
 public slots:
        void slotNewText();
+       void slotNewRect();
        void slotChangeBackground();
        void selectionChanged();
        void textChanged();
index fde8472b7f9ffb860ca26a230cb01cd136de7106..7e7412ec877794c353f752c44b37b4439b885e11 100644 (file)
   <layout class="QGridLayout" >
    <item row="0" column="0" >
     <layout class="QVBoxLayout" >
-     <item>
-      <widget class="QPushButton" name="pushButton" >
-       <property name="text" >
-        <string>PushButton</string>
-       </property>
-      </widget>
-     </item>
      <item>
       <layout class="QHBoxLayout" >
        <item>
        <item>
         <widget class="QToolBox" name="toolBox" >
          <property name="currentIndex" >
-          <number>1</number>
+          <number>2</number>
          </property>
          <widget class="QWidget" name="Background" >
           <property name="geometry" >
            <rect>
             <x>0</x>
             <y>0</y>
-            <width>341</width>
-            <height>238</height>
+            <width>94</width>
+            <height>65</height>
            </rect>
           </property>
           <attribute name="label" >
@@ -69,8 +62,8 @@
            <rect>
             <x>0</x>
             <y>0</y>
-            <width>341</width>
-            <height>238</height>
+            <width>286</width>
+            <height>136</height>
            </rect>
           </property>
           <attribute name="label" >
            <rect>
             <x>0</x>
             <y>0</y>
-            <width>94</width>
-            <height>24</height>
+            <width>322</width>
+            <height>295</height>
            </rect>
           </property>
           <attribute name="label" >
            <string>Rectangle</string>
           </attribute>
+          <layout class="QGridLayout" >
+           <item row="0" column="0" >
+            <layout class="QVBoxLayout" >
+             <item>
+              <widget class="QPushButton" name="newRectButton" >
+               <property name="text" >
+                <string>New Rect</string>
+               </property>
+              </widget>
+             </item>
+             <item>
+              <widget class="QGroupBox" name="groupBox" >
+               <property name="title" >
+                <string>Foreground</string>
+               </property>
+               <layout class="QGridLayout" >
+                <item row="0" column="0" >
+                 <layout class="QGridLayout" >
+                  <item row="0" column="0" >
+                   <widget class="QCheckBox" name="checkBox" >
+                    <property name="text" >
+                     <string>show</string>
+                    </property>
+                   </widget>
+                  </item>
+                  <item row="0" column="1" colspan="2" >
+                   <widget class="KColorButton" name="kcolorbutton_5" />
+                  </item>
+                  <item row="1" column="0" >
+                   <widget class="QLabel" name="label_3" >
+                    <property name="text" >
+                     <string>Alpha</string>
+                    </property>
+                   </widget>
+                  </item>
+                  <item rowspan="2" row="1" column="2" >
+                   <widget class="QLabel" name="label_4" >
+                    <property name="text" >
+                     <string>Linewidth</string>
+                    </property>
+                   </widget>
+                  </item>
+                  <item rowspan="2" row="2" column="0" colspan="2" >
+                   <widget class="QSlider" name="horizontalSlider_3" >
+                    <property name="orientation" >
+                     <enum>Qt::Horizontal</enum>
+                    </property>
+                   </widget>
+                  </item>
+                  <item row="3" column="2" >
+                   <widget class="QSpinBox" name="spinBox" />
+                  </item>
+                 </layout>
+                </item>
+               </layout>
+              </widget>
+             </item>
+             <item>
+              <widget class="QGroupBox" name="groupBox_2" >
+               <property name="title" >
+                <string>Background</string>
+               </property>
+               <layout class="QGridLayout" >
+                <item row="0" column="0" >
+                 <layout class="QGridLayout" >
+                  <item row="0" column="0" >
+                   <widget class="QCheckBox" name="checkBox_2" >
+                    <property name="text" >
+                     <string>show</string>
+                    </property>
+                   </widget>
+                  </item>
+                  <item row="0" column="1" >
+                   <widget class="KColorButton" name="kcolorbutton_6" />
+                  </item>
+                  <item row="1" column="0" >
+                   <widget class="QLabel" name="label" >
+                    <property name="text" >
+                     <string>Alpha:</string>
+                    </property>
+                   </widget>
+                  </item>
+                  <item row="1" column="1" >
+                   <widget class="QLabel" name="label_2" >
+                    <property name="text" >
+                     <string>Linewidth</string>
+                    </property>
+                   </widget>
+                  </item>
+                  <item row="2" column="0" >
+                   <widget class="QSlider" name="horizontalSlider_4" >
+                    <property name="orientation" >
+                     <enum>Qt::Horizontal</enum>
+                    </property>
+                   </widget>
+                  </item>
+                  <item row="2" column="1" >
+                   <widget class="QSpinBox" name="spinBox_2" />
+                  </item>
+                 </layout>
+                </item>
+               </layout>
+              </widget>
+             </item>
+            </layout>
+           </item>
+          </layout>
          </widget>
         </widget>
        </item>