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

liblancelot

  • sources
  • kde-4.14
  • workspace
  • kdeplasma-addons
  • libs
  • lancelot
  • layouts
NodeLayout.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2007, 2008, 2009, 2010 Ivan Cukic <ivan.cukic(at)kde.org>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser/Library General Public License version 2,
6  * or (at your option) any later version, as published by the Free
7  * Software Foundation
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU Lesser/Library General Public License for more details
13  *
14  * You should have received a copy of the GNU Lesser/Library General Public
15  * License along with this program; if not, write to the
16  * Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18  */
19 
20 #ifndef LANCELOT_NODE_LAYOUT_H
21 #define LANCELOT_NODE_LAYOUT_H
22 
23 #include <QtCore/QMap>
24 #include <QGraphicsLayout>
25 
26 #include <cmath>
27 
28 #include <lancelot/lancelot_export.h>
29 
30 namespace Lancelot {
31 
51 class LANCELOT_EXPORT NodeLayout : public QGraphicsLayout {
52 public:
53  class LANCELOT_EXPORT NodeCoordinate {
54  public:
60  explicit NodeCoordinate(qreal xRelative = 0, qreal yRelative = 0, qreal xAbsolute = 0, qreal yAbsolute = 0);
61 
62  enum CoordinateType {
63  Relative = 0,
64  Absolute = 1,
65  InnerRelative = 2 };
66 
67  static NodeCoordinate simple(qreal x, qreal y, CoordinateType xType = Relative, CoordinateType yType = Relative);
68 
69  qreal xr, xa;
70  qreal yr, ya;
71  };
72 
77  explicit NodeLayout(QGraphicsLayoutItem * parent = 0);
78 
82  virtual ~NodeLayout();
83 
88  void addItem(QGraphicsLayoutItem * item);
89 
93  void addItem(QGraphicsLayoutItem * item,
94  NodeCoordinate topLeft, NodeCoordinate bottomRight);
95 
102  void addItem(QGraphicsLayoutItem * item,
103  NodeCoordinate node, qreal xr = 0, qreal yr = 0);
104 
105  L_Override void setGeometry(const QRectF & rect);
106  L_Override int count() const;
107  L_Override QGraphicsLayoutItem * itemAt(int i) const;
108  L_Override void removeAt(int index);
109  L_Override QSizeF sizeHint(Qt::SizeHint which,
110  const QSizeF & constraint = QSizeF()) const;
111 
112 private:
113  class Private;
114  Private * const d;
115 };
116 
117 } // namespace Lancelot
118 
119 #endif /* LANCELOT_NODE_LAYOUT_H */
120 
Lancelot::NodeLayout::NodeCoordinate::yr
qreal yr
Definition: NodeLayout.h:70
L_Override
#define L_Override
Definition: lancelot_export.h:41
lancelot_export.h
Lancelot::NodeLayout::NodeCoordinate::CoordinateType
CoordinateType
Definition: NodeLayout.h:62
LANCELOT_EXPORT
#define LANCELOT_EXPORT
Definition: lancelot_export.h:32
Lancelot::NodeLayout::NodeCoordinate
Definition: NodeLayout.h:53
Lancelot::NodeLayout::NodeCoordinate::xr
qreal xr
Definition: NodeLayout.h:69
QSizeF
Lancelot::NodeLayout
Node layout has an advanced layouting mechanism.
Definition: NodeLayout.h:51
QRectF
QGraphicsLayout
QGraphicsLayoutItem
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:43:01 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

liblancelot

Skip menu "liblancelot"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

workspace API Reference

Skip menu "workspace API Reference"
  • kdeplasma-addons
  •       GroupingDesktop
  •     liblancelot

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