ACF $AcfVersion:0$
Public Slots | Signals | Public Member Functions | Protected Member Functions | Properties | List of all members
iview::CPopupNavigator Class Reference

2-dimensional scrolling widget. More...

#include <CPopupNavigator.h>

Inheritance diagram for iview::CPopupNavigator:

Public Slots

void enablePanning (bool on=true)
 Sets panning mode to on (true by default).
 

Signals

void scrollHorizontal (int value)
 
void scrollVertical (int value)
 
void aboutToShow ()
 
void wheeled (QWheelEvent *we)
 

Public Member Functions

 CPopupNavigator (QWidget *parent=0)
 Constructor.
 
virtual ~CPopupNavigator ()
 Destructor.
 
void setBackgroundPen (const QPen &pen)
 
QPen backgroundPen () const
 
void setBackgroundBrush (const QBrush &brush)
 
QBrush backgroundBrush () const
 
void setSliderPen (const QPen &pen)
 
QPen sliderPen () const
 
void setSliderBrush (const QBrush &brush)
 
QBrush sliderBrush () const
 
void setOpacity (double opacity)
 
double opacity () const
 
void setSliderOpacity (double opacity)
 
double sliderOpacity () const
 
bool isPanningEnabled () const
 Returns true if mouse panning is enabled (default), false otherwise.
 
void connectSource (QAbstractScrollArea *area)
 
void connectSource (QAbstractSlider *horizontal, QAbstractSlider *vertical)
 
void disconnectSource ()
 
void connectButton (QToolButton *)
 Connects to a tool button which will show this CPopupNavigator as a popup menu.
 
void resetSize (const QSize &size)
 Removes background pixmap (if any) and resets the size of the navigator to size.
 
void resetSize (int width, int height)
 
void setFromPixmap (const QPixmap &pixmap)
 Sets the pixmap to be shown as the background of the navigator.
 
virtual QSize minimumSizeHint () const
 

Protected Member Functions

virtual void paintEvent (QPaintEvent *) override
 
virtual bool eventFilter (QObject *, QEvent *) override
 
virtual void mousePressEvent (QMouseEvent *) override
 
virtual void mouseMoveEvent (QMouseEvent *) override
 
virtual bool event (QEvent *) override
 
virtual void drawBackground (QPainter &p, QRect r)
 
virtual void drawSlider (QPainter &p, QRect r)
 

Properties

double opacity
 
double sliderOpacity
 
bool panning
 
QPen backgroundPen
 
QBrush backgroundBrush
 
QPen sliderPen
 
QBrush sliderBrush
 

Detailed Description

2-dimensional scrolling widget.

Since
0.2
An example of CPopupNavigator

CPopupNavigator is designed for scrolling in both direction (horizontal and vertical) at the same time. Main frame represents the scrollable area, and the slider inside the frame corresponds to the visible part.

Slider is draggable within the frame (panning mode on). This behavior is enabled by default. If you want to disable the panning, use enablePanning(false).

To use CPopupNavigator, attach it to the source widget (which content is to be scrolled) using one of connectSource() methods. Currently QAbstractScrollArea and QAbstractSlider descedants can be handled by CPopupNavigator.

// a QGraphicsView is a descedant of the QAbstractScrollArea
QGraphicsView *myView;
...
// create CPopupNavigator and connect it to the QGraphicsView
CPopupNavigator *myPanner = new CPopupNavigator(this);
myPanner->connectSource(myView);
2-dimensional scrolling widget.

Definition at line 41 of file CPopupNavigator.h.

Constructor & Destructor Documentation

◆ CPopupNavigator()

iview::CPopupNavigator::CPopupNavigator ( QWidget *  parent = 0)
explicit

Constructor.

◆ ~CPopupNavigator()

virtual iview::CPopupNavigator::~CPopupNavigator ( )
virtual

Destructor.

Member Function Documentation

◆ aboutToShow

void iview::CPopupNavigator::aboutToShow ( )
signal

◆ backgroundBrush()

QBrush iview::CPopupNavigator::backgroundBrush ( ) const
inline

Definition at line 63 of file CPopupNavigator.h.

◆ backgroundPen()

QPen iview::CPopupNavigator::backgroundPen ( ) const
inline

Definition at line 60 of file CPopupNavigator.h.

◆ connectButton()

void iview::CPopupNavigator::connectButton ( QToolButton *  )

Connects to a tool button which will show this CPopupNavigator as a popup menu.

◆ connectSource() [1/2]

void iview::CPopupNavigator::connectSource ( QAbstractScrollArea *  area)

◆ connectSource() [2/2]

void iview::CPopupNavigator::connectSource ( QAbstractSlider *  horizontal,
QAbstractSlider *  vertical 
)

◆ disconnectSource()

void iview::CPopupNavigator::disconnectSource ( )

◆ drawBackground()

