]> Git trees. - libqmvoc.git/commitdiff
I needed to introduce this new ctor because I am using a KPlotWidget in a .ui file...
authorCarsten Niehaus <cniehaus@gmx.de>
Tue, 17 Oct 2006 16:14:32 +0000 (16:14 +0000)
committerCarsten Niehaus <cniehaus@gmx.de>
Tue, 17 Oct 2006 16:14:32 +0000 (16:14 +0000)
Jason, Pino, what do you think?

CCMAIL:kde-edu@kde.org

svn path=/trunk/KDE/kdeedu/libkdeedu/; revision=596476

kdeeduplot/kplotwidget.cpp
kdeeduplot/kplotwidget.h

index b28a95e07f2379d43d9fb9426a1e2f34006c21ea..f9494eed11b3a93e418e1dbedb0aaa4a8074a736 100644 (file)
 #define XPADDING 20
 #define YPADDING 20
 
+KPlotWidget::KPlotWidget( QWidget *parent )
+ : QFrame( parent ), ShowGrid( false ), ShowObjectToolTips( true ), UseAntialias( false )
+{
+       setAttribute( Qt::WA_NoBackground, true );
+
+  double x1 = 0.0;
+  double x2 = 1.0;
+  double y1 = 0.0;
+  double y2 = 1.0;
+
+       // create the axes
+       mAxes[LeftAxis] = new KPlotAxis();
+       mAxes[BottomAxis] = new KPlotAxis();
+       mAxes[RightAxis] = new KPlotAxis();
+       mAxes[TopAxis] = new KPlotAxis();
+
+       //set DataRect
+       setLimits( x1, x2, y1, y2 );
+       SecondDataRect = QRect(); //default: no secondary data rect
+
+       //By default, the left and bottom axes have tickmark labels
+       axis(LeftAxis)->setShowTickLabels( true );
+       axis(BottomAxis)->setShowTickLabels( true );
+
+       setDefaultPaddings();
+
+       //default colors:
+       setBackgroundColor( Qt::black );
+       setForegroundColor( Qt::white );
+       setGridColor( Qt::gray );
+
+       setMinimumSize( 150, 150 );
+
+}
+
 KPlotWidget::KPlotWidget( double x1, double x2, double y1, double y2, QWidget *parent )
  : QFrame( parent ), ShowGrid( false ), ShowObjectToolTips( true ), UseAntialias( false )
 {
index 13d54109d952bfeab0760ab106a08e56fe0c9047..653de10e90d47bd099c475b5a609201991ff6887 100644 (file)
@@ -91,6 +91,12 @@ public:
         * @param parent the parent widget
         */
        KPlotWidget( double x1=0.0, double x2=1.0, double y1=0.0, double y2=1.0, QWidget *parent=0 );
+       
+       /**
+        * @short Constructor. x and y limits will be set to 0.0 and 1.0 (min/max)
+        * @param parent the parent widget
+        */
+  KPlotWidget( QWidget *parent=0 );
 
        /**
         * Destructor.