Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
rviz::SplitterHandle Class Reference

A tall skinny invisible widget providing left-right sliding column separator adjustment for a two-column QTreeView via mouse drags. Shows splitter cursor when mouse hovers over it. Uses event filtering to catch resize events for the parent. More...

#include <splitter_handle.h>

List of all members.

Public Member Functions

bool eventFilter (QObject *event_target, QEvent *event)
 Catch resize events sent to parent to update splitter's geometry. Always returns false.
QColor getColor () const
float getRatio ()
 Get the ratio of the parent's left column to the parent widget width.
void setColor (QColor color)
void setRatio (float ratio)
 Set the ratio of the parent's left column to the parent widget width.
 SplitterHandle (QTreeView *parent=0)

Protected Member Functions

virtual void mouseMoveEvent (QMouseEvent *event)
virtual void mousePressEvent (QMouseEvent *event)
virtual void paintEvent (QPaintEvent *event)

Private Member Functions

void updateGeometry ()
 Update the parent's column widths and this splitter's geometry based on first_column_size_ratio_.

Private Attributes

QColor color_
float first_column_size_ratio_
QTreeView * parent_
int x_press_offset_

Detailed Description

A tall skinny invisible widget providing left-right sliding column separator adjustment for a two-column QTreeView via mouse drags. Shows splitter cursor when mouse hovers over it. Uses event filtering to catch resize events for the parent.

Definition at line 43 of file splitter_handle.h.


Constructor & Destructor Documentation

rviz::SplitterHandle::SplitterHandle ( QTreeView *  parent = 0)

Definition at line 41 of file splitter_handle.cpp.


Member Function Documentation

bool rviz::SplitterHandle::eventFilter ( QObject *  event_target,
QEvent *  event 
)

Catch resize events sent to parent to update splitter's geometry. Always returns false.

Definition at line 53 of file splitter_handle.cpp.

QColor rviz::SplitterHandle::getColor ( ) const [inline]

Definition at line 60 of file splitter_handle.h.

Get the ratio of the parent's left column to the parent widget width.

Definition at line 77 of file splitter_handle.cpp.

void rviz::SplitterHandle::mouseMoveEvent ( QMouseEvent *  event) [protected, virtual]

Definition at line 90 of file splitter_handle.cpp.

void rviz::SplitterHandle::mousePressEvent ( QMouseEvent *  event) [protected, virtual]

Definition at line 82 of file splitter_handle.cpp.

void rviz::SplitterHandle::paintEvent ( QPaintEvent *  event) [protected, virtual]

Definition at line 119 of file splitter_handle.cpp.

void rviz::SplitterHandle::setColor ( QColor  color) [inline]

Definition at line 59 of file splitter_handle.h.

void rviz::SplitterHandle::setRatio ( float  ratio)

Set the ratio of the parent's left column to the parent widget width.

Definition at line 71 of file splitter_handle.cpp.

Update the parent's column widths and this splitter's geometry based on first_column_size_ratio_.

Definition at line 62 of file splitter_handle.cpp.


Member Data Documentation

QColor rviz::SplitterHandle::color_ [private]

Definition at line 78 of file splitter_handle.h.

The ratio of the first column width to the entire widget width. Preserved during parent widget resize.

Definition at line 77 of file splitter_handle.h.

QTreeView* rviz::SplitterHandle::parent_ [private]

Definition at line 72 of file splitter_handle.h.

Definition at line 73 of file splitter_handle.h.


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


rviz
Author(s): Dave Hershberger, David Gossow, Josh Faust
autogenerated on Mon Oct 6 2014 07:26:37