controlpanel/tsrc/unit/pluginfortest/secondpluginfortest/src/secondpluginviewfortest.cpp
branchRCL_3
changeset 24 8ee96d21d9bf
equal deleted inserted replaced
23:8bda91a87a00 24:8ee96d21d9bf
       
     1 #include "secondpluginviewfortest.h"
       
     2 
       
     3 #include <hbdataform.h>
       
     4 #include <qstringlist>
       
     5 #include <QDebug>
       
     6 #include <hbdataformmodel.h>
       
     7 #include <cpsettingformitemdata.h>
       
     8 #include <hbmessagebox.h>
       
     9 
       
    10 SecondPluginViewForTest::SecondPluginViewForTest(QGraphicsItem *parent) 
       
    11     : CpBaseSettingView(0,parent),
       
    12     mGroupItem(0),
       
    13     mSliderItem(0)
       
    14 {
       
    15     HbDataForm *form = qobject_cast<HbDataForm*>(widget());
       
    16     if (form) {
       
    17         HbDataFormModel *model = new HbDataFormModel;
       
    18         
       
    19         form->setHeading(tr("View from test plugin"));
       
    20         mGroupItem = new HbDataFormModelItem(HbDataFormModelItem::GroupItem, QString("Group"));
       
    21         
       
    22         model->appendDataFormItem(mGroupItem);
       
    23         
       
    24         mSliderItem = new CpSettingFormItemData(HbDataFormModelItem::SliderItem,
       
    25                 QString("New Slider"));
       
    26         mSliderItem->setContentWidgetData("iconEnabled","FALSE");
       
    27         form->addConnection(mSliderItem,SIGNAL(valueChanged(int)),this,SLOT(sliderValueChanged(int)));
       
    28         mGroupItem->appendChild(mSliderItem);      
       
    29         
       
    30         form->setModel(model);
       
    31     }
       
    32 }
       
    33 SecondPluginViewForTest::~SecondPluginViewForTest()
       
    34 {
       
    35 }
       
    36 
       
    37 void SecondPluginViewForTest::testClose()
       
    38 {
       
    39     close();
       
    40 }
       
    41 void SecondPluginViewForTest::sliderValueChanged(int value)
       
    42 {
       
    43     //Disable the slider alert.
       
    44 	HbMessageBox::information(QString("slider value changed to:%1").arg(value));
       
    45 }