summaryrefslogtreecommitdiff
path: root/src/frontend/searchdialog/analysis/csearchanalysislegenditem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/frontend/searchdialog/analysis/csearchanalysislegenditem.cpp')
-rw-r--r--src/frontend/searchdialog/analysis/csearchanalysislegenditem.cpp13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/frontend/searchdialog/analysis/csearchanalysislegenditem.cpp b/src/frontend/searchdialog/analysis/csearchanalysislegenditem.cpp
index 38b6552..c5b9d02 100644
--- a/src/frontend/searchdialog/analysis/csearchanalysislegenditem.cpp
+++ b/src/frontend/searchdialog/analysis/csearchanalysislegenditem.cpp
@@ -2,7 +2,7 @@
*
* This file is part of BibleTime's source code, http://www.bibletime.info/.
*
-* Copyright 1999-2008 by the BibleTime developers.
+* Copyright 1999-2011 by the BibleTime developers.
* The BibleTime source code is licensed under the GNU General Public License version 2.0.
*
**********/
@@ -39,12 +39,6 @@ const int LEGEND_DELTAY = 4;
const int LEGEND_WIDTH = 85;
-CSearchAnalysisLegendItem::CSearchAnalysisLegendItem(QList<CSwordModuleInfo*> *list )
- : QGraphicsRectItem() {
- m_moduleList = list;
-}
-
-/** Reimplementation. Draws the content of this item. */
void CSearchAnalysisLegendItem::paint(QPainter* painter, const QStyleOptionGraphicsItem*, QWidget*) {
painter->save();
@@ -61,8 +55,7 @@ void CSearchAnalysisLegendItem::paint(QPainter* painter, const QStyleOptionGraph
// for (unsigned int index=0; index < m_moduleList->count(); index++){
int moduleIndex = 0;
- QList<CSwordModuleInfo*>::iterator end_it = m_moduleList->end();
- for (QList<CSwordModuleInfo*>::iterator it(m_moduleList->begin()); it != end_it; ++it) {
+ Q_FOREACH(const CSwordModuleInfo *m, m_moduleList) {
// the module color indicators
QPoint p1( (int)(rect().x()) + LEGEND_INNER_BORDER, (int)(rect().y()) + LEGEND_INNER_BORDER + moduleIndex*(LEGEND_DELTAY + ITEM_TEXT_SIZE) );
QPoint p2(p1.x() + ITEM_TEXT_SIZE, p1.y() + ITEM_TEXT_SIZE);
@@ -72,7 +65,7 @@ void CSearchAnalysisLegendItem::paint(QPainter* painter, const QStyleOptionGraph
painter->drawRect(r);
QPoint p3( p2.x() + LEGEND_INNER_BORDER, p2.y() );
- painter->drawText(p3, (*it)->name() );
+ painter->drawText(p3, m->name() );
++moduleIndex;
}