Skip to content
Snippets Groups Projects
Commit ec241fe6 authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

rm unused source

parent 6f156f8e
No related branches found
No related tags found
1 merge request!427Reduce include dependences in GUI; break cyclic dependence between View and Model
Pipeline #48753 failed
// ************************************************************************************************
//
// 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);
}
// ************************************************************************************************
//
// 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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment