[Kst] kdeextragear-2/kst/kst

George Staikos staikos at kde.org
Tue Apr 6 22:46:51 CEST 2004


CVS commit by staikos: 

start the view in display mode now and add a checkbox to toggle layout mode
in the test app (defaulted to on)


  M +2 -2      ksttoplevelview.cpp   1.14
  M +15 -1     testview.cpp   1.4
  M +1 -0      testview.h   1.4


--- kdeextragear-2/kst/kst/ksttoplevelview.cpp  #1.13:1.14
@@ -26,5 +26,5 @@
 KstTopLevelView::KstTopLevelView(QWidget *parent, const char *name, WFlags w) : KstViewObject(), _w(new KstViewWidget(this, parent, name, w)) {
   _focusOn = false;
-  setViewMode(_mode = LayoutMode);
+  setViewMode(_mode = DisplayMode);
 }
 
@@ -32,5 +32,5 @@ KstTopLevelView::KstTopLevelView(QWidget
 KstTopLevelView::KstTopLevelView(QDomElement& e, QWidget *parent, const char *name, WFlags w) : KstViewObject(e), _w(new KstViewWidget(this, parent, name, w)) {
   _focusOn = false;
-  setViewMode(_mode = LayoutMode);
+  setViewMode(_mode = DisplayMode);
 }
 

--- kdeextragear-2/kst/kst/testview.cpp  #1.3:1.4
@@ -18,4 +18,5 @@
 #include <kdebug.h>
 
+#include <qcheckbox.h>
 #include <qframe.h>
 #include <qlayout.h>
@@ -45,4 +46,9 @@ TestView::TestView(QWidget *parent)
   connect(p, SIGNAL(clicked()), this, SLOT(clear()));
   hb->addWidget(p);
+  QCheckBox *c = new QCheckBox("Layout mode", f);
+  c->setChecked(true);
+  connect(c, SIGNAL(toggled(bool)), this, SLOT(layoutMode(bool)));
+  hb->addWidget(c);
+
   hb->addItem(new QSpacerItem(10,10));
 
@@ -51,4 +57,5 @@ TestView::TestView(QWidget *parent)
   resize(600, 450);
   show();
+  _view->setViewMode(KstTopLevelView::LayoutMode);
   _pos = QPoint(0, 0);
 }
@@ -69,5 +76,5 @@ void TestView::new2dPlot() {
   p->resize(QSize(50, 50));
   p->move(_pos);
-  _pos += QPoint(38, 12);
+  _pos += QPoint(24, 12);
   _view->appendChild(p);
   _view->paint();
@@ -85,4 +93,10 @@ void TestView::clear() {
 }
 
+
+void TestView::layoutMode(bool on) {
+  _view->setViewMode(on ? KstTopLevelView::LayoutMode : KstTopLevelView::DisplayMode);
+}
+
+
 #include "testview.moc"
 

--- kdeextragear-2/kst/kst/testview.h  #1.3:1.4
@@ -29,4 +29,5 @@ class TestView : public QDialog {
     void cleanup();
     void clear();
+    void layoutMode(bool on);
 
   private:





More information about the Kst mailing list