histogramoptpanel.cpp 579 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
#include "histogramoptpanel.hpp"

#include <QVBoxLayout>
#include <QCheckBox>


namespace cvv
{
namespace qtutil
{

HistogramOptPanel::HistogramOptPanel(const Histogram& hist, bool showHideButton, QWidget* parent)
  :QWidget{parent}
{
  auto layout = new QVBoxLayout();
  layout->setContentsMargins(0,0,0,0);

  if (showHideButton) {
    auto showCheckbox = new QCheckBox("Show Histogram");
    showCheckbox->setChecked(false);
    connect(showCheckbox, SIGNAL(clicked(bool)), &hist, SLOT(setVisible(bool)));
    layout->addWidget(showCheckbox);
  }

  setLayout(layout);
}

}
}