GraphTool  1.0
Tool for analyzing and graphically visualizing code dependencies for Ericsson.
 All Classes Namespaces Functions Variables Typedefs Enumerations Pages
Public Slots | Signals | Public Member Functions | Protected Attributes | List of all members
FilterMenu Class Reference

#include <filter_menu.h>

Inheritance diagram for FilterMenu:
Inheritance graph
[legend]
Collaboration diagram for FilterMenu:
Collaboration graph
[legend]

Public Slots

void change_state_of_all_filters (bool state)
 
void reset ()
 
void update (const QModelIndex &start, const QModelIndex &end)
 
void insert (const QModelIndex &parent, int start, int end, bool updated=false)
 
void remove (const QModelIndex &parent, int start, int end)
 
void resetAllFilters ()
 
void resetFilter ()
 
void onContextMenu (const QPoint &point)
 
void create_menu_action (QAction *action)
 

Signals

void filtersReset ()
 
void filterRemoved (std::string filter_name)
 
void filterUpdated (std::string name, std::string type, bool hide, bool inverted, bool enabled, std::string color, std::string opacity, std::map< std::string, std::string > params, bool last)
 
void filterInserted (std::string name, std::string type, bool hide, bool inverted, bool enabled, std::string color, std::string opacity, std::map< std::string, std::string > params, bool last)
 

Public Member Functions

 FilterMenu (bool formatting_properties=false, QWidget *parent=0)
 
void setModel (QStandardItemModel *model)
 
QStandardItemModel * model ()
 
void add_filters (QList< QList< QStandardItem * > > *filters)
 
QList< QList< QStandardItem * > > * get_filters ()
 
void create_new_filter (QString filter_type)
 

Protected Attributes

QStandardItemModel * model_
 Internal model.
 

Detailed Description

This class binds the FilterMenu UI-components with the logic provided in MainWindow and MainController. The Filter Menu is used to create/remove/edit/enable/disable filters.

The main functionality is currently implemented as a right click menu.

Constructor & Destructor Documentation

FilterMenu::FilterMenu ( bool  formatting_properties = false,
QWidget *  parent = 0 
)

Main constructor for the FilterMenu

Parameters
formatting_propertiesSet to false if filter, true if conditional formatting
parentSet parent widget

Member Function Documentation

void FilterMenu::add_filters ( QList< QList< QStandardItem * > > *  filters)

Add filters to the FilterMenu

Parameters
filtersThe filters to be added to the FilterMenu
void FilterMenu::change_state_of_all_filters ( bool  state)
slot

Slot used by the signal coming from the custom header checkbox to adjust the states of all filters in the FilterMenu

Parameters
stateTrue if to enable all filters, false if to disable all filters
void FilterMenu::create_menu_action ( QAction *  action)
slot

Slot which runs the action ordered by the user from the right click menu

Parameters
actionThe action to be executed
void FilterMenu::create_new_filter ( QString  filter_type)

Method for launching the create filter flow

Parameters
filter_type
void FilterMenu::filterInserted ( std::string  name,
std::string  type,
bool  hide,
bool  inverted,
bool  enabled,
std::string  color,
std::string  opacity,
std::map< std::string, std::string >  params,
bool  last 
)
signal

Signal for adding filters to the MainController

Parameters
nameName of the filter
typeType of filter(dependency_degree, regex, run_block, lpm_ldm, diff_filter)
hideTrue to hide nodes, false not to hide nodes
invertedTrue if exclude, false if include
enabledTrue if enabled, false if disabled
colorCan be colors such as green, silver, black, red
opacityValue between 0 and 255
paramsParameters used by the different filters(min/max for dependency degree for example)
lastTrue if last filter to be applied by the MainController, false if not
void FilterMenu::filterRemoved ( std::string  filter_name)
signal

Signal for removing specific filter from the MainController

Parameters
filter_nameName of the filter
void FilterMenu::filtersReset ( )
signal

Signal for resetting(removing) all filters from the MainController

void FilterMenu::filterUpdated ( std::string  name,
std::string  type,
bool  hide,
bool  inverted,
bool  enabled,
std::string  color,
std::string  opacity,
std::map< std::string, std::string >  params,
bool  last 
)
signal

Signal for updating filters in the MainController

Parameters
nameName of the filter
typeType of filter(dependency_degree, regex, run_block, lpm_ldm, diff_filter)
hideTrue to hide nodes, false not to hide nodes
invertedTrue if exclude, false if include
enabledTrue if enabled, false if disabled
colorCan be colors such as green, silver, black, red
opacityValue between 0 and 255
paramsParameters used by the different filters(min/max for dependency degree for example)
lastTrue if last filter to be applied by the MainController, false if not
QList< QList< QStandardItem * > > * FilterMenu::get_filters ( )

Get the filters used by the FilterMenu

Returns
A QList of all the rows in the FilterMenu
void FilterMenu::insert ( const QModelIndex &  parent,
int  start,
int  end,
bool  updated = false 
)
slot

Slot used to insert new rows in the tree view(connected to the rowsInserted() signal coming from the model)

Parameters
parentIndex of parent
startFrom where to insert new rows
endStop inserting new rows here
updatedTrue if edited row, false if new
QStandardItemModel * FilterMenu::model ( )

Get the model used for the FilterMenu

Returns
A pointer to the QStandardItemModel used by the FilterMenu
void FilterMenu::onContextMenu ( const QPoint &  point)
slot

Slot which creates the right click menu in the FilterMenu

Parameters
pointThe point where the right click occurred
void FilterMenu::remove ( const QModelIndex &  parent,
int  start,
int  end 
)
slot

Slot used to remove new rows in the tree view(connected to the rowsAboutToBeRemoved() signal coming from the model)

Parameters
indexIndex of parent
startFrom where to start removing rows
endTo where the removal of rows should stop
void FilterMenu::reset ( )
slot

Slot connected to the modelAboutToBeReset() signal from the model which in turn signals the MainController about the resetted model

void FilterMenu::resetAllFilters ( )
slot

Slot used to reset(remove) all filters in the FilterMenu

void FilterMenu::resetFilter ( )
slot

Slot used to reset(remove) specific filter in the FilterMenu

void FilterMenu::setModel ( QStandardItemModel *  model)

Set the model used for the FilterMenu

Parameters
modelA pointer to a QStandardItemModel used for the filters
void FilterMenu::update ( const QModelIndex &  start,
const QModelIndex &  end 
)
slot

Slot used to alter values for rows in the treeview(connected to the dataChanged() signal coming from the model)

Parameters
startFrom which cell to start the update
endTo which cell to end the update

The documentation for this class was generated from the following files: