1 /* 2 This file is part of the Kasten Framework, made within the KDE community. 3 4 SPDX-FileCopyrightText: 2009 Friedrich W. H. Kossebau <kossebau@kde.org> 5 6 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL 7 */ 8 9 #include "viewbox.hpp" 10 11 // lib 12 #include "abstractview.hpp" 13 // Qt 14 #include <QVBoxLayout> 15 16 namespace Kasten { 17 ViewBox(AbstractView * view,QWidget * parent)18ViewBox::ViewBox(AbstractView* view, QWidget* parent) 19 : QWidget(parent) 20 , mView(view) 21 { 22 QWidget* widget = view->widget(); 23 setFocusProxy(widget); 24 25 auto* layout = new QVBoxLayout(this); 26 layout->setContentsMargins(0, 0, 0, 0); 27 layout->setSpacing(0); 28 layout->addWidget(widget); 29 } 30 ~ViewBox()31ViewBox::~ViewBox() 32 { 33 mView->widget()->setParent(nullptr); 34 } 35 view() const36AbstractView* ViewBox::view() const { return mView; } 37 add(ViewBox::Area area)38void ViewBox::add(ViewBox::Area area) 39 { 40 Q_UNUSED(area); 41 } 42 43 } 44