52
|
1 |
/*
|
|
2 |
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description:
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#include "memspywindowgroupsdetailview.h"
|
|
19 |
#include "viewmanager.h"
|
|
20 |
|
|
21 |
MemSpyWindowGroupsDetailModel::MemSpyWindowGroupsDetailModel(MemSpyWindowGroup* group, QObject *parent) :
|
|
22 |
QAbstractListModel(parent)
|
|
23 |
{
|
|
24 |
mData << (QStringList() << tr("WG ID") << QString("%1").arg(group->id()));
|
|
25 |
mData << (QStringList() << tr("Client ThreadId") << QString("%1").arg(group->threadId()));
|
|
26 |
mData << (QStringList() << tr("Thr") << group->fullName());
|
|
27 |
mData << (QStringList() << tr("Priority") << QString("%1").arg(group->priority()));
|
|
28 |
mData << (QStringList() << tr("Handle") << QString("0x%1").arg(group->windowGroupHandle(), 0, 16));
|
|
29 |
mData << (QStringList() << tr("Name") << group->name());
|
|
30 |
mData << (QStringList() << tr("UID") << QString("%1").arg(group->uid()));
|
|
31 |
mData << (QStringList() << tr("IsBusy") << (group->isBusy() ? tr("Yes") : tr("No")));
|
|
32 |
mData << (QStringList() << tr("IsSystem") << (group->isSystem() ? tr("Yes") : tr("No")));
|
|
33 |
mData << (QStringList() << tr("IsHidden") << (group->isHidden() ? tr("Yes") : tr("No")));
|
|
34 |
mData << (QStringList() << tr("Caption") << group->caption());
|
|
35 |
mData << (QStringList() << tr("Docname") << group->docName());
|
|
36 |
}
|
|
37 |
|
|
38 |
int MemSpyWindowGroupsDetailModel::rowCount(const QModelIndex &parent) const
|
|
39 |
{
|
|
40 |
Q_UNUSED(parent);
|
|
41 |
return mData.count();
|
|
42 |
}
|
|
43 |
|
|
44 |
QVariant MemSpyWindowGroupsDetailModel::data(const QModelIndex &index, int role) const
|
|
45 |
{
|
|
46 |
if (role == Qt::DisplayRole)
|
|
47 |
return mData.at(index.row());
|
|
48 |
|
|
49 |
return QVariant();
|
|
50 |
}
|
|
51 |
|
|
52 |
void MemSpyWindowGroupsDetailView::initialize(const QVariantMap& params)
|
|
53 |
{
|
|
54 |
setTitle(tr("Window Group Detail"));
|
|
55 |
MemSpyView::initialize(params);
|
|
56 |
|
|
57 |
MemSpyWindowGroup* group = static_cast<MemSpyWindowGroup*>(
|
|
58 |
qVariantValue<void*>(params["group"]));
|
|
59 |
|
|
60 |
mModel = new MemSpyWindowGroupsDetailModel(group);
|
|
61 |
mListView.setModel(mModel);
|
|
62 |
}
|