![]() |
HAL
|
Classes | |
class | NumeratedString |
Enumerations | |
enum | mSortMechanism { lexical = 0 , natural = 1 , numerated = 2 } |
Functions | |
void | ensureOnScreen (QWidget *w) |
(Fully) displays the widget by moving it. More... | |
bool | applyColorStyle (QString &svg_data, const QString &color_style) |
void | changeSvgColor (QString &svg_data, const QColor &from, const QColor &to) |
void | changeAllSvgColors (QString &svg_data, const QColor &to) |
QIcon | getStyledSvgIcon (const QString &from_to_colors_enabled, const QString &svg_path, QString from_to_colors_disabled=QString()) |
Module * | firstCommonAncestor (std::unordered_set< Module * > modules, const std::unordered_set< Gate * > &gates) |
Module * | firstCommonAncestor (Module *m1, Module *m2) |
QSet< u32 > | parentModules (Gate *g) |
QSet< u32 > | parentModules (Module *m) |
Q_ENUM_NS (mSortMechanism) | |
bool | naturalOrderCompare (const QString &a, const QString &b) |
bool | lexicalOrderCompare (const QString &a, const QString &b) |
bool | numeratedOrderCompare (const QString &a, const QString &b) |
int | numericStringCompare (QString a_num, QString b_num) |
int | compare (mSortMechanism mechanism, QString a, QString b) |
Definition at line 24 of file graphics.cpp.
References QRegExp::cap(), Qt::CaseInsensitive, QRegExp::exactMatch(), QRegExp::indexIn(), QString::left(), QString::replace(), QString::right(), QString::simplified(), QString::split(), and QString::toUtf8().
Referenced by getStyledSvgIcon().
Replaces all colors within given svg data to a new specified color.
svg_data | - The svg data as a string (e.g. read from a file) |
to | - The new color. |
Definition at line 18 of file graphics.cpp.
References Qt::CaseInsensitive, QString::replace(), and hal::core_strings::to().
void hal::gui_utility::changeSvgColor | ( | QString & | svg_data, |
const QColor & | from, | ||
const QColor & | to | ||
) |
Replaces a color within given svg data to a new specified color.
svg_data | - The svg data as a string (e.g. read from a file) |
from | - The color to replace. |
to | - The new color. |
Definition at line 12 of file graphics.cpp.
References from, QString::replace(), and hal::core_strings::to().
int hal::gui_utility::compare | ( | mSortMechanism | mechanism, |
QString | a, | ||
QString | b | ||
) |
Compares two strings using a specific comparison criteria.
mechanism | - The criteria by which the 2 strings should be compared with. |
a | - The first string to compare. |
b | - The second string to compare. |
Definition at line 153 of file sort.cpp.
References lexical, lexicalOrderCompare(), natural, naturalOrderCompare(), numerated, and numeratedOrderCompare().
Referenced by hal::ContextProxyModel::lessThan(), hal::GatelibraryProxyModel::lessThan(), hal::GroupingProxyModel::lessThan(), hal::ModuleProxyModel::lessThan(), hal::SelectionTreeProxyModel::lessThan(), hal::GateSelectProxy::lessThan(), and hal::ModuleSelectProxy::lessThan().
Finds the first common ancestor of both modules by first saving every parent module of m1 until it reachs the "final" top module and then going step by step through every immediate parent of m2. The first hit that is found is returned.
m1 | - The first module. |
m2 | - The second module. |
Definition at line 15 of file netlist.cpp.
References hal::Module::get_id(), and hal::Module::get_parent_module().
Module * hal::gui_utility::firstCommonAncestor | ( | std::unordered_set< Module * > | modules, |
const std::unordered_set< Gate * > & | gates | ||
) |
Finds the first common ancestor of a set of modules and gates. The gates are resolved to their corresponding modules and then searching pairwise (all modules with the current first common acestor at the time) for the "real" first common ancestor of all modules.
modules | - The set of modules for which the first common ancestor shall be found. |
gates | - The set of gates for which the first common accestor shall be found. |
Definition at line 34 of file netlist.cpp.
References test_plugin::g, and hal::Module::get_parent_module().
Referenced by hal::NetlistRelay::addToModuleDialog().
QIcon hal::gui_utility::getStyledSvgIcon | ( | const QString & | from_to_colors_enabled, |
const QString & | svg_path, | ||
QString | from_to_colors_disabled = QString() |
||
) |
Reads svg data from a file and styles it (replacing colors) according to a format string. When no styling is necessary, an empty string can be passed. The result is then converted into an icon and returned.
from_to_colors | - The format string in the form "from -> to" (e.g.: "all -> #E4E4E4"). |
svg_path | - The path to the svg file. |
Definition at line 60 of file graphics.cpp.
References applyColorStyle(), file, QString::isEmpty(), QIODevice::ReadOnly, and QString::toUtf8().
Referenced by hal::GatelibraryContentWidget::activate(), hal::CommentWidget::CommentWidget(), hal::ContentFrame::ContentFrame(), hal::ContextManagerWidget::ContextManagerWidget(), hal::ModuleSelectModel::data(), hal::ContextManagerWidget::enableSearchbar(), hal::GroupingManagerWidget::enableSearchbar(), hal::MainWindow::enableUndo(), hal::FileActions::FileActions(), hal::FileSelectWidget::FileSelectWidget(), hal::GateLibrarySelection::GateLibrarySelection(), hal::GeneralInfoWizardPage::GeneralInfoWizardPage(), hal::SelectionDetailsIconProvider::getIcon(), hal::GroupingManagerWidget::GroupingManagerWidget(), hal::GroupingManagerWidget::handleCurrentChanged(), hal::PythonEditor::handleCurrentTabChanged(), hal::SelectionDetailsIconProvider::handleModuleColorChanged(), hal::PythonEditor::handleSearchbarTextEdited(), hal::SelectionDetailsWidget::handleSelectionUpdate(), hal::ImportNetlistDialog::ImportNetlistDialog(), hal::ModuleWidget::ModuleWidget(), hal::NewProjectDialog::NewProjectDialog(), hal::PluginParameterFileDialog::PluginParameterFileDialog(), hal::PluginParameterNodeDialog::PluginParameterNodeDialog(), hal::PythonEditor::PythonEditor(), hal::ExpandingListButton::repolish(), hal::GuiPluginManager::repolish(), hal::GetInTouchItem::repolish(), hal::OpenFileWidget::repolish(), hal::RecentFileItem::repolish(), hal::Searchbar::Searchbar(), hal::SelectionDetailsWidget::SelectionDetailsWidget(), hal::LoggerWidget::setupToolbar(), hal::GatelibraryContentWidget::toggleReadOnlyMode(), hal::GatelibraryContentWidget::toggleSelection(), hal::GuiPluginDelegate::updateQss(), hal::ContextManagerWidget::updateSearchIcon(), hal::ModuleWidget::updateSearchIcon(), and hal::PythonEditor::updateSearchIcon().
Compares two strings by the natural order critera (e.g. z2 < z11).
a | - First string to compare. |
b | - Second string to compare. |
Definition at line 40 of file sort.cpp.
References QString::clear(), QString::constBegin(), QChar::isNull(), QChar::isNumber(), and numericStringCompare().
Referenced by compare().
Compares two strings firstly by their value without any digits. If these parts are the same, the numbers the strings contained are compared.
a | - The first string to compare. |
b | - The second string to compare. |
Definition at line 104 of file sort.cpp.
References QList::at(), hal::gui_utility::NumeratedString::mNumList, hal::gui_utility::NumeratedString::mRemainder, test::n, and QList::size().
Referenced by compare(), and hal::GraphicsModule::ModulePin::operator<().
Compares two string by its (numerical) value. The smaller string is filled with "0"s until it matches the size of the longer string.
a_num | - First string to compare. |
b_num | - second string to compare. |
Definition at line 135 of file sort.cpp.
References QString::compare(), QString::rightJustified(), and QString::size().
Referenced by naturalOrderCompare().
Returns all parent modules for a given gate.
g | - The gate for which all parent modules are required. |
Definition at line 84 of file netlist.cpp.
References test_plugin::g, hal::Module::get_id(), and QSet::insert().
Retirms all parent modules for a given module by iteratively going through every immediate parent module until the top module is reached.
m | - The module for which all parent modules are required. |
Definition at line 73 of file netlist.cpp.
References hal::Module::get_id(), hal::Module::get_parent_module(), and QSet::insert().
hal::gui_utility::Q_ENUM_NS | ( | mSortMechanism | ) |