Loading...
Searching...
No Matches
qwt_column_symbol.h
/******************************************************************************
* Qwt Widget Library
* Copyright (C) 1997 Josef Wilgen
* Copyright (C) 2002 Uwe Rathmann
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the Qwt License, Version 1.0
*****************************************************************************/
#ifndef QWT_COLUMN_SYMBOL_H
#define QWT_COLUMN_SYMBOL_H
#include "qwt_global.h"
#include "qwt_interval.h"
#include <qnamespace.h>
class QPainter;
class QPalette;
class QRectF;
class QWT_EXPORT QwtColumnRect
{
public:
enum Direction
{
LeftToRight,
RightToLeft,
BottomToTop,
TopToBottom
};
QwtColumnRect()
: direction( BottomToTop )
{
}
QRectF toRect() const;
Qt::Orientation orientation() const
{
if ( direction == LeftToRight || direction == RightToLeft )
return Qt::Horizontal;
return Qt::Vertical;
}
QwtInterval hInterval;
QwtInterval vInterval;
Direction direction;
};
class QWT_EXPORT QwtColumnSymbol
{
public:
enum Style
{
NoStyle = -1,
Box,
UserStyle = 1000
};
enum FrameStyle
{
NoFrame,
Plain,
Raised
};
public:
explicit QwtColumnSymbol( Style = NoStyle );
virtual ~QwtColumnSymbol();
void setFrameStyle( FrameStyle );
FrameStyle frameStyle() const;
void setLineWidth( int width );
int lineWidth() const;
void setPalette( const QPalette& );
const QPalette& palette() const;
void setStyle( Style );
Style style() const;
virtual void draw( QPainter*, const QwtColumnRect& ) const;
protected:
void drawBox( QPainter*, const QwtColumnRect& ) const;
private:
Q_DISABLE_COPY(QwtColumnSymbol)
class PrivateData;
PrivateData* m_data;
};
#endif
QwtColumnRect
Directed rectangle representing bounding rectangle and orientation of a column.
Definition qwt_column_symbol.h:27
QwtColumnRect::vInterval
QwtInterval vInterval
Interval for the vertical coordinates.
Definition qwt_column_symbol.h:67
QwtColumnRect::hInterval
QwtInterval hInterval
Interval for the horizontal coordinates.
Definition qwt_column_symbol.h:64
QwtColumnRect::Direction
Direction
Direction of the column.
Definition qwt_column_symbol.h:31
QwtColumnRect::LeftToRight
@ LeftToRight
From left to right.
Definition qwt_column_symbol.h:33
QwtColumnRect::BottomToTop
@ BottomToTop
From bottom to top.
Definition qwt_column_symbol.h:39
QwtColumnRect::RightToLeft
@ RightToLeft
From right to left.
Definition qwt_column_symbol.h:36
QwtColumnRect::orientation
Qt::Orientation orientation() const
Definition qwt_column_symbol.h:55
QwtColumnRect::direction
Direction direction
Direction.
Definition qwt_column_symbol.h:70
QwtColumnRect::QwtColumnRect
QwtColumnRect()
Build an rectangle with invalid intervals directed BottomToTop.
Definition qwt_column_symbol.h:46
QwtColumnSymbol
A drawing primitive for columns.
Definition qwt_column_symbol.h:75
QwtColumnSymbol::FrameStyle
FrameStyle
Definition qwt_column_symbol.h:105
QwtColumnSymbol::NoFrame
@ NoFrame
No frame.
Definition qwt_column_symbol.h:107
QwtColumnSymbol::Plain
@ Plain
A plain frame style.
Definition qwt_column_symbol.h:110
QwtColumnSymbol::Style
Style
Definition qwt_column_symbol.h:82
QwtColumnSymbol::Box
@ Box
Definition qwt_column_symbol.h:90
QwtInterval
A class representing an interval.
Definition qwt_interval.h:23