Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
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>

Inheritance diagram for rviz::SplitterHandle:
Inheritance graph
[legend]

Public Member Functions

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

Protected Member Functions

void mouseDoubleClickEvent (QMouseEvent *event) override
 
void mouseMoveEvent (QMouseEvent *event) override
 
void mousePressEvent (QMouseEvent *event) override
 
void paintEvent (QPaintEvent *event) override
 

Private Member Functions

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

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 44 of file splitter_handle.h.

Constructor & Destructor Documentation

◆ SplitterHandle()

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

Definition at line 42 of file splitter_handle.cpp.

Member Function Documentation

◆ eventFilter()

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

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

Definition at line 51 of file splitter_handle.cpp.

◆ getColor()

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

Definition at line 68 of file splitter_handle.h.

◆ getRatio()

float rviz::SplitterHandle::getRatio ( )

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

Definition at line 103 of file splitter_handle.cpp.

◆ mouseDoubleClickEvent()

void rviz::SplitterHandle::mouseDoubleClickEvent ( QMouseEvent *  event)
overrideprotected

Definition at line 133 of file splitter_handle.cpp.

◆ mouseMoveEvent()

void rviz::SplitterHandle::mouseMoveEvent ( QMouseEvent *  event)
overrideprotected

Definition at line 123 of file splitter_handle.cpp.

◆ mousePressEvent()

void rviz::SplitterHandle::mousePressEvent ( QMouseEvent *  event)
overrideprotected

Definition at line 114 of file splitter_handle.cpp.

◆ paintEvent()

void rviz::SplitterHandle::paintEvent ( QPaintEvent *  event)
overrideprotected

Definition at line 149 of file splitter_handle.cpp.

◆ setColor()

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

Definition at line 63 of file splitter_handle.h.

◆ setDesiredWidth()

void rviz::SplitterHandle::setDesiredWidth ( int  width)

Set desired width of first column - subject to clamping.

Definition at line 108 of file splitter_handle.cpp.

◆ setRatio()

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

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

Definition at line 97 of file splitter_handle.cpp.

◆ updateGeometry()

void rviz::SplitterHandle::updateGeometry ( )
private

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

Definition at line 60 of file splitter_handle.cpp.

Member Data Documentation

◆ color_

QColor rviz::SplitterHandle::color_
private

Definition at line 90 of file splitter_handle.h.

◆ first_column_size_ratio_

float rviz::SplitterHandle::first_column_size_ratio_
private

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

Definition at line 89 of file splitter_handle.h.

◆ parent_

QTreeView* rviz::SplitterHandle::parent_
private

Definition at line 84 of file splitter_handle.h.

◆ x_press_offset_

int rviz::SplitterHandle::x_press_offset_
private

Definition at line 85 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, William Woodall
autogenerated on Fri Dec 13 2024 03:31:04