--- a/src/hbwidgets/itemviews/hbgridviewitem_p.cpp Fri Sep 17 08:32:10 2010 +0300
+++ b/src/hbwidgets/itemviews/hbgridviewitem_p.cpp Mon Oct 04 00:38:12 2010 +0300
@@ -25,6 +25,8 @@
#include <hbgridviewitem.h>
#include <hbgridviewitem_p.h>
+#include <hbiconitem.h>
+#include <hbtextitem.h>
#include <hbeffect.h>
@@ -106,7 +108,12 @@
if ( mTextValid
&& !mTextItem) {
mItemsChanged = true;
- mTextItem = HbStylePrivate::createPrimitive(HbStylePrivate::P_GridViewItem_text, q);
+ mTextItem = q->style()->createPrimitive(HbStyle::PT_TextItem, QLatin1String("text"), q);
+ HbTextItem *textItem = qobject_cast<HbTextItem*>(mTextItem);
+ if (textItem) {
+ textItem->setAlignment(Qt::AlignCenter);
+ textItem->setTextWrapping(Hb::TextNoWrap);
+ }
}
else if ( !mTextValid
&& mTextItem) {
@@ -140,7 +147,12 @@
if ( mIconValid
&& !mIconItem) {
mItemsChanged = true;
- mIconItem = HbStylePrivate::createPrimitive(HbStylePrivate::P_GridViewItem_icon, q);
+ mIconItem = q->style()->createPrimitive(HbStyle::PT_IconItem, QLatin1String("icon"), 0);
+ mIconItem->setParentItem(q); // To enable asynchronous icon loading.
+ HbIconItem *iconItem = qobject_cast<HbIconItem*>(mIconItem);
+ if (iconItem) {
+ iconItem->setAlignment(Qt::AlignCenter);
+ }
}
else if ( !mIconValid
&& mIconItem) {