14bbbdcb |
1 | // Created on: 2017-06-16 |
2 | // Created by: Natalia ERMOLAEVA |
3 | // Copyright (c) 2017 OPEN CASCADE SAS |
4 | // |
5 | // This file is part of Open CASCADE Technology software library. |
6 | // |
7 | // This library is free software; you can redistribute it and/or modify it under |
8 | // the terms of the GNU Lesser General Public License version 2.1 as published |
9 | // by the Free Software Foundation, with special exception defined in the file |
10 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
11 | // distribution for complete text of the license and disclaimer of any warranty. |
12 | // |
13 | // Alternatively, this file may be used under the terms of Open CASCADE |
14 | // commercial license or contractual agreement. |
15 | |
0cb512c0 |
16 | #include <inspector/DFBrowser_ItemApplication.hxx> |
14bbbdcb |
17 | |
0cb512c0 |
18 | #include <inspector/DFBrowser_Item.hxx> |
19 | #include <inspector/DFBrowser_ItemDocument.hxx> |
20 | #include <inspector/DFBrowser_Module.hxx> |
21 | #include <inspector/DFBrowser_Tools.hxx> |
14bbbdcb |
22 | |
0cb512c0 |
23 | #include <inspector/DFBrowserPane_AttributePane.hxx> |
24 | #include <inspector/DFBrowserPane_ItemRole.hxx> |
14bbbdcb |
25 | |
26 | #include <QObject> |
27 | |
14bbbdcb |
28 | // ======================================================================= |
29 | // function : createChild |
30 | // purpose : |
31 | // ======================================================================= |
32 | TreeModel_ItemBasePtr DFBrowser_ItemApplication::createChild (int theRow, int theColumn) |
33 | { |
34 | TreeModel_ItemBasePtr anItem = DFBrowser_ItemDocument::CreateItem (currentItem(), theRow, theColumn); |
35 | DFBrowser_ItemBasePtr aBaseItem = itemDynamicCast<DFBrowser_ItemBase> (anItem); |
36 | aBaseItem->SetModule (GetModule()); |
37 | |
38 | return anItem; |
39 | } |
40 | |
41 | // ======================================================================= |
42 | // function : initRowCount |
43 | // purpose : |
44 | // ======================================================================= |
45 | int DFBrowser_ItemApplication::initRowCount() const |
46 | { |
47 | if (myApplication.IsNull()) |
48 | return 0; |
49 | |
50 | return myApplication->NbDocuments(); |
51 | } |
52 | |
53 | // ======================================================================= |
54 | // function : initValue |
55 | // purpose : |
56 | // ======================================================================= |
57 | QVariant DFBrowser_ItemApplication::initValue (const int theItemRole) const |
58 | { |
59 | if (theItemRole == Qt::DisplayRole || |
60 | theItemRole == Qt::EditRole || |
61 | theItemRole == Qt::ToolTipRole || |
62 | theItemRole == DFBrowserPane_ItemRole_DisplayExtended || |
63 | theItemRole == DFBrowserPane_ItemRole_ToolTipExtended) |
64 | { |
65 | return "TDocStd_Application"; |
66 | } |
67 | return QVariant(); |
68 | } |