Fixed Timing diagram printing

1. Make Diagram::paintDiagram() virtual
2. Override Digaram::paintDiagram() method for TimingDiagram and
TabDiagram
This commit is contained in:
Vadim Kuznetzov 2016-11-11 13:25:27 +03:00
parent 36a3d0f0b4
commit 8af5b96ee3
5 changed files with 16 additions and 4 deletions

View File

@ -71,7 +71,7 @@ public:
virtual QString extraMarkerText(Marker const*) const {return "";}
virtual void paint(ViewPainter*);
void paintDiagram(ViewPainter* p);
virtual void paintDiagram(ViewPainter* p);
void paintMarkers(ViewPainter* p, bool paintAll = true);
void setCenter(int, int, bool relative=false);
void getCenter(int&, int&);

View File

@ -46,8 +46,13 @@ TabDiagram::~TabDiagram()
{
}
// ------------------------------------------------------------
void TabDiagram::paint(ViewPainter *p)
{
paintDiagram(p);
}
// ------------------------------------------------------------
void TabDiagram::paintDiagram(ViewPainter *p)
{
// paint all lines
foreach(Line *pl, Lines) {

View File

@ -29,6 +29,7 @@ public:
virtual Diagram* newOne();
static Element* info(QString&, char* &, bool getNewOne=false);
virtual void paint(ViewPainter*);
virtual void paintDiagram(ViewPainter *p);
virtual int calcDiagram();
virtual int scroll(int);
virtual bool scrollTo(int, int, int);

View File

@ -45,8 +45,13 @@ TimingDiagram::~TimingDiagram()
{
}
// ------------------------------------------------------------
void TimingDiagram::paint(ViewPainter *p)
{
paintDiagram(p);
}
// ------------------------------------------------------------
void TimingDiagram::paintDiagram(ViewPainter *p)
{
// paint all lines
foreach(Line *pl, Lines) {

View File

@ -28,7 +28,8 @@ public:
Diagram* newOne();
static Element* info(QString&, char* &, bool getNewOne=false);
void paint(ViewPainter*);
void paint(ViewPainter *p);
void paintDiagram(ViewPainter *p);
int calcDiagram();
int scroll(int);
bool scrollTo(int, int, int);