Revert vertical fonts

This commit is contained in:
Mark Watkins 2011-08-31 16:49:40 +10:00
parent 348b787760
commit ca3e1a2e92
2 changed files with 28 additions and 27 deletions

View File

@ -16,7 +16,8 @@ void InitGraphs()
{ {
if (!_graph_init) { if (!_graph_init) {
defaultfont=new QFont("Sans Serif",10); defaultfont=new QFont("Sans Serif",10);
mediumfont=new QFont("Sans Serif",11); defaultfont->setPixelSize(11);
mediumfont=new QFont("Sans Serif",12);
bigfont=new QFont("Serif",35); bigfont=new QFont("Serif",35);
defaultfont->setStyleHint(QFont::SansSerif,QFont::OpenGLCompatible); defaultfont->setStyleHint(QFont::SansSerif,QFont::OpenGLCompatible);
@ -387,7 +388,7 @@ void gGraph::paint(int originX, int originY, int width, int height)
glDisable(GL_BLEND); glDisable(GL_BLEND);
*/ */
glColor4f(0,0,0,1); glColor4f(0,0,0,1);
renderText(title(),20,originY+height/2,90); renderText(title(),20,originY+height/2,90,Qt::black,mediumfont);
left=0,right=0,top=0,bottom=0; left=0,right=0,top=0,bottom=0;
@ -905,6 +906,7 @@ void gGraphView::DrawTextQue()
glFlush(); glFlush();
//glEnable(GL_BLEND); //glEnable(GL_BLEND);
QPainter painter(this); QPainter painter(this);
int w,h;
for (int i=0;i<m_textque_items;i++) { for (int i=0;i<m_textque_items;i++) {
// GL Font drawing is ass in Qt.. :( // GL Font drawing is ass in Qt.. :(
TextQue & q=m_textque[i]; TextQue & q=m_textque[i];
@ -915,9 +917,13 @@ void gGraphView::DrawTextQue()
if (q.angle==0) { if (q.angle==0) {
painter.drawText(q.x, q.y, q.text); painter.drawText(q.x, q.y, q.text);
} else { } else {
QString c;
int w,h;
GetTextExtent(q.text, w, h, q.font); GetTextExtent(q.text, w, h, q.font);
painter.translate(q.x, q.y);
painter.rotate(-q.angle);
painter.drawText(floor(-w/2.0), floor(-h/2.0), q.text);
painter.rotate(+q.angle);
painter.translate(-q.x, -q.y);
/*QString c;
int x=q.x-4; int x=q.x-4;
int y=q.y-(w)/2; int y=q.y-(w)/2;
int tp=y; int tp=y;
@ -932,12 +938,7 @@ void gGraphView::DrawTextQue()
painter.drawText(x-w/2,y,c); painter.drawText(x-w/2,y,c);
y+=h+3; y+=h+3;
} } */
//painter.translate(q.x, q.y);
//painter.rotate(-q.angle);
//painter.drawText(floor(-w/2.0), floor(-h/2.0), q.text);
//painter.rotate(+q.angle);
//painter.translate(-q.x, -q.y);
} }
q.text.clear(); q.text.clear();
//q.text.squeeze(); //q.text.squeeze();

View File

@ -72,7 +72,7 @@ Daily::Daily(QWidget *parent,gGraphView * shared, MainWindow *mw)
layout->addWidget(scrollbar,0); layout->addWidget(scrollbar,0);
const int default_height=150; const int default_height=150;
SF=new gGraph(GraphView,"EVENT FLAGS",default_height); SF=new gGraph(GraphView,"Event Flags",default_height);
// GAHI=new gGraph(GraphView,"Event Breakdown",default_height); // GAHI=new gGraph(GraphView,"Event Breakdown",default_height);
gSegmentChart * seg=new gSegmentChart(GST_Pie); gSegmentChart * seg=new gSegmentChart(GST_Pie);
@ -85,25 +85,25 @@ Daily::Daily(QWidget *parent,gGraphView * shared, MainWindow *mw)
SF->AddLayer(AddCPAP(seg),LayerRight,100); SF->AddLayer(AddCPAP(seg),LayerRight,100);
FRW=new gGraph(GraphView,"FLOW RATE",default_height); FRW=new gGraph(GraphView,"Flow Rate",default_height);
MP=new gGraph(GraphView,"MASK PRESSURE",default_height); MP=new gGraph(GraphView,"Mask Pressure",default_height);
PRD=new gGraph(GraphView,"PRESSURE",default_height); PRD=new gGraph(GraphView,"Pressure",default_height);
LEAK=new gGraph(GraphView,"LEAK",default_height); LEAK=new gGraph(GraphView,"Leak",default_height);
SNORE=new gGraph(GraphView,"SNORE",default_height); SNORE=new gGraph(GraphView,"Snore",default_height);
RR=new gGraph(GraphView,"RESPIRATORY RATE",default_height); RR=new gGraph(GraphView,"Respiratory Rate",default_height);
TV=new gGraph(GraphView,"TIDAL VOLUME",default_height); TV=new gGraph(GraphView,"Tidal Volume",default_height);
MV=new gGraph(GraphView,"MINUTE VENTILATION",default_height); MV=new gGraph(GraphView,"Minute Ventilation",default_height);
FLG=new gGraph(GraphView,"FLOW LIMITATION",default_height); FLG=new gGraph(GraphView,"Flow Limitation",default_height);
PTB=new gGraph(GraphView,"PATIENT. TRIG BREATHING",default_height); PTB=new gGraph(GraphView,"Patient Trig. Breath",default_height);
RE=new gGraph(GraphView,"RESPIRATORY EVENT",default_height); RE=new gGraph(GraphView,"Respiratory Event",default_height);
IE=new gGraph(GraphView,"I:E",default_height); IE=new gGraph(GraphView,"I:E",default_height);
TE=new gGraph(GraphView,"TE",default_height); TE=new gGraph(GraphView,"Te",default_height);
TI=new gGraph(GraphView,"TI",default_height); TI=new gGraph(GraphView,"Ti",default_height);
INTPULSE=new gGraph(GraphView,"PULSE",default_height,1); INTPULSE=new gGraph(GraphView,"Pulse",default_height,1);
INTSPO2=new gGraph(GraphView,"SPO2",default_height,1); INTSPO2=new gGraph(GraphView,"SPO2",default_height,1);
PULSE=new gGraph(GraphView,"PULSE",default_height,1); PULSE=new gGraph(GraphView,"Pulse",default_height,1);
SPO2=new gGraph(GraphView,"SPO2",default_height,1); SPO2=new gGraph(GraphView,"SPO2",default_height,1);
PLETHY=new gGraph(GraphView,"PLETHY",default_height,1); PLETHY=new gGraph(GraphView,"Plethy",default_height,1);
gFlagsGroup *fg=new gFlagsGroup(); gFlagsGroup *fg=new gFlagsGroup();