From ec241fe64c36af23143e21e21c42dfc991c4c0e5 Mon Sep 17 00:00:00 2001 From: "Joachim Wuttke (l)" <j.wuttke@fz-juelich.de> Date: Sat, 6 Nov 2021 13:28:05 +0100 Subject: [PATCH] rm unused source --- GUI/Widget/Common/AdjustingScrollArea.cpp | 49 ----------------------- GUI/Widget/Common/AdjustingScrollArea.h | 36 ----------------- 2 files changed, 85 deletions(-) delete mode 100644 GUI/Widget/Common/AdjustingScrollArea.cpp delete mode 100644 GUI/Widget/Common/AdjustingScrollArea.h diff --git a/GUI/Widget/Common/AdjustingScrollArea.cpp b/GUI/Widget/Common/AdjustingScrollArea.cpp deleted file mode 100644 index 3d0a7a18c7d..00000000000 --- a/GUI/Widget/Common/AdjustingScrollArea.cpp +++ /dev/null @@ -1,49 +0,0 @@ -// ************************************************************************************************ -// -// BornAgain: simulate and fit reflection and scattering -// -//! @file GUI/Widget/Common/AdjustingScrollArea.cpp -//! @brief Implements class AdjustingScrollArea -//! -//! @homepage http://www.bornagainproject.org -//! @license GNU General Public License v3 or higher (see COPYING) -//! @copyright Forschungszentrum Jülich GmbH 2018 -//! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS) -// -// ************************************************************************************************ - -#include "GUI/Widget/Common/AdjustingScrollArea.h" -#include <QEvent> -#include <QScrollBar> - -AdjustingScrollArea::AdjustingScrollArea(QWidget* parent) : QScrollArea(parent) -{ - setObjectName("MyScrollArea"); - setContentsMargins(0, 0, 0, 0); - setWidgetResizable(true); - setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); - setStyleSheet("QScrollArea#MyScrollArea {border: 0px; background-color:transparent;}"); -} - -void AdjustingScrollArea::setWidget(QWidget* w) -{ - QScrollArea::setWidget(w); - w->installEventFilter(this); -} - -QSize AdjustingScrollArea::sizeHint() const -{ - QScrollBar* horizontal = horizontalScrollBar(); - QSize result(viewport()->width(), widget()->height() + horizontal->height() * 2); - return result; -} - -bool AdjustingScrollArea::eventFilter(QObject* obj, QEvent* ev) -{ - if (obj == widget() && ev->type() != QEvent::Resize) { - widget()->setMaximumWidth(viewport()->width()); - setMaximumHeight(height() - viewport()->height() + widget()->height()); - } - - return QScrollArea::eventFilter(obj, ev); -} diff --git a/GUI/Widget/Common/AdjustingScrollArea.h b/GUI/Widget/Common/AdjustingScrollArea.h deleted file mode 100644 index aa37611e570..00000000000 --- a/GUI/Widget/Common/AdjustingScrollArea.h +++ /dev/null @@ -1,36 +0,0 @@ -// ************************************************************************************************ -// -// BornAgain: simulate and fit reflection and scattering -// -//! @file GUI/Widget/Common/AdjustingScrollArea.h -//! @brief Defines class AdjustingScrollArea -//! -//! @homepage http://www.bornagainproject.org -//! @license GNU General Public License v3 or higher (see COPYING) -//! @copyright Forschungszentrum Jülich GmbH 2018 -//! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS) -// -// ************************************************************************************************ - -#ifndef BORNAGAIN_GUI_WIDGET_COMMON_ADJUSTINGSCROLLAREA_H -#define BORNAGAIN_GUI_WIDGET_COMMON_ADJUSTINGSCROLLAREA_H - -#include <QScrollArea> - -//! Modification of standard scroll area, which makes widget with dynamic layout ocuupy whole -//! available space. - -class AdjustingScrollArea : public QScrollArea { - Q_OBJECT - -public: - AdjustingScrollArea(QWidget* parent = 0); - void setWidget(QWidget* w); - - QSize sizeHint() const; - -private: - bool eventFilter(QObject* obj, QEvent* ev); -}; - -#endif // BORNAGAIN_GUI_WIDGET_COMMON_ADJUSTINGSCROLLAREA_H -- GitLab