SILICON
Loading...
Searching...
No Matches
uiUtils.hpp
Go to the documentation of this file.
1/*
2 Copyright (c) 2026. Giulio Cocconi
3
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
8 */
9
10#pragma once
11
12#include <QIcon>
13#include <QObject>
14#include <QString>
15
18
19class QAction;
20
21namespace SILICON::ui {
22
25QAction* makeAction(QObject* parent, const QIcon& icon, const QString& text,
26 const QString& statusTip = {});
27QAction* makeAction(QObject* parent, const QString& text,
28 const QString& statusTip = {});
29
31{
34 return QObject::tr("Architecture File");
35 switch (type) {
36 case SILICON::project::DocumentType::Circuit: return QObject::tr("Circuit");
37 case SILICON::project::DocumentType::Verilog: return QObject::tr("Verilog File");
38 case SILICON::project::DocumentType::RawBinary: return QObject::tr("Binary File");
39 default: return {};
40 }
41}
42
43} // namespace SILICON::ui
constexpr DocumentCategory categoryOf(const DocumentType type)
QAction * makeAction(QObject *parent, const QIcon &icon, const QString &text, const QString &statusTip)
Definition uiUtils.cpp:38
QIcon categoryIcon(const SILICON::project::DocumentType type)
Definition uiUtils.cpp:26
QString interactionModeName(const InteractionMode mode)
Definition uiUtils.cpp:12
QString documentTypeName(SILICON::project::DocumentType type)
Definition uiUtils.hpp:30
DiagramScene::InteractionMode InteractionMode
Alias for DiagramScene::InteractionMode.