kwave  18.07.70
Kwave::ViewItem Class Reference

#include <ViewItem.h>

Inheritance diagram for Kwave::ViewItem:
Inheritance graph
Collaboration diagram for Kwave::ViewItem:
Collaboration graph

Public Types

enum  Flag { None = 0, CanGrabAndMove = 1, CanDragAndDrop = 2 }
 

Signals

void sigCommand (const QString &command)
 

Public Member Functions

 ViewItem (Kwave::SignalView &view, Kwave::SignalManager &signal_manager)
 
virtual ~ViewItem ()
 
virtual Kwave::ViewItem::Flags flags () const
 
virtual QString toolTip (sample_index_t &ofs)
 
virtual void appendContextMenu (QMenu *parent)
 
virtual QCursor mouseCursor () const
 
virtual void moveTo (const QPoint &mouse_pos)
 
virtual void startDragging ()
 
virtual void done ()
 

Protected Attributes

Kwave::SignalViewm_view
 
Kwave::SignalManagerm_signal_manager
 

Detailed Description

Definition at line 41 of file ViewItem.h.

Member Enumeration Documentation

◆ Flag

Enumerator
None 

no special capabilities

CanGrabAndMove 

can be grabbed and moved

CanDragAndDrop 

can be used for drag and drop

Definition at line 46 of file ViewItem.h.

Constructor & Destructor Documentation

◆ ViewItem()

Kwave::ViewItem::ViewItem ( Kwave::SignalView view,
Kwave::SignalManager signal_manager 
)

Constructor

Parameters
viewpointer to the owner (a SignalView)
signal_managerthe corresponding SignalManager

Definition at line 29 of file ViewItem.cpp.

31  :QObject(&view), m_view(view), m_signal_manager(signal_manager)
32 {
33 }
Kwave::SignalManager & m_signal_manager
Definition: ViewItem.h:119
Kwave::SignalView & m_view
Definition: ViewItem.h:116

◆ ~ViewItem()

Kwave::ViewItem::~ViewItem ( )
virtual

Destructor

Definition at line 36 of file ViewItem.cpp.

37 {
38 }

Member Function Documentation

◆ appendContextMenu()

void Kwave::ViewItem::appendContextMenu ( QMenu *  parent)
virtual

Called to append entries to a context menu. The default implementation does nothing.

Parameters
parentcontext menu to add items

Reimplemented in Kwave::LabelItem.

Definition at line 54 of file ViewItem.cpp.

55 {
56  Q_UNUSED(parent);
57 }

◆ done()

void Kwave::ViewItem::done ( )
virtual

Called when leaving the move or drag mode, when the mouse button has been released or the operation is done.

Reimplemented in Kwave::LabelItem.

Definition at line 77 of file ViewItem.cpp.

78 {
79 }

◆ flags()

Kwave::ViewItem::Flags Kwave::ViewItem::flags ( ) const
virtual

Returns flags describing the possible interactions with this object

See also
Flags

Reimplemented in Kwave::LabelItem, Kwave::SelectionBorderItem, and Kwave::SelectionItem.

Definition at line 41 of file ViewItem.cpp.

References None.

42 {
43  return Kwave::ViewItem::None;
44 }

◆ mouseCursor()

QCursor Kwave::ViewItem::mouseCursor ( ) const
virtual

Returns a mouse cursor used when moving the item

Reimplemented in Kwave::LabelItem, and Kwave::SelectionBorderItem.

Definition at line 60 of file ViewItem.cpp.

61 {
62  return Qt::ArrowCursor;
63 }

◆ moveTo()

void Kwave::ViewItem::moveTo ( const QPoint &  mouse_pos)
virtual

Handles updates when being moved with the mouse.

Parameters
mouse_posposition of the mouse, in pixel coordinates relative to the parent widget

Reimplemented in Kwave::LabelItem, and Kwave::SelectionBorderItem.

Definition at line 66 of file ViewItem.cpp.

67 {
68  Q_UNUSED(mouse_pos);
69 }

◆ sigCommand

void Kwave::ViewItem::sigCommand ( const QString &  command)
signal

forward a sigCommand to the next layer

Referenced by Kwave::LabelItem::contextMenuLabelDelete(), and Kwave::LabelItem::contextMenuLabelProperties().

Here is the caller graph for this function:

◆ startDragging()

void Kwave::ViewItem::startDragging ( )
virtual

Starts a drag & drop operation.

Reimplemented in Kwave::SelectionItem.

Definition at line 72 of file ViewItem.cpp.

73 {
74 }

◆ toolTip()

QString Kwave::ViewItem::toolTip ( sample_index_t ofs)
virtual

Can be overwritten to return a tooltip. The default implementation returns an empty string.

Parameters
ofsabsolute sample index the tooltip should refer to (can be modified)
Returns
an already localized tooltip

Reimplemented in Kwave::LabelItem, and Kwave::SelectionBorderItem.

Definition at line 47 of file ViewItem.cpp.

48 {
49  Q_UNUSED(ofs);
50  return QString();
51 }

Member Data Documentation

◆ m_signal_manager

Kwave::SignalManager& Kwave::ViewItem::m_signal_manager
protected

◆ m_view


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