labplot  2.8.2
About: LabPlot is an application for plotting and analysis of 2D and 3D functions and data. It is a complete rewrite of LabPlot1 and lacks in the first release a lot of features available in the predecessor. On the other hand, the GUI and the usability is more superior.
  Fossies Dox: labplot-2.8.2.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

TreeViewComboBox Class Reference

Provides a QTreeView in a QComboBox. More...

#include <TreeViewComboBox.h>

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

Signals

void currentModelIndexChanged (const QModelIndex &)
 

Public Member Functions

 TreeViewComboBox (QWidget *parent=nullptr)
 
void setModel (QAbstractItemModel *)
 
void setCurrentModelIndex (const QModelIndex &)
 
QModelIndex currentModelIndex () const
 
void setTopLevelClasses (const QList< AspectType > &)
 
void setHiddenAspects (const QList< const AbstractAspect * > &)
 
void showPopup () override
 
void hidePopup () override
 
void setInvalid (bool invalid, const QString &tooltip=QString())
 
void useCurrentIndexText (const bool set)
 
QString currentText () const
 
void setText (const QString &text)
 

Private Slots

void treeViewIndexActivated (const QModelIndex &)
 
void filterChanged (const QString &)
 

Private Member Functions

void showTopLevelOnly (const QModelIndex &)
 
bool eventFilter (QObject *, QEvent *) override
 
bool filter (const QModelIndex &, const QString &)
 
bool isTopLevel (const AbstractAspect *) const
 
bool isHidden (const AbstractAspect *) const
 
void paintEvent (QPaintEvent *) override
 

Private Attributes

QTreeView * m_treeView
 
QGroupBox * m_groupBox
 
QLineEdit * m_lineEdit
 
QString m_lineEditText {""}
 
bool m_useCurrentIndexText {true}
 
QList< AspectTypem_topLevelClasses
 
QList< const char * > m_selectableClasses
 
QList< const AbstractAspect * > m_hiddenAspects
 

Detailed Description

Provides a QTreeView in a QComboBox.

File : TreeViewComboBox.cpp Project : LabPlot

Description : Provides a QTreeView in a QComboBox

Copyright : (C) 2008-2016 by Alexander Semke (alexa.nosp@m.nder.nosp@m..semk.nosp@m.e@we.nosp@m.b.de) Copyright : (C) 2008 Tilman Benkert (thzs@.nosp@m.gmx..nosp@m.net)

  • This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. *
  • This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. *
  • You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA *

/

Definition at line 41 of file TreeViewComboBox.h.

Constructor & Destructor Documentation

◆ TreeViewComboBox()

TreeViewComboBox::TreeViewComboBox ( QWidget *  parent = nullptr)
explicit

Member Function Documentation

◆ currentModelIndex()

◆ currentModelIndexChanged

◆ currentText()

QString TreeViewComboBox::currentText ( ) const

Definition at line 188 of file TreeViewComboBox.cpp.

References currentModelIndex(), m_lineEditText, and m_useCurrentIndexText.

Referenced by paintEvent().

◆ eventFilter()

bool TreeViewComboBox::eventFilter ( QObject *  object,
QEvent *  event 
)
overrideprivate

catches the MouseButtonPress-event and hides the tree view on mouse clicking.

Definition at line 230 of file TreeViewComboBox.cpp.

References m_groupBox.

◆ filter()

bool TreeViewComboBox::filter ( const QModelIndex &  index,
const QString &  text 
)
private

Definition at line 261 of file TreeViewComboBox.cpp.

References isHidden(), isTopLevel(), and m_treeView.

Referenced by filterChanged().

◆ filterChanged

void TreeViewComboBox::filterChanged ( const QString &  text)
privateslot

Definition at line 256 of file TreeViewComboBox.cpp.

References filter(), and m_treeView.

Referenced by TreeViewComboBox().

◆ hidePopup()

void TreeViewComboBox::hidePopup ( )
override

Definition at line 166 of file TreeViewComboBox.cpp.

References m_groupBox.

Referenced by XYIntegrationCurveDock::yDataColumnChanged().

◆ isHidden()

bool TreeViewComboBox::isHidden ( const AbstractAspect aspect) const
private

Definition at line 309 of file TreeViewComboBox.cpp.

