NDEVR
API Documentation
DevActionTree.h
1#pragma once
2#include <NDEVR/QCustomTreeWidget.h>
3#include <NDEVR/BuildAction.h>
4namespace NDEVR
5{
9 {
10 public:
13 DevActionTree(QWidget* parent = nullptr)
14 : QCustomTreeWidget(parent)
15 {
16 init();
17 }
18
21 {
23 Buffer<BuildAction> actions;
24 for (const String& id : ids)
25 {
26 actions.add(id.getAs< BuildAction>());
27 }
28 return actions;
29 }
30 protected:
32 void init()
33 {
37 for (const TranslatedString& category : categories)
38 {
39 items[category] = nodes.size();
40 QCustomTreeNode node;
41 node.title = category;
42 nodes.add(node);
43 }
44 for (uint04 i = 0; i < cast<uint04>(BuildAction::e_invalid); i++)
45 {
48 continue;
49 uint04 index = items.get(BuildActionDefines::Category(action));
50 QCustomTreeNode node;
51 node.title = String::DisplayString(action);
52 node.icon = BuildActionDefines::Icon(action);
53 node.id = String(action);
54 nodes[index].children.add(node);
55 }
56 setup(nodes);
57 }
58 };
59}
The equivelent of std::vector but with a bit more control.
Definition Buffer.hpp:58
void add(t_type &&object)
Adds object to the end of the buffer.
Definition Buffer.hpp:190
static bool IsSupported(const BuildAction &action)
Checks whether a given build action is supported on this platform.
static Buffer< TranslatedString > Categories()
Returns all build action category names.
static TranslatedString Category(BuildAction action)
Returns the category name for the given build action.
static StringView Icon(BuildAction action)
Returns the icon resource name for the given build action.
void init()
Populates the tree with build action categories and their child actions.
Buffer< BuildAction > selectedActions() const
Returns the currently selected build actions.
DevActionTree(QWidget *parent=nullptr)
Constructs the action tree and populates it with all supported build actions.
A hash-based key-value store, useful for quick associative lookups.
Definition Dictionary.h:64
const t_value & get(const t_key_type &key) const
Retrieves a const reference to the value associated with the given key.
Definition Dictionary.h:124
Represents a single node in a tree structure, containing a title, ID, icon, and any child nodes.
String icon
The icon resource name for the tree node.
String id
The unique identifier for the tree node.
TranslatedString title
The display title of the tree node.
void setup(const Buffer< QCustomTreeNode > &children)
Sets up the tree with the given root-level nodes and their children.
Buffer< String > selectedIDs() const
Returns the IDs of all currently selected tree items.
QCustomTreeWidget(QWidget *parent=nullptr)
Constructs a tree widget.
The core String class for the NDEVR API.
Definition String.h:95
static TranslatedString DisplayString(const t_type &value)
Converts an object into a TranslatedString.
Any text displayed to the user should be defined as a TranslatedString which allows the program to lo...
The primary namespace for the NDEVR SDK.
BuildAction
Enumerates all supported build action types available in the Developer module build workflow system.
@ e_invalid
Sentinel value indicating no valid action.
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
@ category
The category this object belongs to.
constexpr t_to cast(const Angle< t_from > &value)
Casts an Angle from one backing type to another.
Definition Angle.h:408