Commit b29d1433 authored by Summer Stapleton's avatar Summer Stapleton
Browse files

Updated AbstractProjectItemView to inherit from QMainWindow instead of...

Updated AbstractProjectItemView to inherit from QMainWindow instead of QWidget. ProjectItemTreeView also updated to include central widget and remove layout to handle new inheritance scheme.
parent 23c34325
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@
#include <QDragMoveEvent>
#include <QDropEvent>
#include <QList>
#include <QMainWindow>
#include <QWidget>

#include "ProjectItem.h"
@@ -39,9 +40,9 @@ namespace Isis {
  /**
   * Constructs the AbstractProjectItemView.
   *
   * @param[in] parent (QWidget *) The parent widget
   * @param[in] parent (QMainWindow *) The parent widget
   */
  AbstractProjectItemView::AbstractProjectItemView(QWidget *parent) : QWidget(parent) {
  AbstractProjectItemView::AbstractProjectItemView(QWidget *parent) : QMainWindow(parent) {
    m_internalModel = new ProjectItemProxyModel(this);
    setAcceptDrops(true);
  }
+7 −2
Original line number Diff line number Diff line
@@ -23,10 +23,11 @@
 *   http://www.usgs.gov/privacy.html.
 */

#include <QWidget>
#include <QMainWindow>

class QAction;
class QDragEnterEvent;
class QWidget;
template <typename T> class QList;

namespace Isis {
@@ -60,8 +61,12 @@ namespace Isis {
   *   @history 2016-07-28 Tracie Sucharski - Implemented removeItem and removeItems methods.
   *   @history 2016-08-25 Adam Paquette - Minor updates to documentation.
   *                           Fixes #4299.
   *   @history 2018-05-29 Tracie Sucharski & Summer Stapleton - updated to inherit from QMainWindow
   *                           instead of QWidget. This updates all views in the ipce main window 
   *                           to be main windows themselves, changing from an mdi interface to an
   *                           sdi interface.
   */
  class AbstractProjectItemView : public QWidget {
  class AbstractProjectItemView : public QMainWindow {

    Q_OBJECT

+8 −5
Original line number Diff line number Diff line
@@ -50,16 +50,19 @@ namespace Isis {
    m_treeView->setAcceptDrops(false);
    m_treeView->setHeaderHidden(true);
    
    setCentralWidget(m_treeView);

    //  Currently set all items on view to un-editable
    //m_treeView->setEditTriggers(QAbstractItemView::NoEditTriggers);

//  setAcceptDrops(true);
    
    QBoxLayout *layout = new QVBoxLayout;
    layout->addWidget(m_treeView);
    layout->setContentsMargins(0, 0, 0, 0);

    setLayout(layout);
    // TODO Commented-out by Summer for new inheritence for parent class. Will clean up when confirmed that not needed.
    // QBoxLayout *layout = new QVBoxLayout;
    // layout->addWidget(m_treeView);
    // layout->setContentsMargins(0, 0, 0, 0);
    // 
    // setLayout(layout);
  }

  
+3 −0
Original line number Diff line number Diff line
@@ -55,6 +55,9 @@ namespace Isis {
   *                           Resolves [-Wheader-guard] warnings for prog17 (clang).
   *   @history 2017-04-12 Tracie Sucharski - Turn off dragging on the treeView for now since it is
   *                           does not work and is causing errors.
   *   @history 2018-05-29 Summer Stapleton - updated the view to include a central widget and to
   *                           remove layout capacity. This change was made to adjust to parent 
   *                           class now inheriting from QMainWindow instead of QWidget.
   */
  class ProjectItemTreeView : public AbstractProjectItemView {