References m_hiddenAspects.

Referenced by filter(), and showTopLevelOnly().

◆ isTopLevel()

bool TreeViewComboBox::isTopLevel ( const AbstractAspect aspect) const
private

checks whether aspect is one of the allowed top level types

Definition at line 297 of file TreeViewComboBox.cpp.

References AbstractAspect::inherits(), m_topLevelClasses, asan_symbolize::type, AbstractAspect::type(), and XYAnalysisCurve.

Referenced by filter(), and showTopLevelOnly().

◆ paintEvent()

void TreeViewComboBox::paintEvent ( QPaintEvent *  )
overrideprivate

\reimp TODO: why do I have to reimplement paintEvent. It should work also without

Definition at line 153 of file TreeViewComboBox.cpp.

References currentText(), and Origin::Text.

◆ setCurrentModelIndex()

◆ setHiddenAspects()

◆ setInvalid()

void TreeViewComboBox::setInvalid ( bool  invalid,
const QString &  tooltip = QString() 
)

Definition at line 203 of file TreeViewComboBox.cpp.

Referenced by XYCurveDock::checkColumnAvailability(), XYCurveDock::curveXColumnChanged(), XYCurveDock::curveYColumnChanged(), XYFitCurveDock::enableRecalculate(), XYConvolutionCurveDock::enableRecalculate(), XYCorrelationCurveDock::enableRecalculate(), XYDataReductionCurveDock::enableRecalculate(), XYDifferentiationCurveDock::enableRecalculate(), XYFourierFilterCurveDock::enableRecalculate(), XYFourierTransformCurveDock::enableRecalculate(), XYIntegrationCurveDock::enableRecalculate(), XYInterpolationCurveDock::enableRecalculate(), XYSmoothCurveDock::enableRecalculate(), XYCurveDock::setModel(), XYConvolutionCurveDock::xDataColumnChanged(), XYCorrelationCurveDock::xDataColumnChanged(), XYDataReductionCurveDock::xDataColumnChanged(), XYDifferentiationCurveDock::xDataColumnChanged(), XYFitCurveDock::xDataColumnChanged(), XYFourierFilterCurveDock::xDataColumnChanged(), XYFourierTransformCurveDock::xDataColumnChanged(), XYIntegrationCurveDock::xDataColumnChanged(), XYInterpolationCurveDock::xDataColumnChanged(), XYSmoothCurveDock::xDataColumnChanged(), XYFitCurveDock::xErrorColumnChanged(), XYConvolutionCurveDock::y2DataColumnChanged(), XYCorrelationCurveDock::y2DataColumnChanged(), XYConvolutionCurveDock::yDataColumnChanged(), XYCorrelationCurveDock::yDataColumnChanged(), XYDataReductionCurveDock::yDataColumnChanged(), XYDifferentiationCurveDock::yDataColumnChanged(), XYFitCurveDock::yDataColumnChanged(), XYFourierFilterCurveDock::yDataColumnChanged(), XYFourierTransformCurveDock::yDataColumnChanged(), XYIntegrationCurveDock::yDataColumnChanged(), XYInterpolationCurveDock::yDataColumnChanged(), XYSmoothCurveDock::yDataColumnChanged(), and XYFitCurveDock::yErrorColumnChanged().

◆ setModel()

◆ setText()

void TreeViewComboBox::setText ( const QString &  text)

Definition at line 199 of file TreeViewComboBox.cpp.

References m_lineEditText.

Referenced by XYCurveDock::checkColumnAvailability(), and XYCurveDock::setModel().

◆ setTopLevelClasses()

◆ showPopup()

void TreeViewComboBox::showPopup ( )
override

Displays the tree view of items in the combobox. Triggers showTopLevelOnly() to show toplevel items only.

Definition at line 133 of file TreeViewComboBox.cpp.

References m_groupBox, m_lineEdit, m_lineEditText, m_treeView, and showTopLevelOnly().

◆ showTopLevelOnly()

void TreeViewComboBox::showTopLevelOnly ( const QModelIndex &  index)
private

Hides the non-toplevel items of the model used in the tree view.

Definition at line 217 of file TreeViewComboBox.cpp.

References isHidden(), isTopLevel(), and m_treeView.

