kwave
18.07.70
|
#include <LabelItem.h>
Public Member Functions | |
LabelItem (Kwave::SignalView &view, Kwave::SignalManager &signal_manager, unsigned int index, const Kwave::Label &label) | |
virtual | ~LabelItem () Q_DECL_OVERRIDE |
virtual Kwave::ViewItem::Flags | flags () const Q_DECL_OVERRIDE |
virtual QString | toolTip (sample_index_t &ofs) Q_DECL_OVERRIDE |
virtual void | appendContextMenu (QMenu *parent) Q_DECL_OVERRIDE |
virtual QCursor | mouseCursor () const Q_DECL_OVERRIDE |
virtual void | moveTo (const QPoint &mouse_pos) Q_DECL_OVERRIDE |
virtual void | done () Q_DECL_OVERRIDE |
![]() | |
ViewItem (Kwave::SignalView &view, Kwave::SignalManager &signal_manager) | |
virtual | ~ViewItem () |
virtual void | startDragging () |
Private Slots | |
void | contextMenuLabelDelete () |
void | contextMenuLabelProperties () |
Private Attributes | |
unsigned int | m_index |
sample_index_t | m_initial_pos |
sample_index_t | m_current_pos |
QString | m_description |
Kwave::UndoTransactionGuard * | m_undo_transaction |
Additional Inherited Members | |
![]() | |
enum | Flag { None = 0, CanGrabAndMove = 1, CanDragAndDrop = 2 } |
![]() | |
void | sigCommand (const QString &command) |
![]() | |
Kwave::SignalView & | m_view |
Kwave::SignalManager & | m_signal_manager |
Definition at line 39 of file LabelItem.h.
Kwave::LabelItem::LabelItem | ( | Kwave::SignalView & | view, |
Kwave::SignalManager & | signal_manager, | ||
unsigned int | index, | ||
const Kwave::Label & | label | ||
) |
Constructor
view | the owner (SignalView) |
signal_manager | the corresponding SignalManager |
index | the one-based index of the label |
label | reference to the label |
Definition at line 37 of file LabelItem.cpp.
|
virtual |
Destructor
Definition at line 51 of file LabelItem.cpp.
References Kwave::UndoTransactionGuard::abort(), and m_undo_transaction.
|
virtual |
Called to append entries to a context menu.
parent | context menu to add items |
Reimplemented from Kwave::ViewItem.
Definition at line 86 of file LabelItem.cpp.
References _, contextMenuLabelDelete(), and contextMenuLabelProperties().
|
privateslot |
context menu: "label / delete"
Definition at line 127 of file LabelItem.cpp.
References _, m_index, and Kwave::ViewItem::sigCommand().
Referenced by appendContextMenu().
|
privateslot |
context menu: "label / properties..."
Definition at line 133 of file LabelItem.cpp.
References _, m_index, and Kwave::ViewItem::sigCommand().
Referenced by appendContextMenu().
|
virtual |
Called when leaving the move mode, when the mouse button has been released.
Reimplemented from Kwave::ViewItem.
Definition at line 184 of file LabelItem.cpp.
References Kwave::UndoTransactionGuard::abort(), m_current_pos, m_initial_pos, and m_undo_transaction.
|
virtual |
Returns flags describing the possible interactions with this object
Reimplemented from Kwave::ViewItem.
Definition at line 63 of file LabelItem.cpp.
References Kwave::ViewItem::CanGrabAndMove.
|
virtual |
Returns a mouse cursor used when moving the item
Reimplemented from Kwave::ViewItem.
Definition at line 139 of file LabelItem.cpp.
|
virtual |
handles updates when being moved with the mouse
mouse_pos | position of the mouse, in pixel coordinates relative to the parent widget |
Reimplemented from Kwave::ViewItem.
Definition at line 145 of file LabelItem.cpp.
References Kwave::SignalManager::findLabel(), Kwave::MetaData::isNull(), Kwave::SignalManager::labelIndex(), m_current_pos, m_description, m_index, m_initial_pos, Kwave::ViewItem::m_signal_manager, m_undo_transaction, Kwave::ViewItem::m_view, Kwave::SignalManager::modifyLabel(), Kwave::SignalView::offset(), Kwave::SignalView::pixels2samples(), Kwave::Label::pos(), and Kwave::UndoTransactionGuard::registerUndoAction().
|
virtual |
Can be overwritten to return a tooltip.
ofs | sample index the tooltip should refer to (unused) |
Reimplemented from Kwave::ViewItem.
Definition at line 69 of file LabelItem.cpp.
References _, m_current_pos, m_description, m_index, Kwave::ViewItem::m_view, Kwave::ms2hms(), and Kwave::SignalView::samples2ms().
|
private |
current position of the label, in samples
Definition at line 113 of file LabelItem.h.
|
private |
description of the label
Definition at line 116 of file LabelItem.h.
|
private |
index of the label
Definition at line 107 of file LabelItem.h.
Referenced by contextMenuLabelDelete(), contextMenuLabelProperties(), moveTo(), and toolTip().
|
private |
initial position of the label, in samples
Definition at line 110 of file LabelItem.h.
|
private |
used when we are within a undo transaction (we started)
Definition at line 119 of file LabelItem.h.
Referenced by done(), moveTo(), and ~LabelItem().