/*!
* This file is part of CameraPlus.
*
- * Copyright (C) 2012 Mohammed Sameer <msameer@foolab.org>
+ * Copyright (C) 2012-2013 Mohammed Sameer <msameer@foolab.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
#include "focusrectangle.h"
#include <QPainter>
-#include <QDebug>
#define WIDTH 4
#define LENGTH 30
+#if defined(QT4)
FocusRectangle::FocusRectangle(QDeclarativeItem *parent) :
QDeclarativeItem(parent),
+#elif defined(QT5)
+FocusRectangle::FocusRectangle(QQuickItem *parent) :
+ QQuickPaintedItem(parent),
+#endif
m_color(Qt::white) {
+#if defined(QT4)
setFlag(QGraphicsItem::ItemHasNoContents, false);
+#endif
}
FocusRectangle::~FocusRectangle() {
}
}
+#if defined(QT4)
void FocusRectangle::paint(QPainter* painter, const QStyleOptionGraphicsItem* option,
QWidget* widget) {
QDeclarativeItem::paint(painter, option, widget);
+#elif defined(QT5)
+void FocusRectangle::paint(QPainter* painter) {
+#endif
painter->save();
}
void FocusRectangle::geometryChanged( const QRectF& newGeometry, const QRectF& oldGeometry) {
+#if defined(QT4)
QDeclarativeItem::geometryChanged(newGeometry, oldGeometry);
+#elif defined(QT5)
+ QQuickPaintedItem::geometryChanged(newGeometry, oldGeometry);
+#endif
qreal w = width();
qreal h = height();