File indexing completed on 2024-04-28 05:46:32
0001 /* 0002 SPDX-FileCopyrightText: 2010-2011 Volker Lanz <vl@fidra.de> 0003 SPDX-FileCopyrightText: 2016-2017 Andrius Štikonas <andrius@stikonas.eu> 0004 SPDX-FileCopyrightText: 2019 Yuri Chornoivan <yurchor@ukr.net> 0005 0006 SPDX-License-Identifier: GPL-3.0-or-later 0007 */ 0008 0009 #if !defined(INFOPANE_H) 0010 0011 #define INFOPANE_H 0012 0013 #include <QWidget> 0014 0015 class Partition; 0016 class Device; 0017 0018 class QGridLayout; 0019 class QString; 0020 0021 /** Show information about Partitions and Devices 0022 0023 Child widget of the QDockWidget to show some details about the currently selected Partition 0024 or Device 0025 0026 @author Volker Lanz <vl@fidra.de> 0027 */ 0028 class InfoPane : public QWidget 0029 { 0030 Q_DISABLE_COPY(InfoPane) 0031 0032 public: 0033 explicit InfoPane(QWidget* parent = nullptr); 0034 0035 public: 0036 void showPartition(Qt::DockWidgetArea area, const Partition& p); 0037 void showDevice(Qt::DockWidgetArea area, const Device& d); 0038 void clear(); 0039 0040 protected: 0041 void createLabels(const QString& title, const QString& value, const int cols, int& x, int& y); 0042 int createHeader(const QString& title, const int cols); 0043 QGridLayout& gridLayout() { 0044 Q_ASSERT(m_GridLayout); 0045 return *m_GridLayout; 0046 } 0047 qint32 cols(Qt::DockWidgetArea area) const; 0048 0049 private: 0050 QGridLayout* m_GridLayout; 0051 }; 0052 0053 #endif