#1365 Whitespace and comment headers

This commit is contained in:
Magne Sjaastad 2017-03-27 15:24:08 +02:00
parent bf9d65d249
commit 6e6e884ab3
2 changed files with 34 additions and 21 deletions

View File

@ -33,14 +33,15 @@
// for more details.
//
//##################################################################################################
#include "QMinimizePanel.h"
#include <QApplication>
#include <QFrame>
#include <QLabel>
#include <QPixmap>
#include <QPushButton>
#include <QResizeEvent>
#include <QLabel>
#include "QApplication"
#include <QPixmap>
//--------------------------------------------------------------------------------------------------
///
@ -128,6 +129,9 @@ QMinimizePanel::QMinimizePanel(const QString &title, QWidget* parent/*=0*/)
this->initialize(title);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void QMinimizePanel::initialize(const QString &title)
{
m_titleFrame = new QFrame(this);
@ -159,7 +163,6 @@ void QMinimizePanel::initialize(const QString &title)
QPalette contentFramePalette = m_contentFrame->palette();
contentFramePalette.setBrush(QPalette::Window, QColor(255,250,250,85));
//contentFramePalette.setBrush(QPalette::Foreground, contentFramePalette.dark());
m_contentFrame->setPalette(contentFramePalette);
connect(m_collapseButton, SIGNAL(clicked()),this, SLOT(toggleExpanded()) );
@ -203,6 +206,7 @@ QSize QMinimizePanel::sizeHint() const
QSize contentsMin(m_contentFrame->sizeHint());
QSize total = contentsMin.expandedTo(titleBarMin);
total.rheight() += titleBarMin.height();
return total;
}
else
@ -247,6 +251,7 @@ QSize QMinimizePanel::minimumSizeHint() const
QSize contentsMin(m_contentFrame->minimumSizeHint());
QSize total = contentsMin.expandedTo(titleBarMin);
total.rheight() += titleBarMin.height();
return total;
}
else
@ -276,7 +281,10 @@ void QMinimizePanel::resizeEvent(QResizeEvent *resizeEv )
m_contentFrame->setGeometry(0, titleHeight-1, width, heigth - (titleHeight-1));
}
bool QMinimizePanel::event(QEvent* event)
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool QMinimizePanel::event(QEvent* event)
{
if (event->type() == QEvent::LayoutRequest)
{

View File

@ -42,7 +42,12 @@ class QFrame;
class QLabel;
class QPushButton;
class QMinimizePanel: public QWidget
//==================================================================================================
//
//
//
//==================================================================================================
class QMinimizePanel : public QWidget
{
Q_OBJECT
public:
@ -50,31 +55,31 @@ public:
explicit QMinimizePanel(const QString &title, QWidget* parent=0);
~QMinimizePanel();
QFrame * contentFrame() { return m_contentFrame; }
void setTitle (const QString& title);
QString title() const;
QFrame* contentFrame() { return m_contentFrame; }
void setTitle (const QString& title);
QString title() const;
virtual QSize sizeHint() const override;
public slots:
void setExpanded(bool isExpanded);
void toggleExpanded();
void setExpanded(bool isExpanded);
void toggleExpanded();
signals:
void expandedChanged(bool isExpanded);
void expandedChanged(bool isExpanded);
public:
virtual QSize minimumSizeHint() const override;
virtual QSize minimumSizeHint() const override;
protected:
QFrame* m_titleFrame;
QLabel* m_titleLabel;
QPushButton* m_collapseButton;
QFrame* m_contentFrame;
QFrame* m_titleFrame;
QLabel* m_titleLabel;
QPushButton* m_collapseButton;
QFrame* m_contentFrame;
virtual void resizeEvent(QResizeEvent *) override;
virtual bool event(QEvent* event) override; // To catch QEvent::LayoutRequest
virtual void resizeEvent(QResizeEvent *) override;
virtual bool event(QEvent* event) override; // To catch QEvent::LayoutRequest
private:
void initialize(const QString &title);
void initialize(const QString &title);
};