1
/***************************************************************************
2
* Copyright (C) 2008 by Volker Lanz <vl@fidra.de> *
4
* This program is free software; you can redistribute it and/or modify *
5
* it under the terms of the GNU General Public License as published by *
6
* the Free Software Foundation; either version 2 of the License, or *
7
* (at your option) any later version. *
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 General Public License for more details. *
14
* You should have received a copy of the GNU General Public License *
15
* 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
***************************************************************************/
20
#if !defined(PARTWIDGET__H)
24
#include "gui/partwidgetbase.h"
25
#include "gui/parttablewidget.h"
27
#include "core/partition.h"
35
/** @brief Widget that represents a Partition.
37
Represents a single Partition (possibly with its children, in case of an extended Partition) in the GUI.
41
class PartWidget : public QWidget, public PartWidgetBase
46
PartWidget(QWidget* parent, const PartTableWidget* ptWidget, const Partition* p, bool showChildren = true);
50
void updateChildren();
52
const Partition* partition() const { return m_Partition.isNull() ? NULL : m_Partition; } /**< @return the widget's Partition or NULL if none set */
55
void paintEvent(QPaintEvent* event);
56
void resizeEvent(QResizeEvent* event);
58
PartTableWidget* partTableWidget() { return m_PartTableWidget.isNull() ? NULL : m_PartTableWidget; }
59
const PartTableWidget* partTableWidget() const { return m_PartTableWidget.isNull() ? NULL : m_PartTableWidget; }
61
QList<PartWidget*>& widgets() { return m_Widgets; }
62
const QList<PartWidget*>& widgets() const { return m_Widgets; }
64
void drawPartition(QWidget* destWidget);
65
bool showChildren() const { return m_ShowChildren; }
68
QPointer<PartTableWidget> m_PartTableWidget;
69
QPointer<Partition> m_Partition;
70
QList<PartWidget*> m_Widgets;