[Kst] branches/work/kst/portto4/kst/src

Adam Treat treat at kde.org
Fri Jun 15 23:05:07 CEST 2007


SVN commit 676062 by treat:

* Hook up the dialog.  It works by operating on 
all selected viewitems at once and is nonmodal.



 M  +2 -1      libkstapp/CMakeLists.txt  
 M  +16 -0     libkstapp/viewitem.cpp  
 M  +1 -0      libkstapp/viewitem.h  
 A             libkstapp/viewitemdialog.cpp   [License: GPL (v2+)]
 A             libkstapp/viewitemdialog.h   [License: GPL (v2+)]
 M  +11 -0     widgets/fillandstroke.cpp  
 M  +2 -8      widgets/fillandstroke.h  


--- branches/work/kst/portto4/kst/src/libkstapp/CMakeLists.txt #676061:676062
@@ -29,6 +29,7 @@
    viewcommand.cpp
    view.cpp
    viewitem.cpp
+   viewitemdialog.cpp
    )
 
 kde4_add_ui_files(kstapp_LIB_SRCS
@@ -42,7 +43,7 @@
 
 kde4_add_library(kstapp SHARED ${kstapp_LIB_SRCS})
 
-target_link_libraries(kstapp kstmath QtOpenGL)
+target_link_libraries(kstapp kstmath kstwidgets QtOpenGL)
 
 set_target_properties(kstapp PROPERTIES VERSION ${KST_LIBKST_VERSION} SOVERSION 2)
 install(TARGETS kstapp DESTINATION ${LIB_INSTALL_DIR} )
--- branches/work/kst/portto4/kst/src/libkstapp/viewitem.cpp #676061:676062
@@ -12,6 +12,7 @@
 #include "viewitem.h"
 #include "kstapplication.h"
 #include "tabwidget.h"
+#include "viewitemdialog.h"
 
 #include <QMenu>
 #include <QDebug>
@@ -309,6 +310,18 @@
 }
 
 
+void ViewItem::edit() {
+
+  QList<ViewItem*> list;
+  QList<QGraphicsItem*> select = scene()->selectedItems();
+  foreach(QGraphicsItem *item, select) {
+    list << qgraphicsitem_cast<ViewItem*>(item);
+  }
+
+  ViewItemDialog::self()->show(list);
+}
+
+
 void ViewItem::creationPolygonChanged(View::CreationEvent event) {
   if (event == View::MousePress) {
     const QPolygonF poly = mapFromScene(parentView()->creationPolygon(View::MousePress));
@@ -352,6 +365,9 @@
   QAction *lowerAction = menu.addAction(tr("Lower"));
   connect(lowerAction, SIGNAL(triggered()), this, SLOT(lower()));
 
+  QAction *editAction = menu.addAction(tr("Edit"));
+  connect(editAction, SIGNAL(triggered()), this, SLOT(edit()));
+
   menu.exec(event->screenPos());
 }
 
--- branches/work/kst/portto4/kst/src/libkstapp/viewitem.h #676061:676062
@@ -72,6 +72,7 @@
   void remove();
   void raise();
   void lower();
+  void edit();
   void setTopLeft(const QPointF &point);
   void setTopRight(const QPointF &point);
   void setBottomLeft(const QPointF &point);
--- branches/work/kst/portto4/kst/src/widgets/fillandstroke.cpp #676061:676062
@@ -66,6 +66,17 @@
   _capStyle->addItem("FlatCap", Qt::FlatCap);
   _capStyle->addItem("SquareCap", Qt::SquareCap);
   _capStyle->addItem("RoundCap", Qt::RoundCap);
+
+
+  connect(_color, SIGNAL(changed(const QColor &)), this, SIGNAL(fillChanged()));
+  connect(_fillStyle, SIGNAL(currentIndexChanged(int)), this, SIGNAL(fillChanged()));
+
+  connect(_strokeStyle, SIGNAL(currentIndexChanged(int)), this, SIGNAL(strokeChanged()));
+  connect(_width, SIGNAL(valueChanged(double)), this, SIGNAL(strokeChanged()));
+  connect(_brushColor, SIGNAL(changed(const QColor &)), this, SIGNAL(strokeChanged()));
+  connect(_brushStyle, SIGNAL(currentIndexChanged(int)), this, SIGNAL(strokeChanged()));
+  connect(_joinStyle, SIGNAL(currentIndexChanged(int)), this, SIGNAL(strokeChanged()));
+  connect(_capStyle, SIGNAL(currentIndexChanged(int)), this, SIGNAL(strokeChanged()));
 }
 
 
--- branches/work/kst/portto4/kst/src/widgets/fillandstroke.h #676061:676062
@@ -50,14 +50,8 @@
   void setCapStyle(Qt::PenCapStyle style);
 
 Q_SIGNALS:
-  void fillColorChanged(const QColor &color);
-  void fillStyleChanged(Qt::BrushStyle style);
-  void strokeStyleChanged(Qt::PenStyle style);
-  void strokeWidthChanged(qreal width);
-  void brushColorChanged(const QColor &color);
-  void brushStyleChanged(Qt::BrushStyle style);
-  void joinStyleChanged(Qt::PenJoinStyle style);
-  void capStyleChanged(Qt::PenCapStyle style);
+  void fillChanged();
+  void strokeChanged();
 };
 
 }


More information about the Kst mailing list