USA.
*/
-#include <QPainter>
#include <QDebug>
+#include <QPainter>
-#include "listitemdelegate.h"
-#include "listitem.h"
#include "../common.h"
-#include "listcommon.h"
#include "avatarimage.h"
+#include "listcommon.h"
+#include "listitem.h"
+
+#include "listitemdelegate.h"
-const int BACKGROUND_BOTTOM_HEIGHT = 15;
-const int BACKGROUND_TOP_HEIGHT = 20;
-const int NAME_TOP_MARGIN = 40;
+const int BACKGROUND_BOTTOM_HEIGHT = 15; ///< Background image bottom height
+const int BACKGROUND_TOP_HEIGHT = 20; ///< Background image top height
+const int NAME_TOP_MARGIN = 40; ///< Name text top margin
ListItemDelegate::ListItemDelegate(QWidget *parent) :
QStyledItemDelegate(parent)
//Image is set, draw image and text
if (!image.isNull()) {
- painter->drawPixmap(itemRect.left() + MARGIN*2, itemRect.top(), image);
- painter->drawText(itemRect.topLeft() + QPoint(MARGIN*2 + IMAGE_WIDTH + MARGIN,
+ painter->drawPixmap(itemRect.left() + MARGIN * 2, itemRect.top(), image);
+ painter->drawText(itemRect.topLeft() + QPoint(MARGIN * 2 + IMAGE_WIDTH + MARGIN,
NAME_TOP_MARGIN), name);
}
//Draw only text
else {
- painter->drawText(itemRect.topLeft() + QPoint(MARGIN*3, NAME_TOP_MARGIN), name);
+ painter->drawText(itemRect.topLeft() + QPoint(MARGIN * 3, NAME_TOP_MARGIN), name);
}
}