text: // MIT License
  //
  // Copyright (c) 2017-2018 Artur Wyszyński, aljen at hitomi dot pl
  //
  // Permission is hereby granted, free of charge, to any person obtaining a copy
  // of this software and associated documentation files (the "Software"), to deal
  // in the Software without restriction, including without limitation the rights
  // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  // copies of the Software, and to permit persons to whom the Software is
  // furnished to do so, subject to the following conditions:
  //
  // The above copyright notice and this permission notice shall be included in all
  // copies or substantial portions of the Software.
  //
  // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  // SOFTWARE.
  
  #include "const_bool_node.h"
  #include "const_bool.h"
  
  #include <QCheckBox>
  #include <QTableWidget>
  
  namespace spaghetti::nodes {
  
  void ConstBool::showProperties()
  {
    showCommonProperties();
    showIOProperties(IOSocketsType::eOutputs);
  
    propertiesInsertTitle("Const Bool");
  
    int row = m_properties->rowCount();
    m_properties->insertRow(row);
  
    QTableWidgetItem *item{};
  
    item = new QTableWidgetItem{ "Value" };
    item->setFlags(item->flags() & ~Qt::ItemIsEditable);
    m_properties->setItem(row, 0, item);
  
    auto const constBool = static_cast<elements::ConstBool *>(m_element);
    bool const current = constBool->currentValue();
  
    QCheckBox *const value = new QCheckBox;
    m_properties->setCellWidget(row, 1, value);
    value->setChecked(current);
  
    QObject::connect(value, &QCheckBox::stateChanged, [constBool](int a_state) { constBool->set(a_state == 2); });
  }
  
  } // namespace spaghetti::nodes
  