src/hbwidgets/widgets/hbcombobox.cpp
changeset 2 06ff229162e9
parent 1 f7ac710697a9
child 3 11d3954df52a
equal deleted inserted replaced
1:f7ac710697a9 2:06ff229162e9
    27 
    27 
    28 #include <hbcombobox.h>
    28 #include <hbcombobox.h>
    29 #include <hblistview.h>
    29 #include <hblistview.h>
    30 #include <hbtoucharea.h>
    30 #include <hbtoucharea.h>
    31 #include <hbtextitem.h>
    31 #include <hbtextitem.h>
    32 #include <hbstyleoptioncombobox.h>
    32 #include <hbstyleoptioncombobox_p.h>
    33 #include <QStandardItemModel>
    33 #include <QStandardItemModel>
    34 #include <QDebug>
    34 #include <QDebug>
    35 
    35 
    36 #include <hbtapgesture.h>
    36 #include <hbtapgesture.h>
    37 
    37 
   278 {
   278 {
   279     Q_D( const HbComboBox );
   279     Q_D( const HbComboBox );
   280     if( d->mEditable) {
   280     if( d->mEditable) {
   281         return d->mLineEdit->validator( );
   281         return d->mLineEdit->validator( );
   282     }
   282     }
   283     return NULL;
   283     return 0;
   284 }
   284 }
   285 
   285 
   286 /*!
   286 /*!
   287     @proto
   287     @proto
   288     This case is only valid for the Editable comboBox.
   288     This case is only valid for the Editable comboBox.
   309     Q_D( const HbComboBox );
   309     Q_D( const HbComboBox );
   310     if( d->mModel ) {
   310     if( d->mModel ) {
   311         return d->mModel->rowCount( );
   311         return d->mModel->rowCount( );
   312     }
   312     }
   313     return 0;
   313     return 0;
   314 }
       
   315 
       
   316 /*!
       
   317     \deprecated HbComboBox::insertPolicy() const
       
   318     is deprecated.
       
   319     \sa setInsertPolicy
       
   320 */
       
   321 HbComboBox::InsertPolicy HbComboBox::insertPolicy( ) const
       
   322 {
       
   323     Q_D( const HbComboBox );
       
   324     qDebug() << "this is deprecated and will cease to exist in the near future.";
       
   325     return d->insertPolicy;
       
   326 }
       
   327 
       
   328 /*!
       
   329     \deprecated HbComboBox::setInsertPolicy(HbComboBox::InsertPolicy)
       
   330     is deprecated.
       
   331     \sa insertPolicy
       
   332 */
       
   333 void HbComboBox::setInsertPolicy( InsertPolicy policy )
       
   334 {
       
   335     Q_D( HbComboBox );
       
   336     qDebug() << "this is deprecated and will cease to exist in the near future.";
       
   337     d->insertPolicy = policy;
       
   338 }
   314 }
   339 
   315 
   340 /*!
   316 /*!
   341     @beta
   317     @beta
   342     Sets the model to \a model 
   318     Sets the model to \a model 
   486                     clearEditText();
   462                     clearEditText();
   487                 } else {
   463                 } else {
   488                     if( d->mLineEdit ) {
   464                     if( d->mLineEdit ) {
   489                         d->mLineEdit->setText( QString() );
   465                         d->mLineEdit->setText( QString() );
   490                     } else {
   466                     } else {
   491                         d->mText = QString( );
   467                         d->mText.clear();
   492                         HbStyleOptionComboBox comboBoxOption;
   468                         HbStyleOptionComboBox comboBoxOption;
   493                         initStyleOption(&comboBoxOption);
   469                         initStyleOption(&comboBoxOption);
   494                         style()->updatePrimitive( d->mTextItem, HbStyle::P_ComboBox_text, &comboBoxOption);
   470                         style()->updatePrimitive( d->mTextItem, HbStyle::P_ComboBox_text, &comboBoxOption);
   495                     }
   471                     }
   496                 }
   472                 }
   633             clearEditText();
   609             clearEditText();
   634         } else {
   610         } else {
   635             if( d->mLineEdit ) {
   611             if( d->mLineEdit ) {
   636                 d->mLineEdit->setText( QString() );
   612                 d->mLineEdit->setText( QString() );
   637             } else {
   613             } else {
   638                 d->mText = QString( );
   614                 d->mText.clear();
   639                 HbStyleOptionComboBox comboBoxOption;
   615                 HbStyleOptionComboBox comboBoxOption;
   640                 initStyleOption(&comboBoxOption);
   616                 initStyleOption(&comboBoxOption);
   641                 style()->updatePrimitive( d->mTextItem, HbStyle::P_ComboBox_text, &comboBoxOption);
   617                 style()->updatePrimitive( d->mTextItem, HbStyle::P_ComboBox_text, &comboBoxOption);
   642             }
   618             }
   643         }
   619         }