Files
o3de/Code/Tools/Standalone/Source/Driller/Replica/BaseDetailViewQObject.hxx
T
2021-04-23 09:43:40 -07:00

93 lines
3.0 KiB
C++

/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#ifndef DRILLER_REPLICA_BASEDETAILVIEWQOBJECT_H
#define DRILLER_REPLICA_BASEDETAILVIEWQOBJECT_H
#if !defined(Q_MOC_RUN)
#include <AzCore/base.h>
#include <AzCore/Memory/SystemAllocator.h>
#include <QtWidgets/QDialog>
#include <QtWidgets/qtreeview.h>
#endif
namespace Ui
{
class BaseDetailView;
}
namespace Driller
{
class ReplicaDataView;
// This class is a work around because QT does not play nicely with templates.
// So I'm going to do all of my Qt related signalling here and just pass it along
// to a virtual function.
class BaseDetailViewQObject : public QDialog
{
Q_OBJECT
public:
AZ_CLASS_ALLOCATOR(BaseDetailViewQObject, AZ::SystemAllocator,0);
BaseDetailViewQObject(QWidget* parent = nullptr);
void SetupSignals(ReplicaDataView* dataView, Ui::BaseDetailView* detailView);
void SetupTreeViewSignals(QTreeView* treeView);
public slots:
void DataRangeChanged();
void HideAll();
void ShowAll();
void HideSelected();
void ShowSelected();
void CollapseAll();
void ExpandAll();
void DoubleClicked(const QModelIndex& index);
void SelectionChanged(const QItemSelection& selected, const QItemSelection& deselected);
void UpdateDisplay(const QModelIndex& startIndex, const QModelIndex& endIndex);
void DisplayModeChanged(int);
void GraphDetailChanged(int);
void BandwidthDisplayUsageTypeChanged(int);
void InspectedSeries(size_t seriesId);
void SelectedSeries(size_t seriesId, int position);
protected:
virtual void OnDataRangeChanged() = 0;
virtual void SetAllEnabled(bool enabled) = 0;
virtual void SetSelectedEnabled(bool enabled) = 0;
virtual void OnCollapseAll() = 0;
virtual void OnExpandAll() = 0;
virtual void OnDoubleClicked(const QModelIndex& index) = 0;
virtual void OnSelectionChanged(const QItemSelection& selected, const QItemSelection& deselected) = 0;
virtual void OnUpdateDisplay(const QModelIndex& startIndex, const QModelIndex& endIndex) = 0;
virtual void OnDisplayModeChanged(int) = 0;
virtual void OnGraphDetailChanged(int) = 0;
virtual void OnBandwidthDisplayUsageTypeChanged(int) = 0;
virtual void OnInspectedSeries(size_t seriesId) = 0;
virtual void OnSelectedSeries(size_t seriesId, int position) = 0;
};
}
#endif