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

Adam Treat treat at kde.org
Thu Mar 1 23:50:26 CET 2007


SVN commit 638429 by treat:

* QRect and QString api changes


 M  +4 -4      kst.cpp  
 M  +17 -17    kst2dplot.cpp  
 M  +3 -3      kstdatacollection-gui.cpp  


--- branches/work/kst/portto4/kst/src/libkstapp/kst.cpp #638428:638429
@@ -2445,15 +2445,15 @@
 
       if (rename) {
 #if KDE_VERSION >= KDE_MAKE_VERSION(3,3,0)
-        name = KInputDialog::getText(i18n("Kst"), i18n("Enter a new name for the window:"), name, &ok, parent, 0L, &val).stripWhiteSpace();
+        name = KInputDialog::getText(i18n("Kst"), i18n("Enter a new name for the window:"), name, &ok, parent, 0L, &val).trimmed();
 #else
-        name = KLineEditDlg::getText(i18n("Enter a new name for the window:"), name, &ok, parent, &val).stripWhiteSpace();
+        name = KLineEditDlg::getText(i18n("Enter a new name for the window:"), name, &ok, parent, &val).trimmed();
 #endif
       } else {
 #if KDE_VERSION >= KDE_MAKE_VERSION(3,3,0)
-        name = KInputDialog::getText(i18n("Kst"), i18n("Enter a name for the new window:"), name, &ok, parent, 0L, &val).stripWhiteSpace();
+        name = KInputDialog::getText(i18n("Kst"), i18n("Enter a name for the new window:"), name, &ok, parent, 0L, &val).trimmed();
 #else
-        name = KLineEditDlg::getText(i18n("Enter a name for the new window:"), name, &ok, parent, &val).stripWhiteSpace();
+        name = KLineEditDlg::getText(i18n("Enter a name for the new window:"), name, &ok, parent, &val).trimmed();
 #endif
       }
       if (ok && name==defaultTag) {
--- branches/work/kst/portto4/kst/src/libkstapp/kst2dplot.cpp #638428:638429
@@ -2285,9 +2285,9 @@
 void Kst2DPlot::move(const QPoint& pos) {
   QPoint offset = pos - _geom.topLeft();
 
-  PlotRegion.moveBy(offset.x(), offset.y());
-  WinRegion.moveBy(offset.x(), offset.y());
-  PlotAndAxisRegion.moveBy(offset.x(), offset.y());
+  PlotRegion.translate(offset.x(), offset.y());
+  WinRegion.translate(offset.x(), offset.y());
+  PlotAndAxisRegion.translate(offset.x(), offset.y());
 
   KstPlotBase::move(pos);
 }
@@ -2300,9 +2300,9 @@
 
 
 void Kst2DPlot::parentMoved(const QPoint& offset) {
-  PlotRegion.moveBy(offset.x(), offset.y());
-  WinRegion.moveBy(offset.x(), offset.y());
-  PlotAndAxisRegion.moveBy(offset.x(), offset.y());
+  PlotRegion.translate(offset.x(), offset.y());
+  WinRegion.translate(offset.x(), offset.y());
+  PlotAndAxisRegion.translate(offset.x(), offset.y());
 
   KstPlotBase::parentMoved(offset);
 }
@@ -2331,9 +2331,9 @@
   QRect tr = GetTieBoxRegion();
   QColor fillColor;
   if (isTied()) {
-    fillColor.setRgb((foregroundColor().Qt::red() + backgroundColor().Qt::red()) / 2,
-                     (foregroundColor().Qt::green() + backgroundColor().Qt::green()) / 2,
-                     (foregroundColor().Qt::blue() + backgroundColor().Qt::blue()) / 2);
+    fillColor.setRgb((foregroundColor().red() + backgroundColor().red()) / 2,
+                     (foregroundColor().green() + backgroundColor().green()) / 2,
+                     (foregroundColor().blue() + backgroundColor().blue()) / 2);
   } else {
     fillColor = backgroundColor();
   }
@@ -2705,11 +2705,11 @@
 
 void Kst2DPlot::setPixRect(const QRect& RelPlotRegion, const QRect& RelWinRegion, const QRect& RelPlotAndAxisRegion) {
   PlotRegion = RelPlotRegion;
-  PlotRegion.moveBy(geometry().x(), geometry().y());
+  PlotRegion.translate(geometry().x(), geometry().y());
   WinRegion = RelWinRegion;
-  WinRegion.moveBy(geometry().x(), geometry().y());
+  WinRegion.translate(geometry().x(), geometry().y());
   PlotAndAxisRegion = RelPlotAndAxisRegion;
-  PlotAndAxisRegion.moveBy(geometry().x(), geometry().y());
+  PlotAndAxisRegion.translate(geometry().x(), geometry().y());
 }
 
 
@@ -6077,9 +6077,9 @@
     double x_orig_px, double xtick_px, double xtick_len_px, int x_px,
     double YTick, double ytop_bdr_px, double ybot_bdr_px,
     double y_orig_px, double ytick_px, double ytick_len_px, int y_px) {
-  QColor defaultGridColor( (_foregroundColor.Qt::red() + _backgroundColor.Qt::red()) / 2,
-      (_foregroundColor.Qt::green() + _backgroundColor.Qt::green()) / 2,
-      (_foregroundColor.Qt::blue() + _backgroundColor.Qt::blue()) / 2 );
+  QColor defaultGridColor( (_foregroundColor.red() + _backgroundColor.red()) / 2,
+      (_foregroundColor.green() + _backgroundColor.green()) / 2,
+      (_foregroundColor.blue() + _backgroundColor.blue()) / 2 );
   double X1, Y1;
   double X2, Y2;
   int i, j;
@@ -6572,13 +6572,13 @@
 
 void Kst2DPlot::setXTransformedExp(const QString& exp) {
   _xTransformedExp = exp;
-  _xTransformed = !exp.stripWhiteSpace().isEmpty();
+  _xTransformed = !exp.trimmed().isEmpty();
 }
 
 
 void Kst2DPlot::setYTransformedExp(const QString& exp) {
   _yTransformedExp = exp;
-  _yTransformed = !exp.stripWhiteSpace().isEmpty();
+  _yTransformed = !exp.trimmed().isEmpty();
 }
 
 
--- branches/work/kst/portto4/kst/src/libkstapp/kstdatacollection-gui.cpp #638428:638429
@@ -44,7 +44,7 @@
 
 bool KstGuiData::dataTagNameNotUnique(const QString &tag, bool warn, void *p) {
   /* verify that the tag name is not empty */
-  if (tag.stripWhiteSpace().isEmpty()) {
+  if (tag.trimmed().isEmpty()) {
       if (warn) {
         KMessageBox::sorry(static_cast<QWidget*>(p), i18n("Empty tag names are not allowed."));
       }
@@ -67,7 +67,7 @@
 
 bool KstGuiData::vectorTagNameNotUnique(const QString &tag, bool warn, void *p) {
   /* verify that the tag name is not empty */
-  if (tag.stripWhiteSpace().isEmpty()) {
+  if (tag.trimmed().isEmpty()) {
       if (warn) {
         KMessageBox::sorry(static_cast<QWidget*>(p), i18n("Empty tag names are not allowed."));
       }
@@ -90,7 +90,7 @@
 
 bool KstGuiData::matrixTagNameNotUnique(const QString &tag, bool warn, void *p) {
   /* verify that the tag name is not empty */
-  if (tag.stripWhiteSpace().isEmpty()) {
+  if (tag.trimmed().isEmpty()) {
     if (warn) {
       KMessageBox::sorry(static_cast<QWidget*>(p), i18n("Empty tag names are not allowed."));
     }


More information about the Kst mailing list