Removes DHQSlider from AzToolsFramework

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
This commit is contained in:
Esteban Papp
2021-12-01 14:06:37 -08:00
parent e2091f2451
commit 234ff3dca2
5 changed files with 0 additions and 102 deletions
@@ -1,56 +0,0 @@
/*
* Copyright (c) Contributors to the Open 3D Engine Project.
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#include "DHQSlider.hxx"
#include "PropertyQTConstants.h"
#include <QtWidgets/QAbstractSpinBox>
AZ_PUSH_DISABLE_WARNING(4244 4251, "-Wunknown-warning-option") // 4244: conversion from 'int' to 'float', possible loss of data
// 4251: 'QInputEvent::modState': class 'QFlags<Qt::KeyboardModifier>' needs to have dll-interface to be used by clients of class 'QInputEvent'
#include <QWheelEvent>
AZ_POP_DISABLE_WARNING
namespace AzToolsFramework
{
void DHQSlider::wheelEvent(QWheelEvent* e)
{
if (hasFocus())
{
QSlider::wheelEvent(e);
}
else
{
e->ignore();
}
}
void InitializeSliderPropertyWidgets(QSlider* slider, QAbstractSpinBox* spinbox)
{
if (slider == nullptr || spinbox == nullptr)
{
return;
}
// A 2:1 ratio between spinbox and slider gives the slider more room,
// but leaves some space for the spin box to expand.
const int spinBoxStretch = 1;
const int sliderStretch = 2;
QSizePolicy sizePolicy(QSizePolicy::Ignored, QSizePolicy::Fixed);
sizePolicy.setHorizontalStretch(spinBoxStretch);
spinbox->setSizePolicy(sizePolicy);
spinbox->setMinimumWidth(PropertyQTConstant_MinimumWidth);
spinbox->setFixedHeight(PropertyQTConstant_DefaultHeight);
spinbox->setFocusPolicy(Qt::StrongFocus);
sizePolicy.setHorizontalStretch(sliderStretch);
slider->setSizePolicy(sizePolicy);
slider->setMinimumWidth(PropertyQTConstant_MinimumWidth);
slider->setFixedHeight(PropertyQTConstant_DefaultHeight);
slider->setFocusPolicy(Qt::StrongFocus);
slider->setFocusProxy(spinbox);
}
}
@@ -1,42 +0,0 @@
/*
* Copyright (c) Contributors to the Open 3D Engine Project.
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#ifndef AZ_Q_SLIDER_HXX
#define AZ_Q_SLIDER_HXX
#include <AzCore/base.h>
#include <AzCore/Memory/SystemAllocator.h>
#include <QtWidgets/QSlider>
#pragma once
class QAbstractSpinBox;
namespace AzToolsFramework
{
class DHQSlider
: public QSlider
{
public:
AZ_CLASS_ALLOCATOR(DHQSlider, AZ::SystemAllocator, 0);
explicit DHQSlider(QWidget* parent = 0)
: QSlider(parent) {}
DHQSlider(Qt::Orientation orientation, QWidget* parent = 0)
: QSlider(orientation, parent) {}
void wheelEvent(QWheelEvent* e);
};
// Share widget initialization code between double and int based slider properties.
void InitializeSliderPropertyWidgets(QSlider*, QAbstractSpinBox*);
}
#endif
@@ -7,7 +7,6 @@
*/
#include <cmath>
#include "PropertyDoubleSliderCtrl.hxx"
#include "DHQSlider.hxx"
#include "PropertyQTConstants.h"
AZ_PUSH_DISABLE_WARNING(4251, "-Wunknown-warning-option") // 4251: 'QLayoutItem::align': class 'QFlags<Qt::AlignmentFlag>' needs to have dll-interface to be used by clients of class 'QLayoutItem'
#include <QtWidgets/QHBoxLayout>
@@ -6,7 +6,6 @@
*
*/
#include "PropertyIntSliderCtrl.hxx"
#include "DHQSlider.hxx"
#include "PropertyQTConstants.h"
#include <AzQtComponents/Components/Widgets/SpinBox.h>
@@ -368,8 +368,6 @@ set(FILES
UI/PropertyEditor/QtWidgetLimits.h
UI/PropertyEditor/DHQComboBox.hxx
UI/PropertyEditor/DHQComboBox.cpp
UI/PropertyEditor/DHQSlider.hxx
UI/PropertyEditor/DHQSlider.cpp
UI/PropertyEditor/EntityIdQLabel.hxx
UI/PropertyEditor/EntityIdQLabel.cpp
UI/PropertyEditor/EntityIdQLineEdit.h