OpenMS  2.8.0
Public Member Functions | Private Slots | List of all members
TreeView Class Reference

A better QTreeWidget for TOPPView, which supports header context menu and conveniently adding/getting headers names. More...

#include <OpenMS/VISUAL/TreeView.h>

Inheritance diagram for TreeView:
[legend]
Collaboration diagram for TreeView:
[legend]

Public Member Functions

 TreeView (QWidget *parent=nullptr)
 Constructor. More...
 
 ~TreeView () override=default
 Destructor. More...
 
void setHeaders (const QStringList &headers)
 sets the visible headers (and the number of columns) More...
 
void hideColumns (const QStringList &header_names)
 
QStringList getHeaderNames (const WidgetHeader which) const
 Obtain header names, either from all, or only the visible columns. More...
 
QString getHeaderName (const int header_column) const
 

Private Slots

void headerContextMenu_ (const QPoint &pos)
 Display header context menu; allows to show/hide columns. More...
 

Detailed Description

A better QTreeWidget for TOPPView, which supports header context menu and conveniently adding/getting headers names.

Constructor & Destructor Documentation

◆ TreeView()

TreeView ( QWidget parent = nullptr)

Constructor.

◆ ~TreeView()

~TreeView ( )
overridedefault

Destructor.

Member Function Documentation

◆ getHeaderName()

QString getHeaderName ( const int  header_column) const

get the displayed name of the header in column with index header_column

Exceptions
Exception::ElementNotFoundif header at index header_column is not valid

◆ getHeaderNames()

QStringList getHeaderNames ( const WidgetHeader  which) const

Obtain header names, either from all, or only the visible columns.

Parameters
whichWith or without invisible columns?
Returns
List of header names

◆ headerContextMenu_

void headerContextMenu_ ( const QPoint &  pos)
privateslot

Display header context menu; allows to show/hide columns.

◆ hideColumns()

void hideColumns ( const QStringList &  header_names)

hides columns with the given names

Exceptions
Exception::InvalidParameterif a name is not matching the current column names

◆ setHeaders()

void setHeaders ( const QStringList &  headers)

sets the visible headers (and the number of columns)