2022-10-18 21:47:34 +08:00
|
|
|
#ifndef PushButtonH
|
|
|
|
#define PushButtonH
|
|
|
|
//============================================================================
|
|
|
|
/// \file PushButton.h
|
|
|
|
/// \author Uwe Kindler
|
|
|
|
/// \date 18.10.2022
|
|
|
|
/// \brief Declaration of CPushButton
|
|
|
|
//============================================================================
|
|
|
|
|
|
|
|
//============================================================================
|
|
|
|
// INCLUDES
|
|
|
|
//============================================================================
|
2022-10-25 22:05:08 +08:00
|
|
|
#include "ads_globals.h"
|
|
|
|
|
2022-10-18 21:47:34 +08:00
|
|
|
#include <QPushButton>
|
|
|
|
|
|
|
|
namespace ads
|
|
|
|
{
|
|
|
|
|
|
|
|
/**
|
2022-10-25 22:05:08 +08:00
|
|
|
* ADS specific push button class with orientation support
|
2022-10-18 21:47:34 +08:00
|
|
|
*/
|
2022-10-25 22:05:08 +08:00
|
|
|
class ADS_EXPORT CPushButton : public QPushButton
|
2022-10-18 21:47:34 +08:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
enum Orientation {
|
|
|
|
Horizontal,
|
|
|
|
VerticalTopToBottom,
|
|
|
|
VerticalBottomToTop
|
|
|
|
};
|
|
|
|
|
|
|
|
using QPushButton::QPushButton;
|
|
|
|
|
|
|
|
virtual QSize sizeHint() const override;
|
|
|
|
|
2022-10-25 22:05:08 +08:00
|
|
|
/**
|
|
|
|
* Returns the current orientation
|
|
|
|
*/
|
2022-10-26 15:51:37 +08:00
|
|
|
Orientation buttonOrientation() const;
|
2022-10-25 22:05:08 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the orientation of this button
|
|
|
|
*/
|
2022-10-26 15:51:37 +08:00
|
|
|
void setButtonOrientation(Orientation orientation);
|
2022-10-18 21:47:34 +08:00
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void paintEvent(QPaintEvent *event) override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
Orientation m_Orientation = Horizontal;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace ads
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
#endif // PushButtonH
|
|
|
|
|