aboutsummaryrefslogtreecommitdiff
path: root/src/corelib/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/widgets')
-rw-r--r--src/corelib/widgets/mabstractitemmodel.cpp171
-rw-r--r--src/corelib/widgets/mabstractitemmodel.h141
-rw-r--r--src/corelib/widgets/mabstractitemmodel_p.h56
-rw-r--r--src/corelib/widgets/mapplicationpage.h2
-rw-r--r--src/corelib/widgets/mapplicationwindow.cpp16
-rw-r--r--src/corelib/widgets/mbubbleitem.cpp171
-rw-r--r--src/corelib/widgets/mbubbleitem.h294
-rw-r--r--src/corelib/widgets/mbubbleitem_p.h38
-rw-r--r--src/corelib/widgets/mbubbleitemmodel.cpp20
-rw-r--r--src/corelib/widgets/mbubbleitemmodel.h91
-rw-r--r--src/corelib/widgets/mcontentitem.cpp27
-rw-r--r--src/corelib/widgets/mcontentitem.h34
-rw-r--r--src/corelib/widgets/mcontentitem_p.h1
-rw-r--r--src/corelib/widgets/mcontentitemmodel.h32
-rw-r--r--src/corelib/widgets/mlabel.cpp2
-rw-r--r--src/corelib/widgets/mlist.cpp24
-rw-r--r--src/corelib/widgets/mlist.h11
-rw-r--r--src/corelib/widgets/mlist_p.h2
-rw-r--r--src/corelib/widgets/mlistfilter.cpp167
-rw-r--r--src/corelib/widgets/mlistfilter.h127
-rw-r--r--src/corelib/widgets/mlistfilter_p.h53
-rw-r--r--src/corelib/widgets/mlistitem.cpp51
-rw-r--r--src/corelib/widgets/mlistitem.h72
-rw-r--r--src/corelib/widgets/mlistitem_p.h37
-rw-r--r--src/corelib/widgets/mlistitemmodel.h30
-rw-r--r--src/corelib/widgets/mnavigationbar.h4
-rw-r--r--src/corelib/widgets/mpannableviewport.cpp15
-rw-r--r--src/corelib/widgets/mpannableviewport.h1
-rw-r--r--src/corelib/widgets/mpannableviewportlayout.cpp6
-rw-r--r--src/corelib/widgets/mpannablewidget.cpp23
-rw-r--r--src/corelib/widgets/mphysics2dpanning.cpp139
-rw-r--r--src/corelib/widgets/mphysics2dpanning.h2
-rw-r--r--src/corelib/widgets/mphysics2dpanning_p.h11
-rw-r--r--src/corelib/widgets/mprogressindicator.h2
-rw-r--r--src/corelib/widgets/msortfilterproxymodel.cpp38
-rw-r--r--src/corelib/widgets/msortfilterproxymodel.h53
-rw-r--r--src/corelib/widgets/mtextedit.cpp36
-rw-r--r--src/corelib/widgets/mtextedit.h23
-rw-r--r--src/corelib/widgets/mtoolbar.h14
-rw-r--r--src/corelib/widgets/mwindow.cpp120
-rw-r--r--src/corelib/widgets/mwindow_p.h4
-rw-r--r--src/corelib/widgets/widgets.pri16
42 files changed, 2011 insertions, 166 deletions
diff --git a/src/corelib/widgets/mabstractitemmodel.cpp b/src/corelib/widgets/mabstractitemmodel.cpp
new file mode 100644
index 00000000..bfbee6f6
--- /dev/null
+++ b/src/corelib/widgets/mabstractitemmodel.cpp
@@ -0,0 +1,171 @@
+/***************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (directui@nokia.com)
+**
+** This file is part of libmeegotouch.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at directui@nokia.com.
+**
+** This library is free software; you can redistribute it and/or
+** modify it under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation
+** and appearing in the file LICENSE.LGPL included in the packaging
+** of this file.
+**
+****************************************************************************/
+
+#include "mabstractitemmodel.h"
+#include "mabstractitemmodel_p.h"
+
+MAbstractItemModelPrivate::MAbstractItemModelPrivate()
+ : groupMode(false)
+{
+}
+
+MAbstractItemModelPrivate::~MAbstractItemModelPrivate()
+{
+}
+
+void MAbstractItemModelPrivate::connectModel()
+{
+ Q_Q(MAbstractItemModel);
+
+ connect(q, SIGNAL(rowsInserted(QModelIndex,int,int)), SLOT(_q_rowsInsertAnimated(QModelIndex,int,int)));
+ connect(q, SIGNAL(rowsRemoved(QModelIndex,int,int)), SLOT(_q_rowsRemoveAnimated(QModelIndex,int,int)));
+}
+
+void MAbstractItemModelPrivate::setGrouped(bool mode)
+{
+ groupMode = mode;
+}
+
+bool MAbstractItemModelPrivate::isGrouped() const
+{
+ return groupMode;
+}
+
+void MAbstractItemModelPrivate::setChangeAnimated(bool animated)
+{
+ animatedChange.push(animated);
+}
+
+bool MAbstractItemModelPrivate::changeAnimated()
+{
+ return animatedChange.pop();
+}
+
+void MAbstractItemModelPrivate::_q_rowsInsertAnimated(const QModelIndex &parent, int first, int last)
+{
+ Q_Q(MAbstractItemModel);
+
+ emit q->rowsInserted(parent, first, last, changeAnimated());
+}
+
+void MAbstractItemModelPrivate::_q_rowsRemoveAnimated(const QModelIndex &parent, int first, int last)
+{
+ Q_Q(MAbstractItemModel);
+
+ emit q->rowsRemoved(parent, first, last, changeAnimated());
+}
+
+MAbstractItemModel::MAbstractItemModel(QObject *parent)
+ : QAbstractItemModel(parent),
+ d_ptr(new MAbstractItemModelPrivate)
+{
+ Q_D(MAbstractItemModel);
+
+ d->q_ptr = this;
+ d->connectModel();
+}
+
+MAbstractItemModel::~MAbstractItemModel()
+{
+}
+
+void MAbstractItemModel::setGrouped(bool mode)
+{
+ Q_D(MAbstractItemModel);
+
+ if (d->isGrouped() == mode)
+ return;
+
+ d->setGrouped(mode);
+ emit layoutChanged();
+}
+
+bool MAbstractItemModel::isGrouped() const
+{
+ Q_D(const MAbstractItemModel);
+
+ return d->isGrouped();
+}
+
+int MAbstractItemModel::rowCount(const QModelIndex &parent) const
+{
+ if (isGrouped()) {
+ if (parent.isValid())
+ return rowCountInGroup(parent.row());
+ else
+ return groupCount();
+ } else {
+ if (parent.isValid())
+ return 0;
+ else
+ return rowCountInGroup(-1);
+ }
+}
+
+QModelIndex MAbstractItemModel::index(int row, int column, const QModelIndex &parent) const
+{
+ return row < rowCountInGroup(parent.row()) ? createIndex(row, column, parent.row()) : QModelIndex();
+}
+
+QModelIndex MAbstractItemModel::parent(const QModelIndex &child) const
+{
+ if (isGrouped()) {
+ return index(child.internalId(), 0);
+ }
+
+ return QModelIndex();
+}
+
+int MAbstractItemModel::columnCount(const QModelIndex &parent) const
+{
+ Q_UNUSED(parent);
+
+ return 1;
+}
+
+QVariant MAbstractItemModel::data(const QModelIndex &index, int role) const
+{
+ if (isGrouped()) {
+ if (!index.parent().isValid())
+ return groupTitle(index.row());
+ else
+ return itemData(index.row(), index.parent().row(), role);
+ } else {
+ if (index.isValid())
+ return itemData(index.row(), -1, role);
+ }
+
+ return QVariant();
+}
+
+void MAbstractItemModel::beginInsertRows(const QModelIndex &parent, int first, int last, bool animated)
+{
+ Q_D(MAbstractItemModel);
+
+ QAbstractItemModel::beginInsertRows(parent, first, last);
+ d->setChangeAnimated(animated);
+}
+
+void MAbstractItemModel::beginRemoveRows(const QModelIndex &parent, int first, int last, bool animated)
+{
+ Q_D(MAbstractItemModel);
+
+ QAbstractItemModel::beginRemoveRows(parent, first, last);
+ d->setChangeAnimated(animated);
+}
diff --git a/src/corelib/widgets/mabstractitemmodel.h b/src/corelib/widgets/mabstractitemmodel.h
new file mode 100644
index 00000000..c2f117c4
--- /dev/null
+++ b/src/corelib/widgets/mabstractitemmodel.h
@@ -0,0 +1,141 @@
+/***************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (directui@nokia.com)
+**
+** This file is part of libmeegotouch.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at directui@nokia.com.
+**
+** This library is free software; you can redistribute it and/or
+** modify it under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation
+** and appearing in the file LICENSE.LGPL included in the packaging
+** of this file.
+**
+****************************************************************************/
+
+#ifndef MABSTRACTITEMMODEL_H
+#define MABSTRACTITEMMODEL_H
+
+#include <MExport>
+#include <QAbstractItemModel>
+
+class MAbstractItemModelPrivate;
+
+/*!
+ \class MAbstractItemModel
+ \brief MAbstractItemModel implementation of a simple list data model.
+*/
+class M_EXPORT MAbstractItemModel : public QAbstractItemModel
+{
+ Q_OBJECT
+ /*!
+ \property MAbstractItemModel::grouped
+ \brief True if the model is a grouped (tree) model, false if the model is
+ a plain list model.
+ */
+ Q_PROPERTY(bool grouped READ isGrouped WRITE setGrouped)
+
+public:
+ /*!
+ \brief Constructor.
+ \param parent Item model owner.
+ */
+ MAbstractItemModel(QObject *parent = NULL);
+ /*!
+ \brief Destructor.
+ */
+ virtual ~MAbstractItemModel();
+
+ /*!
+ \return Number of groups in the model. (O - for the plain list model).
+ */
+ virtual int groupCount() const = 0;
+
+ /*!
+ \return Number of rows in the group.
+ */
+ virtual int rowCountInGroup(int group) const = 0;
+
+ /*!
+ \param group The group index.
+ \return Title of the group.
+ */
+ virtual QString groupTitle(int group) const = 0;
+
+ /*!
+ \param row The row index in the group.
+ \param group The group index in the model, (-1 - for the plain list model).
+ \param role The item data role request.
+ \return The item data for the specified role.
+ */
+ virtual QVariant itemData(int row, int group, int role = Qt::DisplayRole) const = 0;
+
+ /*!
+ \brief Set's the grouping mode for the data model.
+ \param mode The grouping mode of the model to set.
+ */
+ void setGrouped(bool mode);
+
+ /*!
+ \return The model grouping mode.
+ */
+ bool isGrouped() const;
+
+ //! \reimp
+ QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const;
+ int rowCount(const QModelIndex &parent = QModelIndex()) const;
+ //! \reimp_end
+
+protected:
+ //! \reimp
+ int columnCount(const QModelIndex &parent) const;
+ QModelIndex parent(const QModelIndex &child) const;
+ QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
+ //! \reimp_end
+
+ /*!
+ \param parent The parent index where the row insertion begins.
+ \param first The first row index.
+ \param last The last row index.
+ \param animated Flag to insert rows with or without animations.
+ */
+ void beginInsertRows(const QModelIndex &parent, int first, int last, bool animated);
+
+ /*!
+ \param parent The parent index from which the rows are going to be removed.
+ \param first The first row index.
+ \param last The last row index.
+ \param animated Flag to remove rows with or without animations.
+ */
+ void beginRemoveRows(const QModelIndex &parent, int first, int last, bool animated);
+
+Q_SIGNALS:
+ /*!
+ \param parent Parent index in which the rows were inserted.
+ \param first First inserted row index.
+ \param last Last inserted row index.
+ \param animated Flag that shows if the insert operation was with animations or not.
+ */
+ void rowsInserted(const QModelIndex &parent, int first, int last, bool animated);
+
+ /*!
+ \param parent Parent index in which the rows were removed.
+ \param first First removed row index.
+ \param last Last removed row index.
+ \param animated Flag that shows if the remove operation was with animations or not.
+ */
+ void rowsRemoved(const QModelIndex &parent, int first, int last, bool animated);
+
+private:
+ Q_DISABLE_COPY(MAbstractItemModel)
+ Q_DECLARE_PRIVATE(MAbstractItemModel)
+ //! \internal
+ MAbstractItemModelPrivate *const d_ptr;
+ //! \internal_end
+};
+
+#endif // MABSTRACTITEMMODEL_H
diff --git a/src/corelib/widgets/mabstractitemmodel_p.h b/src/corelib/widgets/mabstractitemmodel_p.h
new file mode 100644
index 00000000..f7a5d784
--- /dev/null
+++ b/src/corelib/widgets/mabstractitemmodel_p.h
@@ -0,0 +1,56 @@
+/***************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (directui@nokia.com)
+**
+** This file is part of libmeegotouch.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at directui@nokia.com.
+**
+** This library is free software; you can redistribute it and/or
+** modify it under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation
+** and appearing in the file LICENSE.LGPL included in the packaging
+** of this file.
+**
+****************************************************************************/
+
+#ifndef MABSTRACTITEMMODEL_P_H
+#define MABSTRACTITEMMODEL_P_H
+
+#include <QObject>
+#include <QModelIndex>
+#include <QStack>
+
+class MAbstractItemModel;
+
+class MAbstractItemModelPrivate : public QObject
+{
+ Q_OBJECT
+ Q_DECLARE_PUBLIC(MAbstractItemModel)
+
+public:
+ MAbstractItemModelPrivate();
+ virtual ~MAbstractItemModelPrivate();
+
+ void connectModel();
+
+ void setGrouped(bool mode);
+ bool isGrouped() const;
+
+ void setChangeAnimated(bool animated);
+ bool changeAnimated();
+
+private Q_SLOTS:
+ void _q_rowsInsertAnimated(const QModelIndex &parent, int first, int last);
+ void _q_rowsRemoveAnimated(const QModelIndex &parent, int first, int last);
+
+private:
+ MAbstractItemModel *q_ptr;
+ QStack<bool> animatedChange;
+ bool groupMode;
+};
+
+#endif // MABSTRACTITEMMODEL_P_H
diff --git a/src/corelib/widgets/mapplicationpage.h b/src/corelib/widgets/mapplicationpage.h
index 5d8de699..27fdd372 100644
--- a/src/corelib/widgets/mapplicationpage.h
+++ b/src/corelib/widgets/mapplicationpage.h
@@ -42,7 +42,7 @@ class MPannableViewport;
the assiciated show animation for the page. If you want to show a page instantly, refer to
MSceneManager API.
- A page can contain actions, which will be shown in the navigation bar or on a view menu.
+ A page can contain actions, which will be shown in the navigation bar in the application menu.
\li addAction()
\li actions()
diff --git a/src/corelib/widgets/mapplicationwindow.cpp b/src/corelib/widgets/mapplicationwindow.cpp
index 0d58e98c..9e5a5a96 100644
--- a/src/corelib/widgets/mapplicationwindow.cpp
+++ b/src/corelib/widgets/mapplicationwindow.cpp
@@ -225,9 +225,9 @@ void MApplicationWindowPrivate::windowStateChangeEvent(QWindowStateChangeEvent *
#endif
if (q->isFullScreen() && !event->oldState().testFlag(Qt::WindowFullScreen)) {
- q->sceneManager()->disappearSceneWindowNow(statusBar);
+ q->sceneManager()->disappearSceneWindow(statusBar);
} else if (!q->isFullScreen() && event->oldState().testFlag(Qt::WindowFullScreen)) {
- q->sceneManager()->appearSceneWindowNow(statusBar);
+ q->sceneManager()->appearSceneWindow(statusBar);
}
}
@@ -241,9 +241,9 @@ void MApplicationWindowPrivate::_q_updateStatusBarVisibility()
if (q->isFullScreen()) {
if (callStatusProperty.value().toString() == "active") {
- q->sceneManager()->appearSceneWindowNow(statusBar);
+ q->sceneManager()->appearSceneWindow(statusBar);
} else {
- q->sceneManager()->disappearSceneWindowNow(statusBar);
+ q->sceneManager()->disappearSceneWindow(statusBar);
}
}
}
@@ -381,7 +381,6 @@ void MApplicationWindowPrivate::openMenu()
if (menu->actions().count() > 0) {
menu->appear(q);
escapeButtonPanel->setEnabled(false);
- toolBar->setEnabled(false);
}
}
@@ -569,8 +568,11 @@ void MApplicationWindowPrivate::updateDockWidgetVisibility()
bool toolbarHasVisibleActions = false;
for (int i = 0; i < count; ++i) {
if (actions[i]->isVisible()) {
- toolbarHasVisibleActions = true;
- break;
+ MAction *action = qobject_cast<MAction*>(actions[i]);
+ if(!action || action->location().testFlag(MAction::ToolBarPortraitLocation)) {
+ toolbarHasVisibleActions = true;
+ break;
+ }
}
}
diff --git a/src/corelib/widgets/mbubbleitem.cpp b/src/corelib/widgets/mbubbleitem.cpp
new file mode 100644
index 00000000..d8bbf0e6
--- /dev/null
+++ b/src/corelib/widgets/mbubbleitem.cpp
@@ -0,0 +1,171 @@
+/***************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (directui@nokia.com)
+**
+** This file is part of libmeegotouch.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at directui@nokia.com.
+**
+** This library is free software; you can redistribute it and/or
+** modify it under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation
+** and appearing in the file LICENSE.LGPL included in the packaging
+** of this file.
+**
+****************************************************************************/
+
+
+#include "mbubbleitem.h"
+#include "mbubbleitem_p.h"
+#include "mbubbleitemmodel.h"
+
+#include "mimagewidget.h"
+#include "mwidgetcreator.h"
+
+M_REGISTER_WIDGET(MBubbleItem)
+
+MBubbleItemPrivate::MBubbleItemPrivate()
+ : MWidgetControllerPrivate()
+{
+}
+
+MBubbleItemPrivate::~MBubbleItemPrivate()
+{
+}
+
+void MBubbleItemPrivate::init()
+{
+}
+
+MBubbleItem::MBubbleItem(QGraphicsItem *parent)
+ : MWidgetController(new MBubbleItemPrivate, new MBubbleItemModel, parent)
+{
+ Q_D(MBubbleItem);
+
+ d->init();
+}
+
+MBubbleItem::MBubbleItem(MBubbleItemPrivate *dd, MBubbleItemModel *model, QGraphicsItem *parent)
+ : MWidgetController(dd, model, parent)
+{
+ Q_D(MBubbleItem);
+
+ d->init();
+}
+
+MBubbleItem::~MBubbleItem()
+{
+}
+
+MImageWidget* MBubbleItem::avatar() const
+{
+ return model()->avatar();
+}
+
+void MBubbleItem::setAvatar(MImageWidget* avatar)
+{
+ model()->setAvatar(avatar);
+}
+
+void MBubbleItem::setAvatar(const QPixmap &avatar)
+{
+ model()->beginTransaction();
+
+ if (!model()->avatar())
+ model()->setAvatar(new MImageWidget);
+
+ model()->avatar()->setPixmap(avatar);
+ model()->commitTransaction();
+}
+
+QString MBubbleItem::senderName()
+{
+ return model()->senderName();
+}
+
+void MBubbleItem::setSenderName(const QString &senderName)
+{
+ model()->setSenderName(senderName);
+}
+
+QString MBubbleItem::timeStamp()
+{
+ return model()->timeStamp();
+}
+
+void MBubbleItem::setTimeStamp(const QString &timeStamp)
+{
+ model()->setTimeStamp(timeStamp);
+}
+
+QString MBubbleItem::message()
+{
+ return model()->message();
+}
+
+void MBubbleItem::setMessage(const QString &message)
+{
+ model()->setMessage(message);
+}
+
+MBubbleItem::MessageType MBubbleItem::messageType() const
+{
+ return static_cast<MBubbleItem::MessageType>(model()->messageType());
+}
+
+void MBubbleItem::setMessageType(MessageType messageType)
+{
+ model()->beginTransaction();
+
+ if (messageType == MBubbleItem::Outgoing)
+ model()->setAvatar(NULL);
+
+ model()->setMessageType(messageType);
+ model()->commitTransaction();
+}
+
+void MBubbleItem::setCentralWidget(QGraphicsWidget* centralWidget)
+{
+ model()->setCentralWidget( centralWidget );
+}
+
+QGraphicsWidget* MBubbleItem::centralWidget()
+{
+ return model()->centralWidget();
+}
+
+QStack<QGraphicsWidget*> MBubbleItem::informationWidgets()
+{
+ return model()->informationWidgets();
+}
+
+void MBubbleItem::addInformationWidget(QGraphicsWidget* item)
+{
+ QStack<QGraphicsWidget*> stack = model()->informationWidgets();
+ stack.push(item);
+ model()->setInformationWidgets( stack );
+}
+
+QString MBubbleItem::commentsString()
+{
+ return model()->commentsString();
+}
+
+void MBubbleItem::setCommentsString(const QString &comments)
+{
+ model()->setCommentsString(comments);
+}
+
+QString MBubbleItem::thumbsUpString()
+{
+ return model()->thumbsUpString();
+}
+
+void MBubbleItem::setThumbsUpString(const QString &thumbsUp)
+{
+ model()->setThumbsUpString(thumbsUp);
+}
+
diff --git a/src/corelib/widgets/mbubbleitem.h b/src/corelib/widgets/mbubbleitem.h
new file mode 100644
index 00000000..939dd3eb
--- /dev/null
+++ b/src/corelib/widgets/mbubbleitem.h
@@ -0,0 +1,294 @@
+/***************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (directui@nokia.com)
+**
+** This file is part of libmeegotouch.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at directui@nokia.com.
+**
+** This library is free software; you can redistribute it and/or
+** modify it under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation
+** and appearing in the file LICENSE.LGPL included in the packaging
+** of this file.
+**
+****************************************************************************/
+
+#ifndef MBUBBLEITEM_H
+#define MBUBBLEITEM_H
+
+#include <MWidgetController>
+#include "mbubbleitemmodel.h"
+
+class MBubbleItemPrivate;
+class MImageWidget;
+
+/*!
+ \class MBubbleItem
+ \brief MBubbleItem is a speech bubble like widget for conversation views.
+
+ MBubbleItem, MListItem and MContentItem can usually be used for the same
+ type of purposes, however the MBubbleItem API is message-centric and therefore
+ better suited for messaging applications. When several bubble items are put into
+ a layout the visual impression is that of a back and forth conversation.
+
+ The speech bubble supports avatar images, separate styling for incoming and
+ outgoing messages, as well as an area for application specific widgets.
+*/
+class M_EXPORT MBubbleItem : public MWidgetController
+{
+ Q_OBJECT
+ M_CONTROLLER(MBubbleItem)
+
+public:
+
+ /*!
+ \property MBubbleItem::senderName
+ Name of the message sender.
+ */
+ Q_PROPERTY(QString senderName READ senderName WRITE setSenderName)
+
+ /*!
+ \property MBubbleItem::timeStamp
+ Time the message was sent, displayed as part of the bubble.
+ */
+ Q_PROPERTY(QString timeStamp READ timeStamp WRITE setTimeStamp)
+
+ /*!
+ \property MBubbleItem::message
+ The main body of the message.
+ */
+ Q_PROPERTY(QString message READ message WRITE setMessage)
+
+ /*!
+ \property MBubbleItem::commentsString
+ The number of comments received, displayed as part of the bubble.
+ */
+ Q_PROPERTY(QString commentsString READ commentsString WRITE setCommentsString)
+
+ /*!
+ \property MBubbleItem::thumbsUpString
+ The number of thumbs up received, displayed as part of the bubble.
+ */
+ Q_PROPERTY(QString thumbsUpString READ thumbsUpString WRITE setThumbsUpString)
+
+ /*!
+ The type determines if the message is incoming or outgoing, and the widget
+ may be styled differently based on this.
+ */
+ enum MessageType {
+ Incoming,
+ Outgoing
+ };
+
+public:
+
+ /*!
+ Constructs a MBubbleItem instance. The optional \a parent argument is passed to MWidgetController's constructor.
+ */
+ explicit MBubbleItem(QGraphicsItem *parent = 0);
+
+ /*!
+ Destroys the item.
+ */
+ virtual ~MBubbleItem();
+
+ /*!
+ Returns the image widget used for the avatar.
+
+ \sa setAvatar()
+ */
+ MImageWidget* avatar() const;
+
+ /*!
+ Returns the name of the message sender.
+
+ \sa setSenderName()
+ */
+ QString senderName();
+
+ /*!
+ Returns the time stamp string displayed as part of the bubble.
+
+ \sa setSenderName()
+ */
+ QString timeStamp();
+
+ /*!
+ Returns the body of the message.
+
+ \sa setMessage()
+ */
+ QString message();
+
+ /*!
+ Returns the type of the message.
+
+ \sa setMessageType()
+ */
+ MessageType messageType() const;
+
+ /*!
+ Returns the central widget.
+
+ For performance reasons, the central widget is not created by default.
+ If the central widget has not been previously set the function returns 0.
+
+ \sa setCentralWidget()
+ */
+ QGraphicsWidget* centralWidget();
+
+ /*!
+ Returns the stack of informational widgets attached to the bubble.
+
+ \sa addInformationWidget()
+ \sa setCommentsString()
+ \sa setThumbsUpString()
+ */
+ QStack<QGraphicsWidget*> informationWidgets();
+
+ /*!
+ Returns the string for the number of comments received for the bubble.
+
+ \sa setCommentsString();
+ */
+ QString commentsString();
+
+ /*!
+ Returns the string for the number of thumbs-up received for the bubble.
+
+ \sa setThumbsUpString()
+ */
+ QString thumbsUpString();
+
+Q_SIGNALS:
+ /*!
+ This signal is emitted if a link pointing to \a url in the message is clicked.
+
+ Links can be created using HTML notation, see the MLabel documentation for
+ further information.
+ */
+ void linkActivated(const QString &url);
+
+ /*!
+ This signal is emitted if the bubble that contains the message is clicked.
+ */
+ void bubbleClicked();
+
+public Q_SLOTS:
+
+ /**
+ Replaces the current avatar image widget attached to the bubble with \a avatar
+
+ \sa avatar()
+ */
+ void setAvatar(MImageWidget* avatar);
+
+ /*!
+ Sets the avatar image to display the \a pixmap
+
+ \sa avatar()
+ */
+ void setAvatar(const QPixmap &pixmap);
+
+ /**
+ Sets the name of the message sender to \a name
+
+ \sa senderName()
+ */
+ void setSenderName(const QString &name);
+
+ /**
+ Sets the time stamp string of the message to \a timeStamp
+
+ \sa timeStamp()
+ */
+ void setTimeStamp(const QString &timeStamp);
+
+ /**
+ Sets the body of the message to \a message
+
+ \sa message()
+ */
+ void setMessage(const QString &message);
+
+ /**
+ Sets type of the message (incoming or outgoing) to \a messageType.
+
+ \sa messageType()
+ */
+
+ void setMessageType(MessageType messageType);
+
+ /**
+ Sets the \a centralWidget
+
+ The central widget is the attachment point for application specific content
+ inside the bubble item.
+
+ Example:
+ \code
+ MBubbleItem *bubble = new MBubbleItem();
+ MWidget *container = new MWidget();
+ MImageWidget *image1 = new MImageWidget("foo");
+ MImageWidget *image2 = new MImageWidget("bar");
+ QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(Qt::Vertical, container);
+ layout->addItem(image1);
+ layout->addItem(image2);
+
+ bubble->setCentralWidget(container);
+ \endcode
+
+ \sa centralWidget()
+ */
+ void setCentralWidget(QGraphicsWidget* centralWidget);
+
+ /**
+ Adds the \a widget to the informational widgets stack.
+
+ Informational widgets are displayed as part of the message bubble main body.
+ There are two pre-defined information widgets for the bubble: number of comments and thumbs up received.
+
+ \sa informationWidgets()
+ \sa setCommentsString();
+ \sa setThumbsUpString();
+ */
+ void addInformationWidget(QGraphicsWidget* widget);
+
+ /**
+ Sets the string for number of comments received for the bubble item to \a comments.
+
+ This is a convenience method that creates widgets on the informationWidgets() stack
+ for showing the number of comments attached to the bubble item. An example of
+ a string could "+3", but it is up to the application to determine how the string
+ is formatted.
+
+ \sa commentsString()
+ */
+ void setCommentsString(const QString &comments);
+
+ /**
+ Sets the string for number of thumbs up received for the bubble item to \a thumbsUp
+
+ This is a convenience method that creates widgets on the informationWidgets() stack
+ for showing the number of "thumbs up" attached to the bubble item. An example of
+ a string could "+3", but it is up to the application to determine how the string
+ is formatted.
+
+ \sa thumbsUpString()
+ */
+ void setThumbsUpString(const QString &thumbsUp);
+
+private:
+ //! \internal
+ MBubbleItem(MBubbleItemPrivate *dd, MBubbleItemModel *model, QGraphicsItem *parent);
+ //! \internal_end
+
+ Q_DISABLE_COPY(MBubbleItem)
+ Q_DECLARE_PRIVATE(MBubbleItem)
+};
+
+#endif
diff --git a/src/corelib/widgets/mbubbleitem_p.h b/src/corelib/widgets/mbubbleitem_p.h
new file mode 100644
index 00000000..d7c3a772
--- /dev/null
+++ b/src/corelib/widgets/mbubbleitem_p.h
@@ -0,0 +1,38 @@
+/***************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (directui@nokia.com)
+**
+** This file is part of libmeegotouch.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at directui@nokia.com.
+**
+** This library is free software; you can redistribute it and/or
+** modify it under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation
+** and appearing in the file LICENSE.LGPL included in the packaging
+** of this file.
+**
+****************************************************************************/
+
+#ifndef MBUBBLEITEM_P_H__
+#define MBUBBLEITEM_P_H__
+
+#include "private/mwidgetcontroller_p.h"
+
+class MBubbleItem;
+
+class MBubbleItemPrivate : public MWidgetControllerPrivate
+{
+ Q_DECLARE_PUBLIC(MBubbleItem)
+
+public:
+ MBubbleItemPrivate();
+ virtual ~MBubbleItemPrivate();
+
+ void init();
+};
+
+#endif
diff --git a/src/corelib/widgets/mbubbleitemmodel.cpp b/src/corelib/widgets/mbubbleitemmodel.cpp
new file mode 100644
index 00000000..ab3c88b3
--- /dev/null
+++ b/src/corelib/widgets/mbubbleitemmodel.cpp
@@ -0,0 +1,20 @@
+/***************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (directui@nokia.com)
+**
+** This file is part of libmeegotouch.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at directui@nokia.com.
+**
+** This library is free software; you can redistribute it and/or
+** modify it under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation
+** and appearing in the file LICENSE.LGPL included in the packaging
+** of this file.
+**
+****************************************************************************/
+
+#include "mbubbleitemmodel.h"
diff --git a/src/corelib/widgets/mbubbleitemmodel.h b/src/corelib/widgets/mbubbleitemmodel.h
new file mode 100644
index 00000000..7b6d52ee
--- /dev/null
+++ b/src/corelib/widgets/mbubbleitemmodel.h
@@ -0,0 +1,91 @@
+/***************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (directui@nokia.com)
+**
+** This file is part of libmeegotouch.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at directui@nokia.com.
+**
+** This library is free software; you can redistribute it and/or
+** modify it under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation
+** and appearing in the file LICENSE.LGPL included in the packaging
+** of this file.
+**
+****************************************************************************/
+
+#ifndef MBUBBLEITEMMODEL_H__
+#define MBUBBLEITEMMODEL_H__
+
+#include <mwidgetmodel.h>
+#include <QStack>
+
+class QPixmap;
+class QGraphicsWidget;
+class MImageWidget;
+
+class M_EXPORT MBubbleItemModel : public MWidgetModel
+{
+ Q_OBJECT
+ M_MODEL_INTERNAL(MBubbleItemModel)
+
+public:
+ /*!
+ \property MBubbleItemModel::avatar
+ \brief Avatar.
+ */
+ M_MODEL_PTR_PROPERTY(MImageWidget *, avatar, Avatar, true, 0)
+
+ /*!
+ \property MBubbleItemModel::senderName
+ \brief Sender name.
+ */
+ M_MODEL_PROPERTY(QString, senderName, SenderName, true, QString())
+
+ /*!
+ \property MBubbleItemModel::timeStamp
+ \brief Timestamp.
+ */
+ M_MODEL_PROPERTY(QString, timeStamp, TimeStamp, true, QString())
+
+ /*!
+ \property MBubbleItemModel::message
+ \brief Message.
+ */
+ M_MODEL_PROPERTY(QString, message, Message, true, QString())
+
+ /*!
+ \property MBubbleItemModel::centralWidget
+ \brief CentralWidget.
+ */
+ M_MODEL_PTR_PROPERTY(QGraphicsWidget *, centralWidget, CentralWidget, true, NULL)
+
+ /*!
+ \property MBubbleItemModel::items
+ \brief Stack of items shown in the header, for example icons
+ */
+ M_MODEL_PROPERTY(QStack<QGraphicsWidget*>, informationWidgets, InformationWidgets, true, QStack<QGraphicsWidget*>())
+
+ /*!
+ \property MBubbleItemModel::type
+ \brief centralWidget.
+ */
+ M_MODEL_PTR_PROPERTY(int, messageType, MessageType, true, NULL)
+
+ /*!
+ \property MBubbleItemModel::commentsString
+ \brief Comment string.
+ */
+ M_MODEL_PROPERTY(QString, commentsString, CommentsString, true, QString())
+
+ /*!
+ \property MBubbleItemModel::thumbsUpString
+ \brief Thumbs up string.
+ */
+ M_MODEL_PROPERTY(QString, thumbsUpString, ThumbsUpString, true, QString())
+};
+
+#endif
diff --git a/src/corelib/widgets/mcontentitem.cpp b/src/corelib/widgets/mcontentitem.cpp
index c06b4e6e..ecc33971 100644
--- a/src/corelib/widgets/mcontentitem.cpp
+++ b/src/corelib/widgets/mcontentitem.cpp
@@ -69,6 +69,11 @@ QImage MContentItem::image() const
return d->image;
}
+QString MContentItem::imageID() const
+{
+ return model()->itemImageID();
+}
+
QString MContentItem::title() const
{
return model()->title();
@@ -103,11 +108,12 @@ void MContentItem::setImage(const QImage &image)
model()->setItemImage(d->image);
}
-void MContentItem::setImage(const QString &id)
+void MContentItem::setImageID(const QString &id, const QSize &size)
{
- Q_D(MContentItem);
- d->imageID = id;
- model()->setItemImageID(d->imageID);
+ model()->beginTransaction();
+ model()->setItemImageID(id);
+ model()->setItemImageSize(size);
+ model()->commitTransaction();
}
void MContentItem::setTitle(const QString &text)
@@ -153,6 +159,14 @@ void MContentItem::setOptionalImage(const QImage &image)
model()->setOptionalImage(d->optionalImage);
}
+void MContentItem::setOptionalImageID(const QString &id, const QSize &size)
+{
+ model()->beginTransaction();
+ model()->setOptionalImageID(id);
+ model()->setOptionalImageSize(size);
+ model()->commitTransaction();
+}
+
QPixmap MContentItem::optionalPixmap() const
{
Q_D(const MContentItem);
@@ -165,6 +179,11 @@ QImage MContentItem::optionalImage() const
return d->optionalImage;
}
+QString MContentItem::optionalImageID() const
+{
+ return model()->optionalImageID();
+}
+
void MContentItem::setAdditionalItem(MWidget* widget)
{
model()->setAdditionalItem(widget);
diff --git a/src/corelib/widgets/mcontentitem.h b/src/corelib/widgets/mcontentitem.h
index 7734375a..83b3dd8a 100644
--- a/src/corelib/widgets/mcontentitem.h
+++ b/src/corelib/widgets/mcontentitem.h
@@ -126,6 +126,12 @@ public:
Q_PROPERTY(QImage image READ image WRITE setImage)
/*!
+ \property MContentItem::imageID
+ \brief image from theme which will be displayed
+ */
+ Q_PROPERTY(QString imageID READ imageID WRITE setImageID)
+
+ /*!
\property MContentItem::title
\brief See MContentItemModel::title
*/
@@ -145,6 +151,12 @@ public:
Q_PROPERTY(QImage optionalImage READ optionalImage WRITE setOptionalImage)
+ /*!
+ \property MContentItem::optionalImage
+ \brief image from theme which will be displayed as "optional image"
+ */
+ Q_PROPERTY(QString optionalImageID READ optionalImageID WRITE setOptionalImageID)
+
public:
/*!
@@ -172,6 +184,12 @@ public:
QImage image() const;
/*!
+ \brief Get the thumbnail image theme-id
+ \return id
+ */
+ QString imageID() const;
+
+ /*!
\brief Get the title.
\return title text string.
*/
@@ -213,6 +231,12 @@ public:
*/
QImage optionalImage() const;
+ /*!
+ \brief Get the optional image theme-id
+ \return id
+ */
+ QString optionalImageID() const;
+
public Q_SLOTS:
/**
\brief Sets thumbnail pixmap.
@@ -229,8 +253,9 @@ public Q_SLOTS:
/**
\brief Sets thumbnail image.
\param id, image id in theme system.
+ \param size, requested size of the icon
*/
- void setImage(const QString &id);
+ void setImageID(const QString &id, const QSize &size = QSize());
/**
\brief Set title text. This is first line.
@@ -284,6 +309,13 @@ public Q_SLOTS:
*/
void setOptionalImage(const QImage& image);
+ /**
+ \brief Sets optional image (Icon).
+ \param id, image id in theme system.
+ \param s, requested size of the icon
+ */
+ void setOptionalImageID(const QString &id, const QSize &s = QSize());
+
/*!
\brief Makes content item to send clicked() signal.
*/
diff --git a/src/corelib/widgets/mcontentitem_p.h b/src/corelib/widgets/mcontentitem_p.h
index 0f9c4be4..65f81a74 100644
--- a/src/corelib/widgets/mcontentitem_p.h
+++ b/src/corelib/widgets/mcontentitem_p.h
@@ -33,7 +33,6 @@ public:
QPixmap pixmap;
QImage image;
- QString imageID;
QPixmap optionalPixmap;
QImage optionalImage;
MLabel* smallText;
diff --git a/src/corelib/widgets/mcontentitemmodel.h b/src/corelib/widgets/mcontentitemmodel.h
index 6a182ac5..4e852bd6 100644
--- a/src/corelib/widgets/mcontentitemmodel.h
+++ b/src/corelib/widgets/mcontentitemmodel.h
@@ -75,11 +75,25 @@ public:
*/
M_MODEL_PROPERTY(QImage, itemImage, ItemImage, false, QImage())
- M_MODEL_PROPERTY(QImage, itemQImage, ItemQImage, false, QImage())
+ /*!
+ \property MContentItemModel::itemImageID
+ \brief Item thumbnail theme ID.
+ \sa MContentItemView
+ */
M_MODEL_PROPERTY(QString, itemImageID, ItemImageID, true, QString())
/*!
+ \property MContentItemModel::itemImageSize
+ \brief Contains size of the thumbnail (set thumbnail from theme using itemImageID).
+
+ \sa MContentItemView
+ */
+ M_MODEL_PROPERTY(QSize, itemImageSize, ItemImageSize, true, QSize())
+
+ M_MODEL_PROPERTY(QImage, itemQImage, ItemQImage, false, QImage())
+
+ /*!
\property MContentItemModel::selected
\brief Contains selection status of item.
*/
@@ -98,6 +112,22 @@ public:
M_MODEL_PROPERTY(QImage, optionalImage, OptionalImage, false, QImage())
/*!
+ \property MContentItemModel::optionalImageID
+ \brief Contains theme ID of optional icon on the right-hand side.
+
+ \sa MContentItemView
+ */
+ M_MODEL_PROPERTY(QString, optionalImageID, OptionalImageID, true, QString())
+
+ /*!
+ \property MContentItemModel::optionalImageSize
+ \brief Contains size of the optional icon (set optional icon from theme with optionalImageID).
+
+ \sa MContentItemView
+ */
+ M_MODEL_PROPERTY(QSize, optionalImageSize, OptionalImageSize, true, QSize())
+
+ /*!
\property MContentItemModel::additionalItem
\brief MWidget as e.g. progress bar, visible below the title.
In case there is already a subtitle it will be replaced.
diff --git a/src/corelib/widgets/mlabel.cpp b/src/corelib/widgets/mlabel.cpp
index 8e7d04e1..e4c3dfdc 100644
--- a/src/corelib/widgets/mlabel.cpp
+++ b/src/corelib/widgets/mlabel.cpp
@@ -32,13 +32,11 @@ M_REGISTER_WIDGET(MLabel)
MLabel::MLabel(QGraphicsItem *parent, MLabelModel *model) :
MWidgetController(new MLabelPrivate, model == NULL ? new MLabelModel : model, parent)
{
- grabGesture(Qt::TapAndHoldGesture);
}
MLabel::MLabel(QString const &text, QGraphicsItem *parent) :
MWidgetController(new MLabelPrivate, new MLabelModel, parent)
{
- grabGesture(Qt::TapAndHoldGesture);
setText(text);
}
diff --git a/src/corelib/widgets/mlist.cpp b/src/corelib/widgets/mlist.cpp
index decec0f3..fea4b469 100644
--- a/src/corelib/widgets/mlist.cpp
+++ b/src/corelib/widgets/mlist.cpp
@@ -29,16 +29,18 @@
#include "mlist_p.h"
#include "mlabel.h"
#include "mpannableviewport.h"
+#include "mlistfilter.h"
#include "mwidgetcreator.h"
M_REGISTER_WIDGET(MList)
- MListPrivate::MListPrivate() : selectionMode(MList::NoSelection)
+MListPrivate::MListPrivate() : selectionMode(MList::NoSelection)
{
}
MListPrivate::~MListPrivate()
{
+ delete listFilter;
}
void MListPrivate::init()
@@ -47,6 +49,8 @@ void MListPrivate::init()
q->setSelectionMode(MList::NoSelection);
q->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding)); //grow to available space in both directions
+ listFilter = new MListFilter(q);
+ listFilter->setEnabled(false);
}
MList::MList(MListPrivate *dd, MListModel *model, QGraphicsItem *parent)
@@ -88,6 +92,10 @@ void MList::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
void MList::setItemModel(QAbstractItemModel *itemModel)
{
+ Q_D(MList);
+ if(d->listFilter->enabled())
+ itemModel = d->listFilter->updateItemModel(itemModel);
+
setSelectionModel(NULL);
if (itemModel)
@@ -229,3 +237,17 @@ MList::SelectionMode MList::selectionMode() const
Q_D(const MList);
return d->selectionMode;
}
+
+MListFilter *MList::filtering() const
+{
+ Q_D(const MList);
+ return d->listFilter;
+}
+
+void MList::keyPressEvent(QKeyEvent *event)
+{
+ Q_D(MList);
+
+ if(d->listFilter->enabled())
+ d->listFilter->keyPressEvent(event);
+}
diff --git a/src/corelib/widgets/mlist.h b/src/corelib/widgets/mlist.h
index f525db0a..91a8cd77 100644
--- a/src/corelib/widgets/mlist.h
+++ b/src/corelib/widgets/mlist.h
@@ -31,6 +31,7 @@ class QItemSelectionModel;
class QAbstractItemModel;
class QModelIndex;
class MCellCreator;
+class MListFilter;
/*!
\class MList
@@ -319,6 +320,11 @@ public:
*/
bool indexVisible();
+ /*!
+ \return filter which implements live filtering of list contents.
+ */
+ MListFilter *filtering() const;
+
public Q_SLOTS:
/*!
\brief Convenience function - Select the given item.
@@ -392,6 +398,11 @@ protected:
*/
virtual void contextMenuEvent(QGraphicsSceneContextMenuEvent *event);
+ /*!
+ Handling of key events
+ */
+ virtual void keyPressEvent(QKeyEvent *event);
+
private:
Q_DECLARE_PRIVATE(MList)
Q_DISABLE_COPY(MList)
diff --git a/src/corelib/widgets/mlist_p.h b/src/corelib/widgets/mlist_p.h
index fcd917dc..829e556e 100644
--- a/src/corelib/widgets/mlist_p.h
+++ b/src/corelib/widgets/mlist_p.h
@@ -32,6 +32,7 @@
class MPannableViewport;
class MWidget;
+class MListFilter;
#include "mlist.h"
@@ -48,6 +49,7 @@ public:
MList::SelectionMode selectionMode;
+ MListFilter* listFilter;
public slots:
/*!
* \brief This slot is called when items are changed in the model. The changed items are those
diff --git a/src/corelib/widgets/mlistfilter.cpp b/src/corelib/widgets/mlistfilter.cpp
new file mode 100644
index 00000000..828d8ba0
--- /dev/null
+++ b/src/corelib/widgets/mlistfilter.cpp
@@ -0,0 +1,167 @@
+/***************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (directui@nokia.com)
+**
+** This file is part of libmeegotouch.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at directui@nokia.com.
+**
+** This library is free software; you can redistribute it and/or
+** modify it under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation
+** and appearing in the file LICENSE.LGPL included in the packaging
+** of this file.
+**
+****************************************************************************/
+
+#include "mlistfilter.h"
+#include "mlistfilter_p.h"
+
+#include <MList>
+#include <MTextEdit>
+#include <MPannableViewport>
+
+#include <QKeyEvent>
+#include <QPointF>
+#include <MSortFilterProxyModel>
+
+MListFilterPrivate::MListFilterPrivate()
+: cachedPannableViewport(NULL), q_ptr(NULL)
+{
+}
+
+MListFilterPrivate::~MListFilterPrivate()
+{
+}
+
+void MListFilterPrivate::init()
+{
+ Q_Q(MListFilter);
+ connect(q->list, SIGNAL(panningStarted()), this, SLOT(panningStarted()));
+}
+
+void MListFilterPrivate::panningStarted()
+{
+ // When list's pannable viewport can be resolved for the first time,
+ // connect a signal to get viewport position changes
+ if(!cachedPannableViewport && pannableViewport()) {
+ MPannableViewport* viewport = pannableViewport();
+ connect(viewport, SIGNAL(positionChanged(QPointF)), this, SLOT(viewportPositionChanged(QPointF)));
+ }
+ panningStartPos = viewportPos;
+}
+
+void MListFilterPrivate::viewportPositionChanged(const QPointF& pos)
+{
+ Q_Q(MListFilter);
+
+ viewportPos = pos;
+ if(q->filteringEnabled && viewportPos.y() < 0 && panningStartPos.y() == 0) {
+ emit q->listPannedUpFromTop();
+ }
+}
+
+MPannableViewport* MListFilterPrivate::pannableViewport()
+{
+ Q_Q(MListFilter);
+
+ if(!cachedPannableViewport) {
+ QGraphicsWidget* parentWidget = q->list->parentWidget();
+ while(parentWidget && !cachedPannableViewport) {
+ cachedPannableViewport = qobject_cast<MPannableViewport*>(parentWidget);
+ parentWidget = parentWidget->parentWidget();
+ }
+ }
+ return cachedPannableViewport;
+}
+
+MListFilter::MListFilter(MList *parent)
+: list(parent), filterEditor(NULL), filterProxy(NULL), filteringEnabled(false), d_ptr(new MListFilterPrivate)
+{
+ Q_D(MListFilter);
+
+ d->q_ptr = this;
+ d->init();
+
+ filterProxy = new MSortFilterProxyModel(parent);
+ filterEditor = new MTextEdit(MTextEditModel::SingleLine, "", parent);
+ filterEditor->setVisible(false);
+
+ connect(filterEditor, SIGNAL(textChanged()), this, SLOT(editorTextChanged()));
+}
+
+MListFilter::~MListFilter()
+{
+}
+
+void MListFilter::setEnabled(bool enabled)
+{
+ filteringEnabled = enabled;
+
+ if(enabled) {
+ filterProxy->setSourceModel(list->itemModel());
+ list->setItemModel(filterProxy);
+ list->setFlag(QGraphicsItem::ItemIsFocusable, true);
+ list->setFocusPolicy(Qt::StrongFocus);
+ list->setFocus();
+ } else {
+ list->setFlag(QGraphicsItem::ItemIsFocusable, false);
+ if(filterProxy->sourceModel())
+ list->setItemModel(filterProxy->sourceModel());
+ filterProxy->setSourceModel(NULL);
+ }
+}
+
+QAbstractItemModel* MListFilter::updateItemModel(QAbstractItemModel *itemModel)
+{
+ QAbstractItemModel* proxyModel = itemModel;
+ if(filteringEnabled && itemModel != filterProxy) {
+ filterProxy->setSourceModel(itemModel);
+ proxyModel = filterProxy;
+ }
+ return proxyModel;
+}
+
+bool MListFilter::enabled()
+{
+ return filteringEnabled;
+}
+
+MTextEdit *MListFilter::editor() const
+{
+ return filterEditor;
+}
+
+MSortFilterProxyModel *MListFilter::proxy() const
+{
+ return filterProxy;
+}
+
+void MListFilter::setFilterRole(int role)
+{
+ filterProxy->setFilterRole(role);
+}
+
+int MListFilter::filterRole() const
+{
+ return filterProxy->filterRole();
+}
+
+void MListFilter::keyPressEvent(QKeyEvent *event)
+{
+ if(filteringEnabled && event->text()[0].isPrint()) {
+ filterEditor->insert(event->text());
+ filterEditor->setFocus();
+ }
+}
+
+void MListFilter::editorTextChanged()
+{
+ QRegExp::PatternSyntax syntax = QRegExp::RegExp;
+ Qt::CaseSensitivity caseSensitivity = Qt::CaseSensitive;
+ QRegExp regExp(filterEditor->text(), caseSensitivity, syntax);
+ filterProxy->setFilterRegExp(regExp);
+}
diff --git a/src/corelib/widgets/mlistfilter.h b/src/corelib/widgets/mlistfilter.h
new file mode 100644
index 00000000..a6ab86f2
--- /dev/null
+++ b/src/corelib/widgets/mlistfilter.h
@@ -0,0 +1,127 @@
+/***************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (directui@nokia.com)
+**
+** This file is part of libmeegotouch.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at directui@nokia.com.
+**
+** This library is free software; you can redistribute it and/or
+** modify it under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation
+** and appearing in the file LICENSE.LGPL included in the packaging
+** of this file.
+**
+****************************************************************************/
+
+#ifndef MLISTFILTER_H
+#define MLISTFILTER_H
+
+#include <QObject>
+#include "mexport.h"
+
+class MListFilterPrivate;
+class MList;
+class MTextEdit;
+class MSortFilterProxyModel;
+class QAbstractItemModel;
+class QKeyEvent;
+
+/*!
+ * \class MListFilter
+ * \brief MListFilter implements live filtering, for searching through the list content.
+ *
+ * MListFilter creates a text editor and an item proxy model to be used to filter MList items.
+ * Application is responsible of putting the text editor into layout.
+ *
+ */
+class M_EXPORT MListFilter : public QObject
+{
+ Q_OBJECT
+
+public:
+
+ /*!
+ * \brief Default constructor. Constructs the list filter.
+ * \param parent The list controller of the list filter content.
+ */
+ MListFilter(MList *parent = NULL);
+
+ /*!
+ * \brief Default destructor. Cleanups and destroys the list filter.
+ */
+ virtual ~MListFilter();
+
+ /*!
+ * \brief Sets live filtering to enabled or disabled. When
+ * live filtering is enabled list uses QSortFilterProxyModel
+ * as item model. By default live filtering is disabled.
+ */
+ void setEnabled(bool enabled);
+
+ /*!
+ * \return <code>true</code> if live filtering is enabled, otherwise false
+ */
+ bool enabled();
+
+ /*!
+ * \return text editor used in live filtering
+ */
+ MTextEdit *editor() const;
+
+ /*!
+ * \return proxy model used in live filtering
+ */
+ MSortFilterProxyModel *proxy() const;
+
+ /*!
+ * \brief Sets filter role to be used in live filtering proxy. Default is Qt::DisplayRole
+ */
+ void setFilterRole(int role);
+
+ /*!
+ * \return filter role used in live filtering proxy. Default is Qt::DisplayRole
+ */
+ int filterRole() const;
+
+ /*!
+ * \brief Handling of key events - used to pass key presses to text editor when
+ * live filtering is enabled
+ */
+ void keyPressEvent(QKeyEvent *event);
+
+public Q_SLOTS:
+
+ /*!
+ * \brief Handles text changes in live filtering text editor. Updates live filtering
+ * model regular expression.
+ */
+ void editorTextChanged();
+
+Q_SIGNALS:
+
+ /*!
+ * \brief Emitted when list is panned up starting from top position. This signal can
+ * be used in applications as a starter for list filtering with virtual keyboard.
+ */
+ void listPannedUpFromTop();
+
+protected:
+ QAbstractItemModel *updateItemModel(QAbstractItemModel* itemModel);
+
+private:
+ Q_DISABLE_COPY(MListFilter)
+ Q_DECLARE_PRIVATE(MListFilter)
+ friend class MList;
+
+ MList *list;
+ MTextEdit *filterEditor;
+ MSortFilterProxyModel *filterProxy;
+ bool filteringEnabled;
+ MListFilterPrivate *d_ptr;
+};
+
+#endif
diff --git a/src/corelib/widgets/mlistfilter_p.h b/src/corelib/widgets/mlistfilter_p.h
new file mode 100644
index 00000000..05078ed4
--- /dev/null
+++ b/src/corelib/widgets/mlistfilter_p.h
@@ -0,0 +1,53 @@
+/***************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (directui@nokia.com)
+**
+** This file is part of libmeegotouch.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at directui@nokia.com.
+**
+** This library is free software; you can redistribute it and/or
+** modify it under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation
+** and appearing in the file LICENSE.LGPL included in the packaging
+** of this file.
+**
+****************************************************************************/
+
+#ifndef MLISTFILTER_P_H
+#define MLISTFILTER_P_H
+
+#include <QObject>
+#include <QPointF>
+#include "mlistfilter.h"
+
+class MPannableViewport;
+
+class MListFilterPrivate : public QObject
+{
+ Q_OBJECT
+ Q_DECLARE_PUBLIC(MListFilter)
+
+public:
+ MListFilterPrivate();
+ virtual ~MListFilterPrivate();
+ void init();
+
+public Q_SLOTS:
+ void panningStarted();
+ void viewportPositionChanged(const QPointF& pos);
+
+private:
+ MPannableViewport* pannableViewport();
+
+private:
+ QPointF viewportPos;
+ QPointF panningStartPos;
+ MPannableViewport *cachedPannableViewport;
+ MListFilter *q_ptr;
+};
+
+#endif
diff --git a/src/corelib/widgets/mlistitem.cpp b/src/corelib/widgets/mlistitem.cpp
new file mode 100644
index 00000000..1c58f913
--- /dev/null
+++ b/src/corelib/widgets/mlistitem.cpp
@@ -0,0 +1,51 @@
+/***************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (directui@nokia.com)
+**
+** This file is part of libmeegotouch.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at directui@nokia.com.
+**
+** This library is free software; you can redistribute it and/or
+** modify it under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation
+** and appearing in the file LICENSE.LGPL included in the packaging
+** of this file.
+**
+****************************************************************************/
+
+#include "mlistitem.h"
+#include "mlistitem_p.h"
+
+#include "mwidgetcreator.h"
+
+M_REGISTER_WIDGET(MListItem)
+
+MListItemPrivate::MListItemPrivate()
+ : MWidgetControllerPrivate()
+{
+}
+
+MListItemPrivate::~MListItemPrivate()
+{
+}
+
+MListItem::MListItem(QGraphicsItem *parent)
+ : MWidgetController(new MListItemPrivate, new MListItemModel, parent)
+{
+}
+
+MListItem::~MListItem()
+{
+}
+
+void MListItem::click()
+{
+ emit clicked();
+}
+
+
+
diff --git a/src/corelib/widgets/mlistitem.h b/src/corelib/widgets/mlistitem.h
new file mode 100644
index 00000000..61d28c35
--- /dev/null
+++ b/src/corelib/widgets/mlistitem.h
@@ -0,0 +1,72 @@
+/***************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (directui@nokia.com)
+**
+** This file is part of libmeegotouch.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at directui@nokia.com.
+**
+** This library is free software; you can redistribute it and/or
+** modify it under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation
+** and appearing in the file LICENSE.LGPL included in the packaging
+** of this file.
+**
+****************************************************************************/
+
+#ifndef MLISTITEM_H
+#define MLISTITEM_H
+
+#include <MWidgetController>
+
+#include "mlistitemmodel.h"
+
+class MLayout;
+class MListItemPrivate;
+
+/*!
+ \class MListItem
+ \brief MListItem is a simple widget for displaying content with basic functionality
+ like background rendering with differend object modes.
+
+ \ingroup widgets
+
+ \sa MListItemView
+*/
+class M_EXPORT MListItem : public MWidgetController
+{
+ Q_OBJECT
+ M_CONTROLLER(MListItem)
+
+public:
+ /*!
+ \brief Constructs a MListItem with a \a parent.
+ \param parent Parent object.
+ */
+ MListItem(QGraphicsItem *parent = 0);
+ /*!
+ \brief Destructor.
+ */
+ virtual ~MListItem();
+
+public Q_SLOTS:
+ /*!
+ \brief Makes the list cell to send clicked() signal.
+ */
+ void click();
+
+Q_SIGNALS:
+ /*!
+ \brief The signal is emitted when the list cell is clicked.
+ */
+ void clicked();
+
+private:
+ Q_DECLARE_PRIVATE(MListItem)
+ Q_DISABLE_COPY(MListItem)
+};
+
+#endif // MLISTITEM_H
diff --git a/src/corelib/widgets/mlistitem_p.h b/src/corelib/widgets/mlistitem_p.h
new file mode 100644
index 00000000..5f71dbc9
--- /dev/null
+++ b/src/corelib/widgets/mlistitem_p.h
@@ -0,0 +1,37 @@
+/***************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (directui@nokia.com)
+**
+** This file is part of libmeegotouch.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at directui@nokia.com.
+**
+** This library is free software; you can redistribute it and/or
+** modify it under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation
+** and appearing in the file LICENSE.LGPL included in the packaging
+** of this file.
+**
+****************************************************************************/
+
+#ifndef MLISTITEM_P_H
+#define MLISTITEM_P_H
+
+#include <mwidgetcontroller_p.h>
+
+#include "mlistitem.h"
+
+class MListItemPrivate : MWidgetControllerPrivate
+{
+public:
+ MListItemPrivate();
+ virtual ~MListItemPrivate();
+
+private:
+ Q_DECLARE_PUBLIC(MListItem)
+};
+
+#endif // MLISTITEM_P_H
diff --git a/src/corelib/widgets/mlistitemmodel.h b/src/corelib/widgets/mlistitemmodel.h
new file mode 100644
index 00000000..22bc3237
--- /dev/null
+++ b/src/corelib/widgets/mlistitemmodel.h
@@ -0,0 +1,30 @@
+/***************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (directui@nokia.com)
+**
+** This file is part of libmeegotouch.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at directui@nokia.com.
+**
+** This library is free software; you can redistribute it and/or
+** modify it under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation
+** and appearing in the file LICENSE.LGPL included in the packaging
+** of this file.
+**
+****************************************************************************/
+
+#ifndef MLISTITEMMODEL_H
+#define MLISTITEMMODEL_H
+
+#include <MWidgetModel>
+
+class M_EXPORT MListItemModel : public MWidgetModel
+{
+ M_MODEL(MListItemModel)
+};
+
+#endif // MLISTITEMMODEL_H
diff --git a/src/corelib/widgets/mnavigationbar.h b/src/corelib/widgets/mnavigationbar.h
index f77dc922..df53674d 100644
--- a/src/corelib/widgets/mnavigationbar.h
+++ b/src/corelib/widgets/mnavigationbar.h
@@ -56,7 +56,7 @@ public:
virtual ~MNavigationBar();
/**
- * Returns the iconID of the icon of the view menu button.
+ * Returns the iconID of the icon of the application menu button.
*/
QString viewMenuIconID() const;
@@ -90,7 +90,7 @@ public Q_SLOTS:
void setViewMenuDescription(const QString &text);
/**
- * Sets the new icon of the view menu button.
+ * Sets the new icon of the application menu button.
* \param the id of the icon that should be shown.
*/
void setViewMenuIconID(const QString &id);
diff --git a/src/corelib/widgets/mpannableviewport.cpp b/src/corelib/widgets/mpannableviewport.cpp
index ac15bcb6..fc789a9a 100644
--- a/src/corelib/widgets/mpannableviewport.cpp
+++ b/src/corelib/widgets/mpannableviewport.cpp
@@ -361,6 +361,21 @@ void MPannableViewport::updateGeometry()
MPannableWidget::updateGeometry();
}
+void MPannableViewport::updateData(const QList<const char *> &modifications)
+{
+ Q_D(MPannableViewport);
+ const char *member;
+
+ foreach(member, modifications) {
+ if (member == MPannableWidgetModel::Enabled) {
+ if (isEnabled())
+ d->viewportLayout->setPanningDirections(panDirection());
+ else
+ d->viewportLayout->setPanningDirections(0);
+ }
+ }
+}
+
void MPannableViewport::setPositionIndicator(MPositionIndicator *positionIndicator)
{
Q_D(MPannableViewport);
diff --git a/src/corelib/widgets/mpannableviewport.h b/src/corelib/widgets/mpannableviewport.h
index dfcaf680..d345e7f3 100644
--- a/src/corelib/widgets/mpannableviewport.h
+++ b/src/corelib/widgets/mpannableviewport.h
@@ -168,6 +168,7 @@ public:
void setPanDirection(const Qt::Orientations &panDirection);
void resizeEvent(QGraphicsSceneResizeEvent *event);
void updateGeometry();
+ void updateData(const QList<const char *> &modifications);
//! \reimp_end
Q_SIGNALS:
diff --git a/src/corelib/widgets/mpannableviewportlayout.cpp b/src/corelib/widgets/mpannableviewportlayout.cpp
index c56b5a82..f3e54bff 100644
--- a/src/corelib/widgets/mpannableviewportlayout.cpp
+++ b/src/corelib/widgets/mpannableviewportlayout.cpp
@@ -53,11 +53,13 @@ void MPannableViewportLayout::setGeometry(const QRectF &rect)
if (pannedWidget) {
if (panningDirections.testFlag(Qt::Horizontal)) {
- unboundedRect.setWidth(pannedWidget->effectiveSizeHint(Qt::PreferredSize).width());
+ qreal width = qMax(rect.width(), pannedWidget->effectiveSizeHint(Qt::PreferredSize).width());
+ unboundedRect.setWidth(width);
}
if (panningDirections.testFlag(Qt::Vertical)) {
- unboundedRect.setHeight(pannedWidget->effectiveSizeHint(Qt::PreferredSize).height());
+ qreal height = qMax(rect.height(), pannedWidget->effectiveSizeHint(Qt::PreferredSize).height());
+ unboundedRect.setHeight(height);
}
}
diff --git a/src/corelib/widgets/mpannablewidget.cpp b/src/corelib/widgets/mpannablewidget.cpp
index 441bb13d..8f273630 100644
--- a/src/corelib/widgets/mpannablewidget.cpp
+++ b/src/corelib/widgets/mpannablewidget.cpp
@@ -180,8 +180,6 @@ MPannableWidgetPrivate::~MPannableWidgetPrivate()
void MPannableWidgetPrivate::translateEventToItemCoordinates(const QGraphicsItem *srcItem, const QGraphicsItem *destItem, QGraphicsSceneMouseEvent *event)
{
- //we only handle left button here. Every other buttons are filtered out in the glassMousePressEvents();
- event->setButtonDownPos(Qt::LeftButton, destItem->mapFromItem(srcItem, event->buttonDownPos(Qt::LeftButton)));
event->setLastPos(destItem->mapFromItem(srcItem, event->lastPos()));
event->setPos(destItem->mapFromItem(srcItem, event->pos()));
}
@@ -189,6 +187,13 @@ void MPannableWidgetPrivate::translateEventToItemCoordinates(const QGraphicsItem
void MPannableWidgetPrivate::deliverPressEvent()
{
Q_Q(MPannableWidget);
+
+ if (physics->inMotion())
+ {
+ physics->stop();
+ return;
+ }
+
glass->ungrabMouse();
q->resendEvent(&pressEvent);
mouseGrabber = q->scene()->mouseGrabberItem();
@@ -405,14 +410,7 @@ void MPannableWidget::glassMousePressEvent(QGraphicsSceneMouseEvent *event)
}
copyGraphicsSceneMouseEvent(d->pressEvent, *event);
- if (!d->physics->inMotion()) {
- // sending it now, we will send "cancel" if it will be needed.
- copyGraphicsSceneMouseEvent(d->pressEvent, *event);
- d->initialPressStartTimer();
-
- } else {
- d->physics->stop();
- }
+ d->initialPressStartTimer();
}
void MPannableWidget::glassMouseReleaseEvent(QGraphicsSceneMouseEvent *event)
@@ -467,8 +465,9 @@ void MPannableWidget::glassPanEvent(QGestureEvent *event, QPanGesture* panGestur
d->mouseGrabber = 0;
}
- d->physics->pointerPress(d->pressEvent.pos() + panGesture->offset());
- break;
+ d->physics->pointerPress(d->pressEvent.pos());
+ //Fallthough is intentionary, we need to handle the movement that
+ //is delivered with a started gesture.
case Qt::GestureUpdated:
d->physics->pointerMove(d->pressEvent.pos() + panGesture->offset());
break;
diff --git a/src/corelib/widgets/mphysics2dpanning.cpp b/src/corelib/widgets/mphysics2dpanning.cpp
index d3d3bfc8..77b3cfd2 100644
--- a/src/corelib/widgets/mphysics2dpanning.cpp
+++ b/src/corelib/widgets/mphysics2dpanning.cpp
@@ -23,9 +23,7 @@
#include "mphysics2dpanning.h"
#include "mphysics2dpanning_p.h"
-static const int PanningTimelineDuration = 1000000; /* in ms */
-static const int PanningTimelineInterval = 20; /* in ms */
-static const int PositionNoiseDampingDelta = 2; /* in px */
+static const int PositionNoiseDampingDelta = 2; /* in px */
MPhysics2DPanningPrivate::MPhysics2DPanningPrivate(MPhysics2DPanning *publicObject) :
enabled(true),
@@ -37,8 +35,7 @@ MPhysics2DPanningPrivate::MPhysics2DPanningPrivate(MPhysics2DPanning *publicObje
pointerSpringX(0.0),
pointerSpringY(0.0),
sceneLastPos(QPointF()),
- timeLine(new QTimeLine()),
- currFrame(0),
+ panningAnimation(new PanningAnimation),
pointerPressed(false),
pointerSpringK(0.0),
frictionC(0.0),
@@ -53,75 +50,68 @@ MPhysics2DPanningPrivate::MPhysics2DPanningPrivate(MPhysics2DPanning *publicObje
MPhysics2DPanningPrivate::~MPhysics2DPanningPrivate()
{
- delete timeLine;
+ delete panningAnimation;
}
-void MPhysics2DPanningPrivate::_q_integrator(int frame)
+void MPhysics2DPanningPrivate::_q_integrator(const QVariant &value)
{
Q_Q(MPhysics2DPanning);
+ Q_UNUSED(value);
qreal accX, accY;
qreal tempPosX;
qreal tempPosY;
- int i = 0;
tempPosX = posX;
tempPosY = posY;
- while (frame > currFrame) {
- if (panDirection.testFlag(Qt::Horizontal)) {
- q->integrateAxis(Qt::Horizontal,
- posX,
- velX,
- accX,
- pointerSpringX,
- pointerPressed
- );
- } else {
- posX = 0.0;
- velX = 0.0;
- accX = 0.0;
- }
+ if (panDirection.testFlag(Qt::Horizontal)) {
+ q->integrateAxis(Qt::Horizontal,
+ posX,
+ velX,
+ accX,
+ pointerSpringX,
+ pointerPressed
+ );
+ } else {
+ posX = 0.0f;
+ velX = 0.0f;
+ accX = 0.0f;
+ }
- if (panDirection.testFlag(Qt::Vertical)) {
- q->integrateAxis(Qt::Vertical,
- posY,
- velY,
- accY,
- pointerSpringY,
- pointerPressed
- );
+ if (panDirection.testFlag(Qt::Vertical)) {
+ q->integrateAxis(Qt::Vertical,
+ posY,
+ velY,
+ accY,
+ pointerSpringY,
+ pointerPressed
+ );
- } else {
- posY = 0.0;
- velY = 0.0;
- accY = 0.0;
- }
+ } else {
+ posY = 0.0f;
+ velY = 0.0f;
+ accY = 0.0f;
+ }
- // Checking if the viewport is currently dragged beyond it's borders and the integration should
- // continue even though the speed is low.
- bool inRangeX = (panDirection.testFlag(Qt::Horizontal) == false) ||
- (posX >= range.left() && posX <= range.right());
+ // Checking if the viewport is currently dragged beyond it's borders and the integration should
+ // continue even though the speed is low.
+ bool inRangeX = (panDirection.testFlag(Qt::Horizontal) == false) ||
+ (posX >= range.left() && posX <= range.right());
- bool inRangeY = (panDirection.testFlag(Qt::Vertical) == false) ||
- (posY >= range.top() && posY <= range.bottom());
+ bool inRangeY = (panDirection.testFlag(Qt::Vertical) == false) ||
+ (posY >= range.top() && posY <= range.bottom());
// Integration stop condition.
- if (inRangeX && inRangeY &&
- qAbs(accX) < 1 &&
- qAbs(accY) < 1 &&
- qAbs(velX) < 1 &&
- qAbs(velY) < 1 &&
- !pointerPressed) {
- timeLine->stop();
-
- emit q->panningStopped();
-
- break;
- }
-
- currFrame++;
- i++;
+ if (inRangeX && inRangeY &&
+ qAbs(accX) < 1 &&
+ qAbs(accY) < 1 &&
+ qAbs(velX) < 1 &&
+ qAbs(velY) < 1 &&
+ !pointerPressed) {
+ panningAnimation->stop();
+
+ emit q->panningStopped();
}
if (tempPosX != posX || tempPosY != posY) {
@@ -134,8 +124,7 @@ MPhysics2DPanning::MPhysics2DPanning(QObject *parent)
d_ptr(new MPhysics2DPanningPrivate(this))
{
Q_D(MPhysics2DPanning);
- connect(d->timeLine, SIGNAL(frameChanged(int)),
- this, SLOT(_q_integrator(int)));
+ connect(d->panningAnimation, SIGNAL(valueChanged(QVariant)), SLOT(_q_integrator(QVariant)));
}
@@ -221,20 +210,20 @@ void MPhysics2DPanning::start()
{
Q_D(MPhysics2DPanning);
if (!inMotion()) {
- d->velX = 0.0;
- d->velY = 0.0;
-
- d->timeLine->setDuration(PanningTimelineDuration);
- d->timeLine->setUpdateInterval(PanningTimelineInterval);
- d->timeLine->setFrameRange(0, 29999);
- d->timeLine->setCurrentTime(0);
- d->timeLine->setCurveShape(QTimeLine::LinearCurve);
- d->currFrame = 0;
- d->timeLine->start();
+ d->velX = 0.0f;
+ d->velY = 0.0f;
+
+ // Duration does not matter as we loop until the physics termination condition is hit
+ d->panningAnimation->setDuration(1000000);
+ d->panningAnimation->setLoopCount(-1);
+
+ d->panningAnimation->setStartValue(0.0f);
+ d->panningAnimation->setEndValue(1.0f);
+
+ d->panningAnimation->start();
}
}
-
void MPhysics2DPanning::stop()
{
Q_D(MPhysics2DPanning);
@@ -248,7 +237,7 @@ void MPhysics2DPanning::stop()
(d->posY >= d->range.top() && d->posY <= d->range.bottom());
if (inRangeX && inRangeY) {
- d->timeLine->stop();
+ d->panningAnimation->stop();
emit panningStopped();
}
}
@@ -320,7 +309,7 @@ bool MPhysics2DPanning::inMotion() const
{
Q_D(const MPhysics2DPanning);
- return (d->timeLine->state() == QTimeLine::Running);
+ return (d->panningAnimation->state() == QAbstractAnimation::Running);
}
@@ -334,8 +323,8 @@ void MPhysics2DPanning::pointerPress(const QPointF &pos)
d->pointerPressed = true;
d->sceneLastPos = pos;
- d->pointerSpringX = 0.0;
- d->pointerSpringY = 0.0;
+ d->pointerSpringX = 0.0f;
+ d->pointerSpringY = 0.0f;
}
@@ -466,11 +455,11 @@ void MPhysics2DPanning::integrateAxis(Qt::Orientation orientation,
} else {
- acceleration = force;
+ acceleration = force - pointerDifference;
velocity += acceleration;
position += velocity;
- pointerDifference += velocity;
+ pointerDifference = 0;
}
}
diff --git a/src/corelib/widgets/mphysics2dpanning.h b/src/corelib/widgets/mphysics2dpanning.h
index a4955c15..0ae9d4b5 100644
--- a/src/corelib/widgets/mphysics2dpanning.h
+++ b/src/corelib/widgets/mphysics2dpanning.h
@@ -277,7 +277,7 @@ private:
Q_DISABLE_COPY(MPhysics2DPanning)
Q_DECLARE_PRIVATE(MPhysics2DPanning)
- Q_PRIVATE_SLOT(d_func(),void _q_integrator(int))
+ Q_PRIVATE_SLOT(d_func(),void _q_integrator(QVariant))
#ifdef UNIT_TEST
//! Test unit is defined as a friend of production code to access private members
diff --git a/src/corelib/widgets/mphysics2dpanning_p.h b/src/corelib/widgets/mphysics2dpanning_p.h
index 0c328eab..318c8c44 100644
--- a/src/corelib/widgets/mphysics2dpanning_p.h
+++ b/src/corelib/widgets/mphysics2dpanning_p.h
@@ -22,10 +22,16 @@
#include <QRectF>
#include <QPointF>
+#include <QVariantAnimation>
#include "mphysics2dpanning.h"
class QTimeLine;
+class PanningAnimation : public QVariantAnimation
+{
+ virtual void updateCurrentValue(const QVariant&) {}
+};
+
class MPhysics2DPanningPrivate
{
Q_DECLARE_PUBLIC(MPhysics2DPanning)
@@ -45,8 +51,7 @@ public:
qreal pointerSpringY;
QPointF sceneLastPos;
- QTimeLine *timeLine;
- int currFrame;
+ PanningAnimation *panningAnimation;
// Integration algorithm constants
bool pointerPressed;
@@ -57,7 +62,7 @@ public:
qreal borderFrictionC;
Qt::Orientations panDirection;
- void _q_integrator(int frame);
+ void _q_integrator(const QVariant &value);
protected:
MPhysics2DPanning *q_ptr;
diff --git a/src/corelib/widgets/mprogressindicator.h b/src/corelib/widgets/mprogressindicator.h
index c07589d2..6c0d3bd2 100644
--- a/src/corelib/widgets/mprogressindicator.h
+++ b/src/corelib/widgets/mprogressindicator.h
@@ -44,7 +44,7 @@ class MProgressIndicatorPrivate;
\li Application can decide to display label indicating the state of the operation next to indicator such as
"124 / 345 kt received." or "75%".
\li If the wait operation applies to the whole view, a spinner should be used to temporarily replace the view's
- view menu icon.
+ application menu icon.
\section ProgressIndicatorVariants Variants
\li \link MProgressIndicatorBarView Progress bar \endlink
diff --git a/src/corelib/widgets/msortfilterproxymodel.cpp b/src/corelib/widgets/msortfilterproxymodel.cpp
new file mode 100644
index 00000000..15f77e6d
--- /dev/null
+++ b/src/corelib/widgets/msortfilterproxymodel.cpp
@@ -0,0 +1,38 @@
+/***************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (directui@nokia.com)
+**
+** This file is part of libmeegotouch.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at directui@nokia.com.
+**
+** This library is free software; you can redistribute it and/or
+** modify it under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation
+** and appearing in the file LICENSE.LGPL included in the packaging
+** of this file.
+**
+****************************************************************************/
+
+#include "msortfilterproxymodel.h"
+
+MSortFilterProxyModel::MSortFilterProxyModel(QObject *parent)
+ : QSortFilterProxyModel(parent)
+{
+}
+
+MSortFilterProxyModel::~MSortFilterProxyModel()
+{
+}
+
+bool MSortFilterProxyModel::filterAcceptsRow(int source_row, const QModelIndex &source_parent) const
+{
+ if (!source_parent.isValid() &&
+ sourceModel()->rowCount(sourceModel()->index(source_row, 0, source_parent)) > 0)
+ return true;
+
+ return QSortFilterProxyModel::filterAcceptsRow(source_row, source_parent);
+}
diff --git a/src/corelib/widgets/msortfilterproxymodel.h b/src/corelib/widgets/msortfilterproxymodel.h
new file mode 100644
index 00000000..ebddcaa1
--- /dev/null
+++ b/src/corelib/widgets/msortfilterproxymodel.h
@@ -0,0 +1,53 @@
+/***************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (directui@nokia.com)
+**
+** This file is part of libmeegotouch.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at directui@nokia.com.
+**
+** This library is free software; you can redistribute it and/or
+** modify it under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation
+** and appearing in the file LICENSE.LGPL included in the packaging
+** of this file.
+**
+****************************************************************************/
+
+#ifndef MSORTFILTERPROXYMODEL_H
+#define MSORTFILTERPROXYMODEL_H
+
+#include <MExport>
+#include <QSortFilterProxyModel>
+
+/*!
+ \class MSortFilterProxyModel
+ \brief MSortFilterProxyModel reimplementation of a custom sort/filter proxy data model.
+ In case of filtering does not filter out the group headers (oposite to default
+ QSortFilterProxyModel behavior).
+*/
+class M_EXPORT MSortFilterProxyModel : public QSortFilterProxyModel
+{
+ Q_OBJECT
+
+public:
+ /*!
+ \brief Constructor.
+ \param parent Model owner.
+ */
+ MSortFilterProxyModel(QObject *parent = NULL);
+
+ /*!
+ \brief Destructor.
+ */
+ virtual ~MSortFilterProxyModel();
+
+ //! \reimp
+ virtual bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const;
+ //! \reimp_end
+};
+
+#endif // MSORTFILTERPROXYMODEL_H
diff --git a/src/corelib/widgets/mtextedit.cpp b/src/corelib/widgets/mtextedit.cpp
index f95eaf96..64a8d99e 100644
--- a/src/corelib/widgets/mtextedit.cpp
+++ b/src/corelib/widgets/mtextedit.cpp
@@ -1500,16 +1500,40 @@ bool MTextEdit::setCursorPosition(int index)
void MTextEdit::handleMousePress(int cursorPosition, QGraphicsSceneMouseEvent *event)
{
+ handleMousePress(cursorPosition, event, NULL);
+}
+
+
+void MTextEdit::handleMousePress(int cursorPosition, QGraphicsSceneMouseEvent *event,
+ TextFieldLocationType *location)
+{
Q_D(MTextEdit);
+ if (textInteractionFlags() != Qt::NoTextInteraction && location) {
+ QString text = document()->toPlainText();
+ MBreakIterator breakIterator(text);
+
+ if (breakIterator.isBoundary(cursorPosition) == true) {
+ *location = MTextEdit::WordBoundary;
+ } else {
+ *location = MTextEdit::Word;
+ }
+ }
+
d->notifyInputContextMouseHandler(cursorPosition, event);
}
void MTextEdit::handleMouseRelease(int eventCursorPosition, QGraphicsSceneMouseEvent *event)
{
- Q_D(MTextEdit);
+ handleMouseRelease(eventCursorPosition, event, NULL);
+}
+
+void MTextEdit::handleMouseRelease(int eventCursorPosition, QGraphicsSceneMouseEvent *event,
+ TextFieldLocationType *location)
+{
+ Q_D(MTextEdit);
if (textInteractionFlags() == Qt::NoTextInteraction)
return;
@@ -1528,9 +1552,15 @@ void MTextEdit::handleMouseRelease(int eventCursorPosition, QGraphicsSceneMouseE
// clicks on word boundaries move the cursor
if (breakIterator.isBoundary(eventCursorPosition) == true) {
+ if (location) {
+ *location = MTextEdit::WordBoundary;
+ }
d->setCursorPosition(eventCursorPosition);
} else {
+ if (location) {
+ *location = MTextEdit::Word;
+ }
if (inputMethodCorrectionEnabled()) {
// clicks on words remove them from the normal contents and makes them preedit.
int start = breakIterator.previousInclusive(eventCursorPosition);
@@ -1568,6 +1598,9 @@ void MTextEdit::handleMouseRelease(int eventCursorPosition, QGraphicsSceneMouseE
}
} else {
+ if (location) {
+ *location = MTextEdit::Word;
+ }
d->notifyInputContextMouseHandler(eventCursorPosition, event);
}
@@ -1576,7 +1609,6 @@ void MTextEdit::handleMouseRelease(int eventCursorPosition, QGraphicsSceneMouseE
}
}
-
void MTextEdit::handleMouseMove(int cursorPosition, QGraphicsSceneMouseEvent *event)
{
Q_D(MTextEdit);
diff --git a/src/corelib/widgets/mtextedit.h b/src/corelib/widgets/mtextedit.h
index 0c18d7f5..203c8901 100644
--- a/src/corelib/widgets/mtextedit.h
+++ b/src/corelib/widgets/mtextedit.h
@@ -80,6 +80,15 @@ class M_EXPORT MTextEdit : public MWidgetController
public:
typedef M::TextContentType TextContentType; // workaround for moc bug
+ //! What is under the press or release location
+ enum TextFieldLocationType {
+ //! Pressed on top of a word
+ Word,
+
+ //! Pressed between words or empty space
+ WordBoundary
+ };
+
/*!
* \brief Default constructor. Creates a textedit field with a specified text and line mode.
* \param type widget type (single line or multiline).
@@ -188,6 +197,13 @@ public:
* The implementation will notify possible input context.
* \param cursorPosition position of the click within characters
* \param event event the view received
+ * \param location assigned by the method either as Word or as WordBoundary depending on where in text mouse is pressed
+ * \note Location parameter is assigned by the method only if Qt::TextInteractionFlags is something other than Qt::NoTextInteraction
+ */
+ void handleMousePress(int cursorPosition, QGraphicsSceneMouseEvent *event, TextFieldLocationType *location);
+
+ /*!
+ * \overload handleMousePress()
*/
void handleMousePress(int cursorPosition, QGraphicsSceneMouseEvent *event);
@@ -199,6 +215,13 @@ public:
* clicked word as preedit if possible.
* \param cursorPosition position of the click within characters
* \param event event the view received
+ * \param location assigned by the method either as Word or as WordBoundary depending on where in text mouse is released
+ * \note Location parameter is assigned by the method only if Qt::TextInteractionFlags is something other than Qt::NoTextInteraction
+ */
+ void handleMouseRelease(int cursorPosition, QGraphicsSceneMouseEvent *event, TextFieldLocationType *location);
+
+ /*!
+ * \overload handleMouseRelease()
*/
void handleMouseRelease(int cursorPosition, QGraphicsSceneMouseEvent *event);
diff --git a/src/corelib/widgets/mtoolbar.h b/src/corelib/widgets/mtoolbar.h
index 64e392e4..1342df2c 100644
--- a/src/corelib/widgets/mtoolbar.h
+++ b/src/corelib/widgets/mtoolbar.h
@@ -74,18 +74,18 @@ class MToolBarPrivate;
\endcode
\section MToolBarUseGuidelines Usage guidelines
- - The toolbar is functionally in the same role as in the view menu: it has commands that
+ - The toolbar is functionally in the same role as in the application menu: it has commands that
are not related specifically to any content item or button displayed within the contents
of the view.
- The toolbar should be utilized only if the commands are expected to be used often. The
toolbar takes away space from the content area. If the commands are not important to the
view and the main use cases, it is recommendable to not have a toolbar at all, and place
- the commands in the view menu. Similarly, reconsider your design if you would have only
- one or two buttons to the toolbar; commands can be placed to the view menu, or embedded
- to the view.
+ the commands in the application menu. Similarly, reconsider your design if you would have only
+ one or two buttons to the toolbar; commands can be placed to the application menu, or embedded
+ to the page.
- Note that the toolbar is not scalable: do not place commands in the toolbar if the view is
expected to grow with more functionalities in the future.
- - The commands in the toolbar and in the view menu are not to be duplicated.
+ - The commands in the toolbar and in the application menu are not to be duplicated.
- Since the Direct UI style has no focus for the items in the content view, it is not
possible to create toolbars that have actions that affect on a single item on screen. For
instance you shouldn't design a toolbar with "Reply", "Delete", "Move" etc. commands, if
@@ -94,10 +94,10 @@ class MToolBarPrivate;
The scrollable area ends on top of the toolbar (so that the latest in the list should not
end up being stuck behind the toolbar)
- The user is not able to personalize the contents of the toolbar. The application designer
- decides what is shown in toolbar and what in view menu.
+ decides what is shown in the toolbar and what in the application menu.
- Application design can also decide whether toolbar is used in both landscape and portrait
modes. For example, a toolbar can be shown only in landscape mode, and then in portrait
- mode the functionalities are provided somewhere else (for instance in the view menu).
+ mode the functionalities are provided somewhere else (for instance in the application menu).
- The toolbar can be hidden if application designer decides so, for example when using
full-screen media, virtual keyboard or web browser. Toolbar is hidden and shown together
with command area.
diff --git a/src/corelib/widgets/mwindow.cpp b/src/corelib/widgets/mwindow.cpp
index 27d5856d..d9fac5bc 100644
--- a/src/corelib/widgets/mwindow.cpp
+++ b/src/corelib/widgets/mwindow.cpp
@@ -132,6 +132,74 @@ void MWindowPrivate::init()
if (MApplication::fullScreen())
q->showFullScreen();
+}
+
+void MWindowPrivate::initSoftwareViewport()
+{
+ Q_Q(MWindow);
+
+ mWarning("MWindow") << "Switching to software rendering";
+
+#ifdef M_USE_OPENGL
+ MGLES2Renderer::activate(NULL);
+ MGLES2Renderer::destroy(glWidget);
+ glWidget = NULL;
+#endif
+
+ q->setViewport(new QWidget());
+ q->setViewportUpdateMode(MWindow::MinimalViewportUpdate);
+
+ configureViewport();
+}
+
+void MWindowPrivate::initGLViewport()
+{
+#ifdef QT_OPENGL_LIB
+ Q_Q(MWindow);
+
+ mWarning("MWindow") << "Window restored, switching to GL rendering";
+
+ bool translucent = q->testAttribute(Qt::WA_TranslucentBackground);
+
+ // The sequence of calls here is important. When translucency is not
+ // enabled, ensure setViewport() is called before DuiGLES2Renderer
+ // initializes its vertices, otherwise call setViewport() after
+ // DuiGLES2Renderer initializes itself. Failure to do this will cause
+ // a crash.
+ // This QGLWidget is owned by the viewport so previous one
+ // actually gets deleted if we overwrite it with a new one
+ if (translucent) {
+ QGLFormat fmt;
+ // disable multisampling, is enabled by default in Qt
+ fmt.setSampleBuffers(false);
+ fmt.setSamples(0);
+ fmt.setAlpha(true); // Workaround for NB#153625
+
+ glWidget = MComponentCache::glWidget(fmt);
+ QPalette palette;
+ palette.setColor(QPalette::Base, Qt::transparent);
+ glWidget->setAutoFillBackground(true);
+ glWidget->setPalette(palette);
+ } else {
+ glWidget = MComponentCache::glWidget();
+ q->setViewport(glWidget);
+ }
+#ifdef M_USE_OPENGL
+ MGLES2Renderer::instance(glWidget);
+ MGLES2Renderer::activate(glWidget);
+#endif
+ if (translucent)
+ q->setViewport(glWidget);
+#endif
+
+ q->setViewportUpdateMode(MWindow::FullViewportUpdate);
+
+ configureViewport();
+}
+
+void MWindowPrivate::configureViewport()
+{
+ Q_Q(MWindow);
q->viewport()->grabGesture(Qt::TapAndHoldGesture);
q->viewport()->grabGesture(Qt::PinchGesture);
@@ -142,6 +210,7 @@ void MWindowPrivate::init()
q->setAttribute(Qt::WA_AcceptTouchEvents);
}
+
#ifdef Q_WS_X11
void MWindowPrivate::appendVisibilityChangeMask()
{
@@ -341,51 +410,13 @@ void MWindow::setTranslucentBackground(bool enable)
{
Q_D(MWindow);
- if (!MApplication::softwareRendering()) {
-#ifdef QT_OPENGL_LIB
- setViewportUpdateMode(MWindow::FullViewportUpdate);
-
- // The sequence of calls here is important. When translucency is not
- // enabled, ensure setViewport() is called before MGLES2Renderer
- // initializes its vertices, otherwise call setViewport() after
- // MGLES2Renderer initializes itself. Failure to do this will cause
- // a crash.
- if (enable) {
- QGLFormat fmt;
- // disable multisampling, is enabled by default in Qt
- fmt.setSampleBuffers(false);
- fmt.setSamples(0);
-
- //d->glWidget->setAttribute(Qt::WA_TranslucentBackground);
-
- fmt.setAlpha(true); // Workaround for NB#153625
- d->glWidget = new QGLWidget(fmt);
- QPalette palette;
- palette.setColor(QPalette::Base, Qt::transparent);
- d->glWidget->setAutoFillBackground(true);
- d->glWidget->setPalette(palette);
- } else {
- d->glWidget = MComponentCache::glWidget();
-
- if (d->glWidget->isValid() == false) {
- qCritical("Could not create a valid QGLWidget, quitting.");
- exit(EXIT_FAILURE);
- }
-
- setViewport(d->glWidget);
- }
-#ifdef M_USE_OPENGL
- MGLES2Renderer::instance(d->glWidget);
- MGLES2Renderer::activate(d->glWidget);
-#endif
- if (enable)
- setViewport(d->glWidget);
-#endif
- } else {
- viewport()->setAutoFillBackground(!enable);
- }
if (enable)
setAttribute(Qt::WA_TranslucentBackground);
+
+ if (MApplication::softwareRendering() || MApplication::isPrestarted())
+ d->initSoftwareViewport();
+ else
+ d->initGLViewport();
}
void MWindow::setGlobalAlpha(qreal level)
@@ -870,6 +901,9 @@ void MWindow::setVisible(bool visible)
if (MApplication::isPrestarted()) {
return;
} else {
+ if (!MApplication::softwareRendering() && d->glWidget == 0) {
+ d->initGLViewport();
+ }
d->isLogicallyClosed = false;
}
diff --git a/src/corelib/widgets/mwindow_p.h b/src/corelib/widgets/mwindow_p.h
index faf70762..30a1ad17 100644
--- a/src/corelib/widgets/mwindow_p.h
+++ b/src/corelib/widgets/mwindow_p.h
@@ -66,6 +66,10 @@ public:
void propagateMOnDisplayChangeEventToScene(MOnDisplayChangeEvent *event);
+ void initGLViewport();
+ void initSoftwareViewport();
+ void configureViewport();
+
bool onDisplay;
bool onDisplaySet;
diff --git a/src/corelib/widgets/widgets.pri b/src/corelib/widgets/widgets.pri
index ca45964c..f2731321 100644
--- a/src/corelib/widgets/widgets.pri
+++ b/src/corelib/widgets/widgets.pri
@@ -26,6 +26,7 @@ PUBLIC_HEADERS += \
$$WIDGETS_SRC_DIR/mlabel.h \
$$WIDGETS_SRC_DIR/mlabelhighlighter.h \
$$WIDGETS_SRC_DIR/mlist.h \
+ $$WIDGETS_SRC_DIR/mlistfilter.h \
$$WIDGETS_SRC_DIR/mgriditem.h \
$$WIDGETS_SRC_DIR/mmessagebox.h \
$$WIDGETS_SRC_DIR/mnavigationbar.h \
@@ -54,6 +55,10 @@ PUBLIC_HEADERS += \
$$WIDGETS_SRC_DIR/mwidgetrecycler.h \
$$WIDGETS_SRC_DIR/mabstractcellcreator.h \
$$WIDGETS_SRC_DIR/mcontentitem.h \
+ $$WIDGETS_SRC_DIR/mlistitem.h \
+ $$WIDGETS_SRC_DIR/mabstractitemmodel.h \
+ $$WIDGETS_SRC_DIR/msortfilterproxymodel.h \
+ $$WIDGETS_SRC_DIR/mbubbleitem.h \
MGEN_MODEL_HEADERS += \
$$WIDGETS_SRC_DIR/mwidgetmodel.h \
@@ -87,6 +92,8 @@ MGEN_MODEL_HEADERS += \
$$WIDGETS_SRC_DIR/mcontainermodel.h \
$$WIDGETS_SRC_DIR/mcompletermodel.h \
$$WIDGETS_SRC_DIR/mcontentitemmodel.h \
+ $$WIDGETS_SRC_DIR/mlistitemmodel.h \
+ $$WIDGETS_SRC_DIR/mbubbleitemmodel.h \
PUBLIC_HEADERS += \
$$MGEN_MODEL_HEADERS \
@@ -96,6 +103,9 @@ PRIVATE_HEADERS += \
$$WIDGETS_SRC_DIR/mpannableviewportlayout.h \
$$WIDGETS_SRC_DIR/mcontentitem_p.h \
$$WIDGETS_SRC_DIR/mbuttongroup_p.h \
+ $$WIDGETS_SRC_DIR/mlistitem_p.h \
+ $$WIDGETS_SRC_DIR/mabstractitemmodel_p.h \
+ $$WIDGETS_SRC_DIR/mlistfilter_p.h \
SOURCES += \
$$WIDGETS_SRC_DIR/mwidgetmodel.cpp \
@@ -118,6 +128,7 @@ SOURCES += \
$$WIDGETS_SRC_DIR/mlabelmodel.cpp \
$$WIDGETS_SRC_DIR/mlabelhighlighter.cpp \
$$WIDGETS_SRC_DIR/mlist.cpp \
+ $$WIDGETS_SRC_DIR/mlistfilter.cpp \
$$WIDGETS_SRC_DIR/mgriditem.cpp \
$$WIDGETS_SRC_DIR/minfobannermodel.cpp \
$$WIDGETS_SRC_DIR/mapplicationmenu.cpp \
@@ -152,3 +163,8 @@ SOURCES += \
$$WIDGETS_SRC_DIR/mcontentitemmodel.cpp \
$$WIDGETS_SRC_DIR/mlistmodel.cpp \
$$WIDGETS_SRC_DIR/mpopuplistmodel.cpp \
+ $$WIDGETS_SRC_DIR/mlistitem.cpp \
+ $$WIDGETS_SRC_DIR/mabstractitemmodel.cpp \
+ $$WIDGETS_SRC_DIR/msortfilterproxymodel.cpp \
+ $$WIDGETS_SRC_DIR/mbubbleitem.cpp \
+ $$WIDGETS_SRC_DIR/mbubbleitemmodel.cpp \