summaryrefslogtreecommitdiffstats
path: root/webscrap.cpp
diff options
context:
space:
mode:
authorRoopesh Chander <roop@forwardbias.in>2009-11-03 16:50:25 +0530
committerRoopesh Chander <roop@forwardbias.in>2009-11-03 16:50:25 +0530
commit6c2a3f9bfa4d48cde8dc9050d55af7454163db29 (patch)
tree0b63aa51086ca6b499fde0f70d124a5ffe890b44 /webscrap.cpp
parent8cbde3b472a43566f8ea0cb253753381a322edfb (diff)
make the effect object part of the scrap
Diffstat (limited to 'webscrap.cpp')
-rw-r--r--webscrap.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/webscrap.cpp b/webscrap.cpp
index f551e71..394b45d 100644
--- a/webscrap.cpp
+++ b/webscrap.cpp
@@ -180,6 +180,8 @@ WebScrapContainer::WebScrapContainer(WebScrap *scrap, QGraphicsScene *scene)
: QGraphicsWidget(0)
, m_scene(scene)
, m_scrap(scrap)
+ , m_located(false)
+ , m_searchMatched(false)
{
scene->addItem(this);
@@ -232,6 +234,11 @@ WebScrapContainer::WebScrapContainer(WebScrap *scrap, QGraphicsScene *scene)
QList<QGraphicsTransform *> txs;
txs << m_scrapScale;
m_scrap->setTransformations(txs);
+
+ setGraphicsEffect(new QGraphicsDropShadowEffect(this));
+ graphicsEffect()->setProperty("color", Qt::gray);
+ graphicsEffect()->setProperty("offset", QPointF(0, 0));
+ graphicsEffect()->setProperty("blurRadius", 10);
}
QRectF WebScrapContainer::boundingRect() const {
@@ -334,3 +341,22 @@ void WebScrapContainer::handleRectResized(QRectF rect) {
WebScrap* WebScrapContainer::webScrap() const {
return m_scrap;
}
+
+void WebScrapContainer::setLocated(bool located) {
+ m_located = located;
+ updateGlow();
+}
+
+void WebScrapContainer::setSearchMatched(bool matched) {
+ m_searchMatched = matched;
+ updateGlow();
+}
+
+void WebScrapContainer::updateGlow() {
+ if (m_located)
+ graphicsEffect()->setProperty("color", Qt::blue);
+ else if (m_searchMatched)
+ graphicsEffect()->setProperty("color", QColor("#ff6600"));
+ else
+ graphicsEffect()->setProperty("color", Qt::gray);
+}