virtual void iview::CPopupNavigator::drawBackground ( QPainter &  p,
QRect  r 
)
protectedvirtual

◆ drawSlider()

virtual void iview::CPopupNavigator::drawSlider ( QPainter &  p,
QRect  r 
)
protectedvirtual

◆ enablePanning

void iview::CPopupNavigator::enablePanning ( bool  on = true)
slot

Sets panning mode to on (true by default).

When panning is enabled, you can move the slider by the mouse.

◆ event()

virtual bool iview::CPopupNavigator::event ( QEvent *  )
overrideprotectedvirtual

◆ eventFilter()

virtual bool iview::CPopupNavigator::eventFilter ( QObject *  ,
QEvent *   
)
overrideprotectedvirtual

◆ isPanningEnabled()

bool iview::CPopupNavigator::isPanningEnabled ( ) const
inline

Returns true if mouse panning is enabled (default), false otherwise.

See also
enablePanning()

Definition at line 80 of file CPopupNavigator.h.

◆ minimumSizeHint()

virtual QSize iview::CPopupNavigator::minimumSizeHint ( ) const
inlinevirtual

Definition at line 101 of file CPopupNavigator.h.

◆ mouseMoveEvent()

virtual void iview::CPopupNavigator::mouseMoveEvent ( QMouseEvent *  )
overrideprotectedvirtual

◆ mousePressEvent()

virtual void iview::CPopupNavigator::mousePressEvent ( QMouseEvent *  )
overrideprotectedvirtual

◆ opacity()

double iview::CPopupNavigator::opacity ( ) const
inline

Definition at line 72 of file CPopupNavigator.h.

◆ paintEvent()

virtual void iview::CPopupNavigator::paintEvent ( QPaintEvent *  )
overrideprotectedvirtual

◆ resetSize() [1/2]

void iview::CPopupNavigator::resetSize ( const QSize &  size)

Removes background pixmap (if any) and resets the size of the navigator to size.

◆ resetSize() [2/2]

void iview::CPopupNavigator::resetSize ( int  width,
int  height 
)
inline

Definition at line 93 of file CPopupNavigator.h.

References resetSize().

Referenced by resetSize().

◆ scrollHorizontal

void iview::CPopupNavigator::scrollHorizontal ( int  value)
signal

◆ scrollVertical

void iview::CPopupNavigator::scrollVertical ( int  value)
signal

◆ setBackgroundBrush()

void iview::CPopupNavigator::setBackgroundBrush ( const QBrush &  brush)

◆ setBackgroundPen()

void iview::CPopupNavigator::setBackgroundPen ( const QPen &  pen)

◆ setFromPixmap()

void iview::CPopupNavigator::setFromPixmap ( const QPixmap &  pixmap)

Sets the pixmap to be shown as the background of the navigator.

If not set, a default rectangle is drawn.

◆ setOpacity()

void iview::CPopupNavigator::setOpacity ( double  opacity)

◆ setSliderBrush()

void iview::CPopupNavigator::setSliderBrush ( const QBrush &  brush)

◆ setSliderOpacity()

void iview::CPopupNavigator::setSliderOpacity ( double  opacity)

◆ setSliderPen()

void iview::CPopupNavigator::setSliderPen ( const QPen &  pen)

◆ sliderBrush()

QBrush iview::CPopupNavigator::sliderBrush ( ) const
inline

Definition at line 69 of file CPopupNavigator.h.

◆ sliderOpacity()

double iview::CPopupNavigator::sliderOpacity ( ) const
inline

Definition at line 75 of file CPopupNavigator.h.

◆ sliderPen()

QPen iview::CPopupNavigator::sliderPen ( ) const
inline

Definition at line 66 of file CPopupNavigator.h.

◆ wheeled

void iview::CPopupNavigator::wheeled ( QWheelEvent *  we)
signal

Property Documentation

◆ backgroundBrush

QBrush iview::CPopupNavigator::backgroundBrush
readwrite

Definition at line 49 of file CPopupNavigator.h.

◆ backgroundPen

QPen iview::CPopupNavigator::backgroundPen
readwrite

Definition at line 48 of file CPopupNavigator.h.

◆ opacity

double iview::CPopupNavigator::opacity
readwrite

Definition at line 45 of file CPopupNavigator.h.

◆ panning

bool iview::CPopupNavigator::panning
readwrite

Definition at line 47 of file CPopupNavigator.h.

◆ sliderBrush

QBrush iview::CPopupNavigator::sliderBrush
readwrite

Definition at line 51 of file CPopupNavigator.h.

◆ sliderOpacity

double iview::CPopupNavigator::sliderOpacity
readwrite

Definition at line 46 of file CPopupNavigator.h.

◆ sliderPen

QPen iview::CPopupNavigator::sliderPen
readwrite

Definition at line 50 of file CPopupNavigator.h.


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