ipsservices/nmipssettings/src/nmipssettingslabeledcombobox.cpp
changeset 23 2dc6caa42ec3
parent 20 ecc8def7944a
child 27 9ba4404ef423
equal deleted inserted replaced
20:ecc8def7944a 23:2dc6caa42ec3
    24 /*!
    24 /*!
    25     \class NmIpsSettingsLabelItem
    25     \class NmIpsSettingsLabelItem
    26     \brief The class implements a custom HbDataFormViewItem that combines a HbComboBox and HbLabel
    26     \brief The class implements a custom HbDataFormViewItem that combines a HbComboBox and HbLabel
    27     widgets that are linked. I.e. When the user selects changes the combobox's value, the label
    27     widgets that are linked. I.e. When the user selects changes the combobox's value, the label
    28     text is updated accordingly.
    28     text is updated accordingly.
    29 
       
    30 */
    29 */
    31 
    30 
    32 // ======== MEMBER FUNCTIONS ========
    31 // ======== MEMBER FUNCTIONS ========
    33 
    32 
    34 /*!
    33 /*!
    35     Constructor of NmIpsSettingsLabeledComboBox.
    34     Constructor of NmIpsSettingsLabeledComboBox.
    36 */
    35 */
    37 NmIpsSettingsLabeledComboBox::NmIpsSettingsLabeledComboBox(QGraphicsItem *parent, Qt::WindowFlags wFlags)
    36 NmIpsSettingsLabeledComboBox::NmIpsSettingsLabeledComboBox(
       
    37     QGraphicsItem *parent, Qt::WindowFlags wFlags)
    38 : HbWidget(parent, wFlags)
    38 : HbWidget(parent, wFlags)
    39 {
    39 {
    40     // Create widget layout.
    40     // Create widget layout.
    41     QGraphicsLinearLayout* layout = new QGraphicsLinearLayout(Qt::Vertical);
    41     QGraphicsLinearLayout* layout = new QGraphicsLinearLayout(Qt::Vertical);
    42     this->setLayout(layout); // Takes ownership
    42     this->setLayout(layout); // Takes ownership
    52     HbFontSpec spec(HbFontSpec::PrimarySmall);
    52     HbFontSpec spec(HbFontSpec::PrimarySmall);
    53     mLabel->setFontSpec(spec);
    53     mLabel->setFontSpec(spec);
    54     layout->addItem(mLabel); // Takes ownership
    54     layout->addItem(mLabel); // Takes ownership
    55 
    55 
    56     // Connect signals and slots.
    56     // Connect signals and slots.
    57     connect(mComboBox, SIGNAL(currentIndexChanged(int)), 
    57     connect(mComboBox, SIGNAL(currentIndexChanged(int)),
    58         this, SLOT(comboBoxIndexChanged(int)), Qt::UniqueConnection);
    58         this, SLOT(comboBoxIndexChanged(int)), Qt::UniqueConnection);
       
    59 
    59     connect(mComboBox, SIGNAL(currentIndexChanged(int)),
    60     connect(mComboBox, SIGNAL(currentIndexChanged(int)),
    60         this, SIGNAL(currentIndexChanged(int)), Qt::UniqueConnection);
    61         this, SIGNAL(currentIndexChanged(int)), Qt::UniqueConnection);
    61 }
    62 }
    62 
    63 
    63 /*!
    64 /*!
   100 */
   101 */
   101 void NmIpsSettingsLabeledComboBox::setComboItems(QStringList comboItems)
   102 void NmIpsSettingsLabeledComboBox::setComboItems(QStringList comboItems)
   102 {
   103 {
   103     mComboBox->setItems(comboItems);
   104     mComboBox->setItems(comboItems);
   104 }
   105 }
       
   106 
   105 /*!
   107 /*!
   106     Returns the current label texts.
   108     Returns the current label texts.
   107     \return Label texts.
   109     \return Label texts.
   108 */
   110 */
   109 QStringList NmIpsSettingsLabeledComboBox::labelTexts() const
   111 QStringList NmIpsSettingsLabeledComboBox::labelTexts() const