// --------------------------------------------------------------------------- // PosSettingsPushButtonItem:::restore // --------------------------------------------------------------------------- // void PosSettingsPushButtonItem::restore() { HbDataFormViewItem::restore(); if (mWidget) { HbDataFormModelItem::DataItemType itemType = static_cast<HbDataFormModelItem::DataItemType>( modelIndex().data(HbDataFormModelItem::ItemTypeRole).toInt()); if(itemType == PushButtonItem) { QModelIndex itemIndex = modelIndex(); HbDataFormModel *model = static_cast<HbDataFormModel*>(itemView()->model());; HbDataFormModelItem *modelItem = static_cast<HbDataFormModelItem*>( model->itemFromIndex(itemIndex)); const QMetaObject *metaObj = mWidget->metaObject(); int count = metaObj->propertyCount(); for (int i = 0; i < count; i++) { QMetaProperty metaProperty = metaObj->property(i); if (metaProperty.isValid() && metaProperty.isWritable()) { metaProperty.write(mWidget,modelItem->contentWidgetData(metaProperty.name())); } } } } }
/*! Returns true if the all day has been edited, false otherwise. \return true if the all day has been edited, false otherwise. */ bool CalenEditorDataHandler::isAllDayEdited() const { OstTraceFunctionEntry0( CALENEDITORDATAHANDLER_ISALLDAYEDITED_ENTRY ); HbDataFormModelItem* alldayItem = mCalenEditor->allDayCheckBoxItem(); if (alldayItem) { if (CalenAgendaUtils::isAlldayEvent(*mOriginalEntry)) { if (alldayItem->contentWidgetData("checkState") == Qt::Checked) { OstTraceFunctionExit0( CALENEDITORDATAHANDLER_ISALLDAYEDITED_EXIT ); return false; } else { OstTraceFunctionExit0( DUP1_CALENEDITORDATAHANDLER_ISALLDAYEDITED_EXIT ); return true; } } else if (mOriginalEntry->type() == AgendaEntry::TypeAppoinment) { if (alldayItem->contentWidgetData("checkState") == Qt::Checked) { OstTraceFunctionExit0( DUP2_CALENEDITORDATAHANDLER_ISALLDAYEDITED_EXIT ); return true; } else { OstTraceFunctionExit0( DUP3_CALENEDITORDATAHANDLER_ISALLDAYEDITED_EXIT ); return false; } } } OstTraceFunctionExit0( DUP4_CALENEDITORDATAHANDLER_ISALLDAYEDITED_EXIT ); return false; }
void CpCertTrustView::saveTrustSettings() { RDEBUG("0", 0); CCTCertInfo& entry = *( mCertDataContainer.iCALabelEntries[ mCertificateIndex ]->iCAEntry ); if ( entry.IsDeletable() ) { TInt itemCount = mFormModel->rowCount(); RArray<TUid> newUids; QT_TRAP_THROWING ( CleanupClosePushL( newUids ); for(int index = 0;index<itemCount;++index) { HbDataFormModelItem *item = mFormModel->item(index); QString trustValue = item->contentWidgetData("text").toString(); if(trustValue == "On") { newUids.Append(trusterId(mTrustedClients[index])); } } if(newUids.Count() > 0 ) { mCertDataContainer.iWrapper->SetApplicabilityL( mCertDataContainer.CertManager(), entry, newUids ); } CleanupStack::PopAndDestroy(&newUids); ) }
void HgWidgetOptionsView::storeWidgetSize() { QSettings settings(SETT_ORGANIZATION, SETT_APPLICATION); HbDataFormModelItem *item = item = mModel->itemFromIndex(mModel->index(ItemWidgetHeight, 0)); if (item) { int value = item->contentWidgetData(QString("text")).toInt(); settings.setValue(SETT_WIDGET_HEIGHT, value); } item = mModel->itemFromIndex(mModel->index(ItemWidgetWidth, 0)); if (item) { int value = item->contentWidgetData(QString("text")).toInt(); settings.setValue(SETT_WIDGET_WIDTH, value); } mUpdateWidgetSize = false; }
void HgWidgetOptionsView::resizeEvent(QGraphicsSceneResizeEvent *event) { FUNC_LOG; if (mUpdateWidgetSize) { mContentReady = false; HbDataFormModelItem *item = mModel->itemFromIndex(mModel->index(ItemWidgetHeight, 0)); if (item) { item->setContentWidgetData(QString("text"), event->newSize().height()); } item = mModel->itemFromIndex(mModel->index(ItemWidgetWidth, 0)); if (item) { item->setContentWidgetData(QString("text"), event->newSize().width()); } mContentReady = true; } }
int HbDataGroupPrivate::activePage( ) { Q_Q( HbDataGroup ); // Here we need to find which page has the itemTransientState true, // which in turn will be the active page. If no page is set as true , then // make the 0th page as expanded ie itemTransientState as true // This function can be called from Group or GroupPage items QModelIndex groupIndex ; HbDataFormModelItem *modelItem = static_cast<HbDataFormModel*>((q->itemView())->model())->itemFromIndex( q->modelIndex( )); HbDataFormModelItem *groupModelItem = 0; // get the group modelItem pointer depending upon the type if( modelItem->type() == HbDataFormModelItem::GroupItem ) { groupModelItem = modelItem; } else if( modelItem->type() == HbDataFormModelItem::GroupPageItem ) { groupModelItem = modelItem->parent(); } int childCount = groupModelItem->childCount(); //int activePage = 0; // get container for setting item state HbAbstractItemContainer *container = qobject_cast<HbAbstractItemContainer *>( static_cast<QGraphicsWidget *>( mSharedData->mItemView->contentWidget( ) ) ); int currentPage = -1; bool somePageExpanded = false; for( int i = 0; i < childCount; i++) { // Make sure that the child is groupPage type. HbDataFormModelItem *child = groupModelItem->childAt(i); if( child->type() == HbDataFormModelItem::GroupPageItem ) { // Here we are not using i as the page index since there can other types of children in the same level // so need a seperate variable for this currentPage ++; // get the index of groupPage QModelIndex pageIndex = static_cast<HbDataFormModel*>(q->itemView()->model())->indexFromItem(child); if(container->itemTransientState(pageIndex).value("expanded").toBool()) { somePageExpanded = true; break; } } } if(!somePageExpanded && currentPage != -1) {// This means pages are present and no page is expanded so expand first page currentPage = 0; } return currentPage; }
/*! CpDivertPluginGroup::itemShown. */ void CpDivertPluginGroup::itemShown(const QModelIndex& item) { DPRINT << ": IN"; DPRINT << "item:" << item; HbDataFormModelItem* modelItem = qobject_cast<const HbDataFormModel*>(item.model())->itemFromIndex(item); if (!isDivertSettingsItem(modelItem)) { return; } bool isInitialStatusQueryDoneForItem = modelItem->contentWidgetData("text").isValid(); if (!isInitialStatusQueryDoneForItem) { CpDivertItemData *pitem = static_cast<CpDivertItemData*>(modelItem); if (qvariant_cast<PsCallDivertingCondition>(pitem->property("condition")) != DivertConditionAllConditionalCases) { addToDivertingRequestQueue(CheckDivertStatus, *pitem); } } DPRINT << ": OUT"; }
QModelIndex HbDataGroupPrivate::pageModelIndex(int index) const { const Q_Q(HbDataGroup); int pageIndex = -1; QModelIndex modelIndex; // Make sure that the child is groupPage type and current item is group. if( index >= 0) { HbDataFormModelItem *modelItem = static_cast<HbDataFormModel*>((q->itemView())->model())->itemFromIndex( q->modelIndex( )); HbDataFormModelItem *groupModelItem = 0; // get the group modelItem pointer depending upon the type if( modelItem->type() == HbDataFormModelItem::GroupItem ) { groupModelItem = modelItem; } else if( modelItem->type() == HbDataFormModelItem::GroupPageItem ) { groupModelItem = modelItem->parent(); } int childCount = groupModelItem->childCount(); for( int i = 0; i < childCount; i++) { HbDataFormModelItem *child = groupModelItem->childAt(i); if( child->type() == HbDataFormModelItem::GroupPageItem ) { pageIndex ++; // get the index of groupPage if(pageIndex == index) { modelIndex = static_cast<HbDataFormModel*>(q->itemView()->model())->indexFromItem(child); break; } } } } return modelIndex; }
/*! <b>Test Case Description:</b> \n To verify all the functions in CpItemdataHelper class. \n <b>Function 1:</b> \n 1. Fucntion Name: \n explicit CpItemDataHelper(HbDataForm *form = 0) \n 2. Case Descrition: \n Test the first constructor function. \n 3. Input Parameters: \n <1> form = 0 \n <2> form = new HbDataForm() \n 4. Expected result: \n <1> pHelper != 0 \n <2> pHelper != 0 \n <b>Function 2:</b> \n 1. Fucntion Name: \n void bindToForm(HbDataForm *form) \n 2. Input Parameters: \n <1> form = 0 \n <2> form = new HbDataForm() \n 3. Expected result: \n no crash \n <b>Function 3:</b> \n 1. Fucntion Name: \n void addItemPrototype(HbAbstractViewItem *prototype) \n 2. Input Parameters: \n <1> prototype = HbDataFormViewItem() \n <2> prototype = 0 \n 3. Expected result: \n no crash \n <b>Function 4:</b> \n 1. Fucntion Name: \n void addConnection(HbDataFormModelItem *item, const char *signal, QObject *receiver,const char *method) \n 2. Input Parameters: \n <1> item = new HbDataFormModelItem(), signal = char*, receiver = Qobject*, method = const char* \n <2> set all parameters as '0' \n 3. Expected result: \n no crash \n <b>Function 5:</b> \n 1. Fucntion Name: \n void removeConnection(HbDataFormModelItem *item, const char *signal, Qobject *receiver, const char *method) \n 2. Input Parameters: \n <1> item = new HbDataFormModelItem(), signal = char*, receiver = Qobject*, method = const char*\n <2> set all parameters as '0' 3. Expected result: \n no crash \n <b>Function 6:</b> \n 1. Fucntion Name: \n void connectToForm(const char *signal, QObject *receiver, const char *method) \n 2. Input Parameters: \n <1> signal = char*, receiver = Qobject*, method = const char* \n <2> set all parameters as '0' \n 3. Expected result: \n no crash \n <b>Function 7:</b> \n 1. Fucntion Name: \n HbWidget *widgetFromModelIndex(const QModelIndex &index) \n 2. Input Parameters: \n <1> index = const QModelIndex \n 3. Expected result: \n no crash \n <b>Function 8:</b> \n 1. Fucntion Name: \n HbDataFormModelItem *modelItemFromModelIndex(const QModelIndex &index) \n 2. Input Parameters: \n <1> index = const QModelIndex() \n <2> set all parameters as '0' \n 3. Expected result: \n no crash \n */ void TestCpAPI::testItemDataHelper() { HbDataForm* form = new HbDataForm(); // create a dataform HbDataFormModel *model = new HbDataFormModel(); HbDataFormModelItem *general = model->appendDataFormPage(QString("General")); // add a dataformpage CpSettingFormItemData *mItem = new CpSettingFormItemData(HbDataFormModelItem::SliderItem, QString("New Slider")); general->appendChild(mItem); // add a slider to the dataformgroup, use it as a parameter when testing addConnection() function form->setModel(model); // test constructor using default parameter CpItemDataHelper *phelperdefault = new CpItemDataHelper(0); QVERIFY (phelperdefault!=0); // test constructor using a HbDataForm parameter CpItemDataHelper *phelperForm = new CpItemDataHelper(form); QVERIFY (phelperForm!=0); // test bindtoForm() phelperForm->bindToForm(0); phelperForm->bindToForm(form); // test the addItemPrototype() function int oldProtoTypeListNr = form->itemPrototypes().count(); HbDataFormViewItem *pitem = new HbDataFormViewItem(); phelperForm->addItemPrototype(pitem); int newProtoTypeListNr = form->itemPrototypes().count(); //Verify that the prototype is added to the prototypelist QVERIFY( newProtoTypeListNr == oldProtoTypeListNr + 1 ); phelperForm->addItemPrototype(0); // pitem = 0 // test addConnection() function char aSignal[] = "asignal"; char aMethod[] = "amethod"; phelperForm->addConnection( general, aSignal,mItem,aMethod); phelperForm->removeConnection(general,aSignal,mItem, aMethod); phelperForm->addConnection( 0,0,0,0 ); phelperForm->removeConnection(0,0,0,0); phelperdefault->addConnection(general, aSignal,mItem,aMethod); // test connectToForm() function phelperForm->connectToForm(aSignal,mItem, aMethod); phelperForm->disconnectFromForm(aSignal,mItem, aMethod); phelperForm->connectToForm(0,0,0); phelperForm->disconnectFromForm(0,0,0); phelperdefault->connectToForm(aSignal,mItem, aMethod); // test widgetFromModelIndex() function QModelIndex aIndex = model->indexFromItem(mItem); HbWidget * widget = phelperForm->widgetFromModelIndex(aIndex); QVERIFY( widget->type() == Hb::ItemType_Slider ); // test modelItemFromModelIndex() function HbDataFormModelItem *itemTest = phelperForm->modelItemFromModelIndex(aIndex); HbDataFormModelItem *itemGeneral = model->itemFromIndex(aIndex); QVERIFY(itemTest == itemGeneral); delete phelperdefault; phelperdefault = 0; delete phelperForm; phelperForm = 0; delete form; form = 0; delete model; }
// This function gets called for group item or for grouppage item . It returs the corresponding page index . // The relevance of this function is when some items are inserted before group page inside a group. // returns -1 if not valid index. int HbDataGroupPrivate::pageIndex(const QModelIndex &index) const { const Q_Q(HbDataGroup); int pageIndex = -1; HbDataFormModelItem::DataItemType indexType = static_cast<HbDataFormModelItem::DataItemType>( index.data( HbDataFormModelItem::ItemTypeRole).toInt( ) ); // Make sure that the child is groupPage type and current item is group. if( (indexType == HbDataFormModelItem::GroupPageItem) || (indexType == HbDataFormModelItem::FormPageItem) ) { HbDataFormModelItem *modelItem = static_cast<HbDataFormModel*>((q->itemView())->model())->itemFromIndex( q->modelIndex( )); HbDataFormModelItem *groupModelItem = 0; // get the group modelItem pointer depending upon the type if( modelItem->type() == HbDataFormModelItem::GroupItem ) { groupModelItem = modelItem; } else if( modelItem->type() == HbDataFormModelItem::GroupPageItem ) { groupModelItem = modelItem->parent(); } else if (modelItem->type() == HbDataFormModelItem::FormPageItem ) { groupModelItem = static_cast<HbDataFormModel*>(q->itemView()->model())->invisibleRootItem(); } int childCount = groupModelItem->childCount(); for( int i = 0; i < childCount; i++) { HbDataFormModelItem *child = groupModelItem->childAt(i); if( (child->type() == HbDataFormModelItem::GroupPageItem ) || (child->type() == HbDataFormModelItem::FormPageItem)) { pageIndex ++; // get the index of groupPage QModelIndex childIndex = static_cast<HbDataFormModel*>(q->itemView()->model())->indexFromItem(child); if(childIndex == index) { break;// we got the page index } } } } return pageIndex; }
HgWidgetOptionsView::HgWidgetOptionsView(QGraphicsItem *parent) : HbView(parent), mForm(new HbDataForm(this)), mModel(new HbDataFormModel(this)), mContentReady(false), mUpdateWidgetSize(true) { HbAction *backAction = new HbAction(Hb::BackNaviAction); connect(backAction, SIGNAL(triggered()), SIGNAL(optionsClosed())); setNavigationAction(backAction); HbDataFormModelItem *item = mModel->appendDataFormItem( HbDataFormModelItem::ComboBoxItem, WIDGET_TYPE); item->setContentWidgetData(QString("items"), QStringList("Grid") << "Coverflow" << "T-Bone"); item = mModel->appendDataFormItem( HbDataFormModelItem::ComboBoxItem, SCROLLBAR_VISIBILITY); item->setContentWidgetData(QString("items"), QStringList("Autohide") << "Always on" << "Always off"); item = mModel->appendDataFormItem( HbDataFormModelItem::ToggleValueItem, INTERACTIVE_SCROLLBAR); item->setContentWidgetData(QString("text"), QString("no")); item->setContentWidgetData(QString("additionalText"), QString("yes")); item = mModel->appendDataFormItem( HbDataFormModelItem::ComboBoxItem, MODEL_IMAGE_TYPE); item->setContentWidgetData(QString("items"), QStringList("QImage") << "HbIcon" << "QIcon" << "QPixmap"); item = mModel->appendDataFormItem( HbDataFormModelItem::TextItem, WIDGET_HEIGHT); item->setContentWidgetData(QString("text"), QString("0")); item->setContentWidgetData(QString("inputMethodHints"), Qt::ImhDigitsOnly); item = mModel->appendDataFormItem( HbDataFormModelItem::TextItem, WIDGET_WIDTH); item->setContentWidgetData(QString("text"), QString("0")); item->setContentWidgetData(QString("inputMethodHints"), Qt::ImhDigitsOnly); item = mModel->appendDataFormItem( HbDataFormModelItem::ToggleValueItem, LOW_RES_IMAGES); item->setContentWidgetData(QString("text"), QString("no")); item->setContentWidgetData(QString("additionalText"), QString("yes")); item = mModel->appendDataFormItem( HbDataFormModelItem::ComboBoxItem, TITLE_FONT); item->setContentWidgetData(QString("items"), QStringList("Primary") << "Secondary" << "Title" << "Primary small" << "Digital"); item = mModel->appendDataFormItem( HbDataFormModelItem::ComboBoxItem, DESCRIPTION_FONT); item->setContentWidgetData(QString("items"), QStringList("Primary") << "Secondary" << "Title" << "Primary small" << "Digital"); item = mModel->appendDataFormItem( HbDataFormModelItem::ToggleValueItem, REFLECTIONS_ENABLED); item->setContentWidgetData(QString("text"), QString("no")); item->setContentWidgetData(QString("additionalText"), QString("yes")); item = mModel->appendDataFormItem( HbDataFormModelItem::ToggleValueItem, EFFECT3D_ENABLED); item->setContentWidgetData(QString("text"), QString("no")); item->setContentWidgetData(QString("additionalText"), QString("yes")); item = mModel->appendDataFormItem( HbDataFormModelItem::ToggleValueItem, ITEM_SIZE_POLICY); item->setContentWidgetData(QString("text"), QString("User defined")); item->setContentWidgetData(QString("additionalText"), QString("Automatic")); connect(mModel, SIGNAL(dataChanged(QModelIndex, QModelIndex)), SLOT(updateData(QModelIndex, QModelIndex))); mForm->setModel(mModel); setupData(); mContentReady = true; QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(Qt::Vertical); layout->addItem(mForm); setLayout(layout); }
void HgWidgetOptionsView::setupData() { FUNC_LOG; QSettings settings(SETT_ORGANIZATION, SETT_APPLICATION); HbDataFormModelItem *item = mModel->itemFromIndex(mModel->index(ItemWidgetType, 0)); QVariant value = settings.value(SETT_WIDGET_TYPE); if (item && value.isValid()) { int index(0); switch (value.toInt()) { case HgWidgetGrid: index = 0; break; case HgWidgetCoverflow: index = 1; break; case HgWidgetTBone: index = 2; break; default: break; } item->setContentWidgetData(QString("currentIndex"), index); setCoverflowEnabled(index == 1 || index == 2); } item = mModel->itemFromIndex(mModel->index(ItemScrollBarVisibility, 0)); value = settings.value(SETT_SCROLLBAR_VISIBILITY); if (item && value.isValid()) { int index(0); switch (value.toInt()) { case HgWidget::ScrollBarAutoHide: index = 0; break; case HgWidget::ScrollBarAlwaysOn: index = 1; break; case HgWidget::ScrollBarAlwaysOff: index = 2; break; default: break; } item->setContentWidgetData(QString("currentIndex"), index); } item = mModel->itemFromIndex(mModel->index(ItemScrollBarInteractivity, 0)); value = settings.value(SETT_SCROLLBAR_INTERACTIVITY); if (item && value.isValid()) { item->setContentWidgetData(QString("text"), value.toBool() ? "yes" : "no"); item->setContentWidgetData(QString("additionalText"), value.toBool() ? "no" : "yes"); } item = mModel->itemFromIndex(mModel->index(ItemModelImageType, 0)); value = settings.value(SETT_MODEL_IMAGE_TYPE); if (item && value.isValid()) { int index(0); switch (value.toInt()) { case ImageTypeQImage: index = 0; break; case ImageTypeHbIcon: index = 1; break; case ImageTypeQIcon: index = 2; break; case ImageTypeQPixmap: index = 3; break; default: break; } item->setContentWidgetData(QString("currentIndex"), index); } item = mModel->itemFromIndex(mModel->index(ItemWidgetHeight, 0)); value = settings.value(SETT_WIDGET_HEIGHT); if (item && value.isValid()) { item->setContentWidgetData(QString("text"), value.toInt()); mUpdateWidgetSize = false; } item = mModel->itemFromIndex(mModel->index(ItemWidgetWidth, 0)); value = settings.value(SETT_WIDGET_WIDTH); if (item && value.isValid()) { item->setContentWidgetData(QString("text"), value.toInt()); mUpdateWidgetSize = false; } item = mModel->itemFromIndex(mModel->index(ItemLowResImages, 0)); value = settings.value(SETT_LOW_RES_IMAGES); if (item && value.isValid()) { item->setContentWidgetData(QString("text"), value.toBool() ? "yes" : "no"); item->setContentWidgetData(QString("additionalText"), value.toBool() ? "no" : "yes"); } item = mModel->itemFromIndex(mModel->index(ItemTitleFont, 0)); value = settings.value(SETT_TITLE_FONT); if (item && value.isValid()) { int index(0); switch (value.toInt()) { case HbFontSpec::Primary: index = 0; break; case HbFontSpec::Secondary: index = 1; break; case HbFontSpec::Title: index = 2; break; case HbFontSpec::PrimarySmall: index = 3; break; case HbFontSpec::Digital: index = 4; break; default: break; } item->setContentWidgetData(QString("currentIndex"), index); } item = mModel->itemFromIndex(mModel->index(ItemDescriptionFont, 0)); value = settings.value(SETT_DESCRIPTION_FONT); if (item && value.isValid()) { int index(0); switch (value.toInt()) { case HbFontSpec::Primary: index = 0; break; case HbFontSpec::Secondary: index = 1; break; case HbFontSpec::Title: index = 2; break; case HbFontSpec::PrimarySmall: index = 3; break; case HbFontSpec::Digital: index = 4; break; default: break; } item->setContentWidgetData(QString("currentIndex"), index); } item = mModel->itemFromIndex(mModel->index(ItemReflectionEnabled, 0)); value = settings.value(SETT_REFLECTIONS_ENABLED); if (item && value.isValid()) { item->setContentWidgetData(QString("text"), value.toBool() ? "yes" : "no"); item->setContentWidgetData(QString("additionalText"), value.toBool() ? "no" : "yes"); } item = mModel->itemFromIndex(mModel->index(ItemEffect3dEnabled, 0)); value = settings.value(SETT_EFFECT3D_ENABLED); if (item && value.isValid()) { item->setContentWidgetData(QString("text"), value.toBool() ? "yes" : "no"); item->setContentWidgetData(QString("additionalText"), value.toBool() ? "no" : "yes"); } item = mModel->itemFromIndex(mModel->index(ItemItemSizePolicy, 0)); value = settings.value(SETT_ITEM_SIZE_POLICY); if (item && value.isValid()) { if (value.toInt() == HgWidget::ItemSizeAutomatic) { item->setContentWidgetData(QString("text"), "Automatic"); item->setContentWidgetData(QString("additionalText"), "User defined"); } else { item->setContentWidgetData(QString("text"), "User defined"); item->setContentWidgetData(QString("additionalText"), "Automatic"); } } }
void HgWidgetOptionsView::updateData(QModelIndex startIn, QModelIndex endIn) { Q_UNUSED(endIn); if (!mContentReady) return; QSettings settings(SETT_ORGANIZATION, SETT_APPLICATION); HbDataFormModelItem *item = mModel->itemFromIndex(startIn); if( !item ) return; if (item->data(HbDataFormModelItem::LabelRole).toString() == WIDGET_TYPE) { int index = item->contentWidgetData(QString("currentIndex")).toInt(); HgTestWidgetType type = HgWidgetNone; switch (index) { case 0: type = HgWidgetGrid; break; case 1: type = HgWidgetCoverflow; break; case 2: type = HgWidgetTBone; break; default: break; } setCoverflowEnabled(index == 1 || index == 2); settings.setValue(SETT_WIDGET_TYPE, type); emit widgetTypeChanged(type); } else if (item->data(HbDataFormModelItem::LabelRole).toString() == SCROLLBAR_VISIBILITY) { int index = item->contentWidgetData(QString("currentIndex")).toInt(); HgWidget::ScrollBarPolicy visibility = HgWidget::ScrollBarAutoHide; switch (index) { case 0: visibility = HgWidget::ScrollBarAutoHide; break; case 1: visibility = HgWidget::ScrollBarAlwaysOn; break; case 2: visibility = HgWidget::ScrollBarAlwaysOff; break; default: break; } settings.setValue(SETT_SCROLLBAR_VISIBILITY, visibility); emit scrollBarVisibilityChanged(visibility); } else if (item->data(HbDataFormModelItem::LabelRole).toString() == INTERACTIVE_SCROLLBAR) { QVariant data = item->contentWidgetData(QString("text")); bool value = data.toString() == "yes"; settings.setValue(SETT_SCROLLBAR_INTERACTIVITY, value); if (value) { item = mModel->itemFromIndex(mModel->index(ItemScrollBarVisibility, 0)); if (item) { item->setContentWidgetData(QString("currentIndex"), 1); // Set scroll bar always on } } emit scrollBarInteractivityChanged(value); } else if (item->data(HbDataFormModelItem::LabelRole).toString() == MODEL_IMAGE_TYPE) { int index = item->contentWidgetData(QString("currentIndex")).toInt(); HgTestImageType type = ImageTypeNone; switch (index) { case 0: type = ImageTypeQImage; break; case 1: type = ImageTypeHbIcon; break; case 2: type = ImageTypeQIcon; break; case 3: type = ImageTypeQPixmap; break; default: break; } settings.setValue(SETT_MODEL_IMAGE_TYPE, type); emit imageTypeChanged(type); } else if (item->data(HbDataFormModelItem::LabelRole).toString() == WIDGET_HEIGHT) { emit widgetHeightChanged(item->contentWidgetData(QString("text")).toInt()); storeWidgetSize(); } else if (item->data(HbDataFormModelItem::LabelRole).toString() == WIDGET_WIDTH) { emit widgetWidthChanged(item->contentWidgetData(QString("text")).toInt()); storeWidgetSize(); } else if (item->data(HbDataFormModelItem::LabelRole).toString() == LOW_RES_IMAGES) { QVariant data = item->contentWidgetData(QString("text")); bool value = data.toString() == "yes"; settings.setValue(SETT_LOW_RES_IMAGES, value); emit lowResImageUseChanged(value); } else if (item->data(HbDataFormModelItem::LabelRole).toString() == TITLE_FONT) { int index = item->contentWidgetData(QString("currentIndex")).toInt(); HbFontSpec::Role role = HbFontSpec::Undefined; switch (index) { case 0: role = HbFontSpec::Primary; break; case 1: role = HbFontSpec::Secondary; break; case 2: role = HbFontSpec::Title; break; case 3: role = HbFontSpec::PrimarySmall; break; case 4: role = HbFontSpec::Digital; break; default: break; } settings.setValue(SETT_TITLE_FONT, role); emit titleFontChanged(HbFontSpec(role)); } else if (item->data(HbDataFormModelItem::LabelRole).toString() == DESCRIPTION_FONT) { int index = item->contentWidgetData(QString("currentIndex")).toInt(); HbFontSpec::Role role = HbFontSpec::Undefined; switch (index) { case 0: role = HbFontSpec::Primary; break; case 1: role = HbFontSpec::Secondary; break; case 2: role = HbFontSpec::Title; break; case 3: role = HbFontSpec::PrimarySmall; break; case 4: role = HbFontSpec::Digital; break; default: break; } settings.setValue(SETT_DESCRIPTION_FONT, role); emit descriptionFontChanged(HbFontSpec(role)); } else if (item->data(HbDataFormModelItem::LabelRole).toString() == REFLECTIONS_ENABLED) { QVariant data = item->contentWidgetData(QString("text")); bool value = data.toString() == "yes"; settings.setValue(SETT_REFLECTIONS_ENABLED, value); emit reflectionsEnabledChanged(value); } else if (item->data(HbDataFormModelItem::LabelRole).toString() == EFFECT3D_ENABLED) { QVariant data = item->contentWidgetData(QString("text")); bool value = data.toString() == "yes"; settings.setValue(SETT_EFFECT3D_ENABLED, value); emit effect3dEnabledChanged(value); } else if (item->data(HbDataFormModelItem::LabelRole).toString() == ITEM_SIZE_POLICY) { QVariant data = item->contentWidgetData(QString("text")); HgWidget::ItemSizePolicy value = (data.toString() == "Automatic" ? HgWidget::ItemSizeAutomatic : HgWidget::ItemSizeUserDefined); settings.setValue(SETT_ITEM_SIZE_POLICY, value); emit itemSizePolicyChanged(value); } }