• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdesdk API Reference
  • KDE Home
  • Contact Us
 

kapptemplate

  • sources
  • kde-4.12
  • kdesdk
  • kapptemplate
  • templates
  • C++
  • flake
%{APPNAME}Tool.cpp
Go to the documentation of this file.
1 #include "%{APPNAME}Tool.h"
2 #include "%{APPNAME}Shape.h"
3 #include "%{APPNAME}Widget.h"
4 #include <KoSelection.h>
5 #include <KoCanvasBase.h>
6 #include <KoShapeManager.h>
7 #include <KDebug>
8 
9 %{APPNAME}Tool::%{APPNAME}Tool(KoCanvasBase *canvas) : KoTool(canvas), m_shape(0)
10 {
11 }
12 
13 void %{APPNAME}Tool::paint(QPainter& painter, const KoViewConverter& viewConverter)
14 {
15  Q_UNUSED(painter);
16  Q_UNUSED(viewConverter);
17 }
18 
19 void %{APPNAME}Tool::mousePressEvent(KoPointerEvent *event)
20 {
21  Q_UNUSED(event);
22 }
23 
24 void %{APPNAME}Tool::mouseMoveEvent(KoPointerEvent *event)
25 {
26  Q_UNUSED(event);
27 }
28 
29 void %{APPNAME}Tool::mouseReleaseEvent(KoPointerEvent *event)
30 {
31  Q_UNUSED(event);
32 }
33 
34 QWidget* %{APPNAME}Tool::createOptionWidget()
35 {
36  return new %{APPNAME}Widget(m_shape);
37 }
38 
39 void %{APPNAME}Tool::activate(bool temporary)
40 {
41  Q_UNUSED( temporary );
42  m_shape = 0;
43  KoSelection *selection = m_canvas->shapeManager()->selection();
44  foreach ( KoShape* shape, selection->selectedShapes() )
45  {
46  m_shape = dynamic_cast<%{APPNAME}Shape*>( shape );
47  if ( m_shape )
48  break;
49  }
50  if ( !m_shape )
51  {
52  emit done();
53  return;
54  }
55  useCursor( Qt::ArrowCursor, true );
56 }
57 
58 void %{APPNAME}Tool::deactivate()
59 {
60  m_shape = 0;
61 }
deactivate
void deactivate()
%{APPNAME}Shape.h
paint
void paint(QPainter &painter, const KoViewConverter &viewconverter)
QWidget
class @6 QWidget
This is the main view class for %{APPNAME}.
Widget
class @2 Widget
Tool
class @3 Tool(KoCanvasBase *canvas)
mouseReleaseEvent
void mouseReleaseEvent(KoPointerEvent *)
%{APPNAME}Tool.h
m_shape
m_shape(0)
Definition: %{APPNAME}Tool.cpp:9
mouseMoveEvent
void mouseMoveEvent(KoPointerEvent *)
createOptionWidget
QWidget * createOptionWidget()
%{APPNAME}Widget.h
activate
void activate(bool temporary=false)
APPNAME
main APPNAME
mousePressEvent
void mousePressEvent(KoPointerEvent *)
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:03:23 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kapptemplate

Skip menu "kapptemplate"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdesdk API Reference

Skip menu "kdesdk API Reference"
  • kapptemplate
  • kcachegrind
  • kompare
  • lokalize
  • okteta
  • umbrello
  •   umbrello

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal