summaryrefslogtreecommitdiffhomepage
path: root/qfunctionconfigurator
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2013-10-17 20:34:39 +0200
committerStanislaw Halik <sthalik@misaki.pl>2013-10-17 20:34:39 +0200
commitd37cbece940357105480c0991a70ee8394939301 (patch)
treeefef4689e90212fc2ac03a11532c2f2964f7f939 /qfunctionconfigurator
parent8f23371ba8e894f5301cdccdce5e49e86a0222f8 (diff)
get rid of QFC artifacts
Signed-off-by: Stanislaw Halik <sthalik@misaki.pl>
Diffstat (limited to 'qfunctionconfigurator')
-rw-r--r--qfunctionconfigurator/broken/qfunctionconfiguratorplugin.cpp7
-rw-r--r--qfunctionconfigurator/qfunctionconfigurator.cpp24
-rw-r--r--qfunctionconfigurator/qfunctionconfigurator.h2
3 files changed, 13 insertions, 20 deletions
diff --git a/qfunctionconfigurator/broken/qfunctionconfiguratorplugin.cpp b/qfunctionconfigurator/broken/qfunctionconfiguratorplugin.cpp
index 9bed2c9e..1a9da10a 100644
--- a/qfunctionconfigurator/broken/qfunctionconfiguratorplugin.cpp
+++ b/qfunctionconfigurator/broken/qfunctionconfiguratorplugin.cpp
@@ -82,13 +82,6 @@ QString QFunctionConfiguratorPlugin::domXml() const
" <blue>0</blue>\n"
" </color>\n"
" </property>\n"
- " <property name=\"colorBackground\">\n"
- " <color>\n"
- " <red>192</red>\n"
- " <green>192</green>\n"
- " <blue>192</blue>\n"
- " </color>\n"
- " </property>\n"
" <property name=\"stringInputEGU\" stdset=\"0\">\n"
" <string>Input Yaw (degr.)</string>\n"
" </property>\n"
diff --git a/qfunctionconfigurator/qfunctionconfigurator.cpp b/qfunctionconfigurator/qfunctionconfigurator.cpp
index 6bacf294..0b4df033 100644
--- a/qfunctionconfigurator/qfunctionconfigurator.cpp
+++ b/qfunctionconfigurator/qfunctionconfigurator.cpp
@@ -43,7 +43,6 @@ QFunctionConfigurator::QFunctionConfigurator(QWidget *parent)
// This will require the Curve-Dialog to be higher (which was the reason it was reversed in the first place..)
range = QRectF(40, 20, MaxInput * pPerEGU_Input, MaxOutput * pPerEGU_Output);
- setMouseTracking(true);
movingPoint = -1; // Index of that same point
//
@@ -107,13 +106,13 @@ void QFunctionConfigurator::saveSettings(QString settingsFile) {
// Draw the Background for the graph, the gridlines and the gridpoints.
// The static objects are drawn on a Pixmap, so it does not have to be repeated every paintEvent. Hope this speeds things up...
//
-void QFunctionConfigurator::drawBackground(const QRectF &fullRect)
+void QFunctionConfigurator::drawBackground()
{
int i;
QRect scale;
- _background = QPixmap(fullRect.width(), fullRect.height());
+ _background = QPixmap(width(), height());
QPainter painter(&_background);
- painter.fillRect(fullRect, QColor::fromRgb(204, 204, 204));
+ painter.fillRect(rect(), QColor::fromRgb(204, 204, 204));
painter.setRenderHint(QPainter::Antialiasing);
QColor bg_color(112, 154, 209);
painter.fillRect(range, bg_color);
@@ -236,11 +235,10 @@ int i;
QPainter p(this);
p.setRenderHint(QPainter::Antialiasing);
- p.setClipRect(e->rect());
if (_draw_background) {
- drawBackground(e->rect()); // Draw the static parts on a Pixmap
- p.drawPixmap(0, 0, _background); // Paint the background
+ drawBackground(); // Draw the static parts on a Pixmap
+ p.drawPixmap(e->rect(), _background); // Paint the background
_draw_background = false;
}
@@ -248,14 +246,13 @@ int i;
drawFunction(); // Draw the Function on a Pixmap
_draw_function = false;
}
- p.drawPixmap(0, 0, _function); // Always draw the background and the function
-
- QPen pen(Qt::white, 1, Qt::SolidLine);
+ p.drawPixmap(e->rect(), _function); // Always draw the background and the function
//
// Draw the Points, that make up the Curve
//
if (_config) {
+ QPen pen(Qt::white, 1, Qt::SolidLine);
QList<QPointF> points = _config->getPoints();
//
// When moving, also draw a sketched version of the Function.
@@ -304,12 +301,13 @@ int i;
//
// Draw the delimiters
//
+#if 0
pen.setWidth(1);
pen.setColor( Qt::white );
pen.setStyle( Qt::SolidLine );
drawLine(&p, QPoint(lastPoint.x(), range.top()), QPoint(lastPoint.x(), range.bottom()), pen);
drawLine(&p, QPoint(range.left(), lastPoint.y()), QPoint(range.right(), lastPoint.y()), pen);
-
+#endif
//QTimer::singleShot(50, this, SLOT(update()));
}
@@ -360,6 +358,7 @@ void QFunctionConfigurator::mousePressEvent(QMouseEvent *e)
bTouchingPoint = true;
movingPoint = i;
timer.restart();
+ setMouseTracking(true);
break;
}
}
@@ -400,9 +399,9 @@ void QFunctionConfigurator::mousePressEvent(QMouseEvent *e)
emit CurveChanged( true );
}
movingPoint = -1;
+ setMouseTracking(false);
}
}
-
_draw_function = _draw_background = true;
update();
}
@@ -459,6 +458,7 @@ void QFunctionConfigurator::mouseReleaseEvent(QMouseEvent *e)
QList<QPointF> points = _config->getPoints();
if (e->button() == Qt::LeftButton) {
+ setMouseTracking(false);
timer.invalidate();
//qDebug()<<"releasing";
if (movingPoint >= 0 && movingPoint < points.size()) {
diff --git a/qfunctionconfigurator/qfunctionconfigurator.h b/qfunctionconfigurator/qfunctionconfigurator.h
index 1ac919fe..35f06a0d 100644
--- a/qfunctionconfigurator/qfunctionconfigurator.h
+++ b/qfunctionconfigurator/qfunctionconfigurator.h
@@ -112,7 +112,7 @@ protected slots:
void mouseReleaseEvent(QMouseEvent *e);
protected:
- void drawBackground(const QRectF &);
+ void drawBackground();
void drawFunction();
void drawPoint(QPainter *painter, const QPointF &pt, QColor colBG );
void drawLine(QPainter *painter, const QPointF &start, const QPointF &end, QPen pen);