Pencil2D Animation
Download Community News Docs Contribute
  • Overview
  • Articles
  • Code
  •  
  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • File List
Loading...
Searching...
No Matches
  • app
  • src
toolboxwidget.h
1/*
2
3Pencil2D - Traditional Animation Software
4Copyright (C) 2005-2007 Patrick Corrieri & Pascal Naidon
5Copyright (C) 2012-2020 Matthew Chiawen Chang
6Copyright (C) 2024-2099 Oliver S. Larsen
7
8This program is free software; you can redistribute it and/or
9modify it under the terms of the GNU General Public License
10as published by the Free Software Foundation; version 2 of the License.
11
12This program is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17*/
18#ifndef TOOLBOXWIDGET_H
19#define TOOLBOXWIDGET_H
20
21#include <QObject>
22#include <QToolButton>
23#include <QWidget>
24
25#include "flowlayout.h"
26#include "pencildef.h"
27#include "toolboxlayout.h"
28
29class Editor;
30
31namespace Ui {
32class ToolBoxWidget;
33}
34
35class ToolBoxWidget : public QWidget
36{
37 Q_OBJECT
38public:
39 ToolBoxWidget(QWidget* parent = nullptr);
40 ~ToolBoxWidget() override;
41
42 void setEditor(Editor* editor) { mEditor = editor; }
43 void initUI();
44 void updateUI();
45
46public slots:
47 void setActiveTool(ToolType toolType);
48
49public:
50
51 void pencilOn();
52 void eraserOn();
53 void selectOn();
54 void moveOn();
55 void penOn();
56 void handOn();
57 void polylineOn();
58 void bucketOn();
59 void eyedropperOn();
60 void brushOn();
61 void smudgeOn();
62
63 void updateLayoutAlignment();
64 void deselectAllTools();
65 void toolOn(ToolType toolType, QToolButton* toolButton);
66
67protected:
68 int getMinHeightForWidth(int width) const;
69 QSize minimumSizeHint() const override;
70 QSize sizeHint() const override;
71 void resizeEvent(QResizeEvent* event) override;
72
73private:
74 FlowLayout* mFlowlayout = nullptr;
75
76 Ui::ToolBoxWidget* ui = nullptr;
77 Editor* mEditor = nullptr;
78};
79
80#endif // TOOLBOXWIDGET_H
Editor
Definition: editor.h:71
FlowLayout
Definition: flowlayout.h:81
ToolBoxWidget
Definition: toolboxwidget.h:36
QObject::Q_OBJECT
Q_OBJECTQ_OBJECT
QObject::parent
QObject * parent() const const
QResizeEvent
QSize
QToolButton
QWidget
QWidget::event
virtual bool event(QEvent *event) override
QWidget::width
width
Generated on Thu Jun 5 2025 14:06:43 for Pencil2D by doxygen 1.9.6 based on revision 4c63407997b2c03e5048716586dec6fbbb755173