src/hbwidgets/popups/hblistdialog.cpp
changeset 1 f7ac710697a9
parent 0 16d8024aca5e
equal deleted inserted replaced
0:16d8024aca5e 1:f7ac710697a9
    27 #include "hblistdialog_p.h"
    27 #include "hblistdialog_p.h"
    28 #include "hblabel.h"
    28 #include "hblabel.h"
    29 #include "hbaction.h"
    29 #include "hbaction.h"
    30 #include "hbabstractviewitem.h"
    30 #include "hbabstractviewitem.h"
    31 #include <hbinstance.h>
    31 #include <hbinstance.h>
    32 
    32 #include "hbglobal_p.h"
    33 #include <QtGui>
    33 
    34 #include <QtDebug>
    34 #include <QtDebug>
    35 #include <QGraphicsScene>
    35 #include <QGraphicsScene>
    36 #include <hblistwidgetitem.h>
    36 #include <hblistwidgetitem.h>
    37 #include <hblistwidget.h>
    37 #include <hblistwidget.h>
    38 #include <hbradiobuttonlist.h>
    38 #include <hbradiobuttonlist.h>
    39 /*!
    39 /*!
    40   @beta
    40   \this class is deprecated. Use HbSelectionDialog.
       
    41 */
       
    42 
       
    43 /*!
       
    44   \deprecated HbListDialog(QGraphicsItem*)
       
    45 	is deprecated. \this is deprecated, use HbSelectionDialog.
       
    46 
    41   Constructor	
    47   Constructor	
    42 */
    48 */
       
    49 
    43 HbListDialog::HbListDialog(QGraphicsItem* parent): 
    50 HbListDialog::HbListDialog(QGraphicsItem* parent): 
    44                                 HbDialog(*new HbListDialogPrivate, parent)
    51                                 HbDialog(*new HbListDialogPrivate, parent)
    45 {
    52 {
       
    53 	HB_DEPRECATED("HbListDialog class is deprecated. Use HbSelectionDialog");
       
    54 
    46     Q_D(HbListDialog);
    55     Q_D(HbListDialog);
    47     d->init();
    56     d->init();
    48     setDismissPolicy(NoDismiss);
    57     setDismissPolicy(NoDismiss);
    49 }
    58 }
    50 
    59 
   193 QAbstractItemModel* HbListDialog::model() const
   202 QAbstractItemModel* HbListDialog::model() const
   194 {
   203 {
   195 	Q_D(const HbListDialog);
   204 	Q_D(const HbListDialog);
   196 	return d->model();
   205 	return d->model();
   197 }
   206 }
   198 /*!
   207 /*!                                  
   199     @beta
       
   200     Static convenience function to let the user select item(s) from a
   208     Static convenience function to let the user select item(s) from a
   201     string list. \a label is the text which is shown to the user (it
   209     string list. \a label is the text which is shown to the user (it
   202     should say what should be entered). \a list is the string list which 
   210     should say what should be entered). \a list is the string list which 
   203     is inserted into the list and \a current is 
   211     is inserted into the list and \a current is 
   204     the number of the item which should be the current item. 
   212     the number of the item which should be the current item. 
   237     dlg->setAttribute(Qt::WA_DeleteOnClose);
   245     dlg->setAttribute(Qt::WA_DeleteOnClose);
   238     dlg->open(receiver,member);
   246     dlg->open(receiver,member);
   239 }
   247 }
   240 
   248 
   241 /*!
   249 /*!
   242     @beta
   250    Static convenience function to let the user select item(s) from a
   243     Static convenience function to let the user select item(s) from a
       
   244     list of user defined items. \a label is the text which is shown to the 
   251     list of user defined items. \a label is the text which is shown to the 
   245     user (it should say what should be entered). \a list is the list 
   252     user (it should say what should be entered). \a list is the list 
   246     of user defined items shown to the user.Ownership is not transferred.
   253     of user defined items shown to the user.Ownership is not transferred.
   247     \a current is the number of the item which should be the current item. 
   254     \a current is the number of the item which should be the current item. 
   248 
   255 
   280     dlg->setAttribute(Qt::WA_DeleteOnClose);
   287     dlg->setAttribute(Qt::WA_DeleteOnClose);
   281     dlg->open(receiver,member);
   288     dlg->open(receiver,member);
   282 }
   289 }
   283 
   290 
   284 /*!
   291 /*!
   285     @beta
       
   286     Static convenience function to let the user select item(s) from a
   292     Static convenience function to let the user select item(s) from a
   287     list of items defined by a user set model.\a label is the text which 
   293     list of items defined by a user set model.\a label is the text which 
   288     is shown to the user (it should say what should be entered). \a model 
   294     is shown to the user (it should say what should be entered). \a model 
   289     is user defined model which list will use to render the items.
   295     is user defined model which list will use to render the items.
   290 	Ownership is not transferred.
   296 	Ownership is not transferred.
   316     dlg->open(receiver,member);
   322     dlg->open(receiver,member);
   317 }
   323 }
   318 
   324 
   319 
   325 
   320 /*!
   326 /*!
   321     @deprecated HbListDialog::getStringItems(const QString&,const QStringList,int,bool*,HbAbstractItemView::SelectionMode,QGraphicsScene*,QGraphicsItem*)
   327     \deprecated HbListDialog::getStringItems(const QString&,const QStringList,int,bool*,HbAbstractItemView::SelectionMode,QGraphicsScene*,QGraphicsItem*)
   322     Static convenience function to let the user select item(s) from a
   328         is deprecated. Please use the other available HbListDialog::getStringItems(...) API.
       
   329     
       
   330 	Static convenience function to let the user select item(s) from a
   323     string list. \a label is the text which is shown to the user (it
   331     string list. \a label is the text which is shown to the user (it
   324     should say what should be entered). \a list is the string list which 
   332     should say what should be entered). \a list is the string list which 
   325     is inserted into the list and \a current is 
   333     is inserted into the list and \a current is 
   326     the number of the item which should be the current item. 
   334     the number of the item which should be the current item. 
   327 
   335 
   336     and may contain more items in case of \a MultiSelection.
   344     and may contain more items in case of \a MultiSelection.
   337 */
   345 */
   338 QStringList HbListDialog::getStringItems(const QString &label, const QStringList &list,int current,
   346 QStringList HbListDialog::getStringItems(const QString &label, const QStringList &list,int current,
   339                                                 bool *ok,HbAbstractItemView::SelectionMode mode, QGraphicsScene *scene, QGraphicsItem *parent)
   347                                                 bool *ok,HbAbstractItemView::SelectionMode mode, QGraphicsScene *scene, QGraphicsItem *parent)
   340 {
   348 {
       
   349     HB_DEPRECATED("HbListDialog::getStringItems is deprecated. Use HbListDialog::getStringItems(const QString &,const QStringList &,QObject *receiver,const char *,int,HbAbstractItemView::SelectionMode, QGraphicsScene *, QGraphicsItem *)");
       
   350 
   341 	Q_UNUSED(parent)
   351 	Q_UNUSED(parent)
   342 	
   352 	
   343 	HbListDialog *dlg = new HbListDialog();
   353 	HbListDialog *dlg = new HbListDialog();
   344     if (scene) {
   354     if (scene) {
   345         scene->addItem(dlg);
   355         scene->addItem(dlg);
   368     }
   378     }
   369     return result;
   379     return result;
   370 }
   380 }
   371 
   381 
   372 /*!
   382 /*!
   373     @deprecated HbListDialog::getWidgetItems(const QString &, QList<HbListWidgetItem*> &,int,bool *,HbAbstractItemView::SelectionMode, QGraphicsScene *, QGraphicsItem *)
   383     \deprecated HbListDialog::getWidgetItems(const QString &, QList<HbListWidgetItem*> &,int,bool *,HbAbstractItemView::SelectionMode, QGraphicsScene *, QGraphicsItem *)
       
   384         is deprecated. Use the other available HbListDialog::getWidgetItems(...) API.
       
   385 
   374     Static convenience function to let the user select item(s) from a
   386     Static convenience function to let the user select item(s) from a
   375     list of user defined items. \a label is the text which is shown to the 
   387     list of user defined items. \a label is the text which is shown to the 
   376     user (it should say what should be entered). \a list is the list 
   388     user (it should say what should be entered). \a list is the list 
   377     of user defined items shown to the user.Ownership is not transferred.
   389     of user defined items shown to the user.Ownership is not transferred.
   378     \a current is the number of the item which should be the current item. 
   390     \a current is the number of the item which should be the current item. 
   388     \SingleSelection and may contain more items in case of \a MultipleSelection.
   400     \SingleSelection and may contain more items in case of \a MultipleSelection.
   389 */
   401 */
   390 QList<HbListWidgetItem*> HbListDialog::getWidgetItems(const QString &label, QList<HbListWidgetItem*> &list,int current,
   402 QList<HbListWidgetItem*> HbListDialog::getWidgetItems(const QString &label, QList<HbListWidgetItem*> &list,int current,
   391                                                         bool *ok,HbAbstractItemView::SelectionMode mode, QGraphicsScene *scene, QGraphicsItem *parent)
   403                                                         bool *ok,HbAbstractItemView::SelectionMode mode, QGraphicsScene *scene, QGraphicsItem *parent)
   392 {
   404 {
       
   405     HB_DEPRECATED("HbListDialog::getWidgetItems is deprecated. Use HbListDialog::getWidgetItems(const QString &, QList<HbListWidgetItem*> &list,QObject *,const char *,int,HbAbstractItemView::SelectionMode, QGraphicsScene *, QGraphicsItem *)");
       
   406 
   393     Q_UNUSED(parent)
   407     Q_UNUSED(parent)
   394     HbListDialog *dlg = new HbListDialog();
   408     HbListDialog *dlg = new HbListDialog();
   395     if (scene) {
   409     if (scene) {
   396         scene->addItem(dlg);
   410         scene->addItem(dlg);
   397     }
   411     }
   421 
   435 
   422 	return result;
   436 	return result;
   423 }
   437 }
   424 
   438 
   425 /*!
   439 /*!
   426     @deprecated HbListDialog::getModelIndexes(const QString &, QAbstractItemModel* ,bool *,HbAbstractItemView::SelectionMode , QGraphicsScene *, QGraphicsItem *)
   440     \deprecated HbListDialog::getModelIndexes(const QString &, QAbstractItemModel* ,bool *,HbAbstractItemView::SelectionMode , QGraphicsScene *, QGraphicsItem *)
       
   441         is deprecated. Use the other available HbListDialog::getModexIndexes(...) API.
       
   442 
   427     Static convenience function to let the user select item(s) from a
   443     Static convenience function to let the user select item(s) from a
   428     list of items defined by a user set model.\a label is the text which 
   444     list of items defined by a user set model.\a label is the text which 
   429     is shown to the user (it should say what should be entered). \a model 
   445     is shown to the user (it should say what should be entered). \a model 
   430     is user defined model which list will use to render the items.
   446     is user defined model which list will use to render the items.
   431 	Ownership is not transferred.
   447 	Ownership is not transferred.
   439     List will contain only one item if \a SelectionMode is \a SingleSelection or
   455     List will contain only one item if \a SelectionMode is \a SingleSelection or
   440     \NoSelection and may contain more items in case of \a MultipleSelection.
   456     \NoSelection and may contain more items in case of \a MultipleSelection.
   441 */
   457 */
   442 QModelIndexList HbListDialog::getModelIndexes(const QString &label, QAbstractItemModel* model,bool *ok,HbAbstractItemView::SelectionMode mode, QGraphicsScene *scene, QGraphicsItem *parent)
   458 QModelIndexList HbListDialog::getModelIndexes(const QString &label, QAbstractItemModel* model,bool *ok,HbAbstractItemView::SelectionMode mode, QGraphicsScene *scene, QGraphicsItem *parent)
   443 {
   459 {
       
   460     HB_DEPRECATED("HbListDialog::getModelIndexes is deprecated. Use HbListDialog::getModelIndexes(const QString &, QAbstractItemModel*,QObject *,const char *,HbAbstractItemView::SelectionMode, QGraphicsScene *, QGraphicsItem *)");
       
   461 
   444     Q_UNUSED(parent)
   462     Q_UNUSED(parent)
   445     HbListDialog *dlg = new HbListDialog();
   463     HbListDialog *dlg = new HbListDialog();
   446     if (scene) {
   464     if (scene) {
   447         scene->addItem(dlg);
   465         scene->addItem(dlg);
   448     }
   466     }