Referenced by showPopup().

◆ treeViewIndexActivated

void TreeViewComboBox::treeViewIndexActivated ( const QModelIndex &  index)
privateslot

Definition at line 240 of file TreeViewComboBox.cpp.

References currentModelIndexChanged(), m_groupBox, and m_treeView.

Referenced by TreeViewComboBox().

◆ useCurrentIndexText()

void TreeViewComboBox::useCurrentIndexText ( const bool  set)

Definition at line 171 of file TreeViewComboBox.cpp.

References m_useCurrentIndexText.

Referenced by XYCurveDock::checkColumnAvailability(), XYCurveDock::curveXColumnChanged(), XYCurveDock::curveYColumnChanged(), XYFitCurveDock::enableRecalculate(), XYConvolutionCurveDock::enableRecalculate(), XYCorrelationCurveDock::enableRecalculate(), XYDataReductionCurveDock::enableRecalculate(), XYDifferentiationCurveDock::enableRecalculate(), XYFourierFilterCurveDock::enableRecalculate(), XYFourierTransformCurveDock::enableRecalculate(), XYIntegrationCurveDock::enableRecalculate(), XYInterpolationCurveDock::enableRecalculate(), XYSmoothCurveDock::enableRecalculate(), XYCurveDock::setupGeneral(), XYConvolutionCurveDock::xDataColumnChanged(), XYCorrelationCurveDock::xDataColumnChanged(), XYDataReductionCurveDock::xDataColumnChanged(), XYDifferentiationCurveDock::xDataColumnChanged(), XYFitCurveDock::xDataColumnChanged(), XYFourierFilterCurveDock::xDataColumnChanged(), XYFourierTransformCurveDock::xDataColumnChanged(), XYIntegrationCurveDock::xDataColumnChanged(), XYInterpolationCurveDock::xDataColumnChanged(), XYSmoothCurveDock::xDataColumnChanged(), XYFitCurveDock::xErrorColumnChanged(), XYConvolutionCurveDock::y2DataColumnChanged(), XYCorrelationCurveDock::y2DataColumnChanged(), XYConvolutionCurveDock::yDataColumnChanged(), XYCorrelationCurveDock::yDataColumnChanged(), XYDataReductionCurveDock::yDataColumnChanged(), XYDifferentiationCurveDock::yDataColumnChanged(), XYFitCurveDock::yDataColumnChanged(), XYFourierFilterCurveDock::yDataColumnChanged(), XYFourierTransformCurveDock::yDataColumnChanged(), XYIntegrationCurveDock::yDataColumnChanged(), XYInterpolationCurveDock::yDataColumnChanged(), XYSmoothCurveDock::yDataColumnChanged(), and XYFitCurveDock::yErrorColumnChanged().

Member Data Documentation

◆ m_groupBox

QGroupBox* TreeViewComboBox::m_groupBox
private

◆ m_hiddenAspects

QList<const AbstractAspect*> TreeViewComboBox::m_hiddenAspects
private

Definition at line 72 of file TreeViewComboBox.h.

Referenced by isHidden(), and setHiddenAspects().

◆ m_lineEdit

QLineEdit* TreeViewComboBox::m_lineEdit
private

Definition at line 66 of file TreeViewComboBox.h.

Referenced by showPopup(), and TreeViewComboBox().

◆ m_lineEditText

QString TreeViewComboBox::m_lineEditText {""}
private

Definition at line 67 of file TreeViewComboBox.h.

Referenced by currentText(), setModel(), setText(), showPopup(), and TreeViewComboBox().

◆ m_selectableClasses

QList<const char*> TreeViewComboBox::m_selectableClasses
private

Definition at line 71 of file TreeViewComboBox.h.

◆ m_topLevelClasses

QList<AspectType> TreeViewComboBox::m_topLevelClasses
private

Definition at line 70 of file TreeViewComboBox.h.

Referenced by isTopLevel(), and setTopLevelClasses().

◆ m_treeView

QTreeView* TreeViewComboBox::m_treeView
private

◆ m_useCurrentIndexText

bool TreeViewComboBox::m_useCurrentIndexText {true}
private

Definition at line 68 of file TreeViewComboBox.h.

Referenced by currentText(), and useCurrentIndexText().


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