mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-05 18:50:44 +00:00
Fixed runaway font memory leaks
This commit is contained in:
parent
df1c0f42b2
commit
b9c755970e
@ -137,7 +137,9 @@ void gFlagsLine::Plot(gGraphWindow & w,float scrx,float scry)
|
||||
// Draw text label
|
||||
float x,y;
|
||||
GetTextExtent(m_label,x,y);
|
||||
DrawText(w,m_label,start_px-x-10,(scry-line_top)-(line_h/2)+(y/2));
|
||||
w.qglColor(Qt::black);
|
||||
w.renderText(start_px-x-10,(line_top)+(line_h/2)-(y/2),0,m_label);
|
||||
//DrawText(w,m_label,start_px-x-10,(scry-line_top)-(line_h/2)+(y/2));
|
||||
float x1,x2;
|
||||
|
||||
float top=floor(line_top)+2;
|
||||
|
@ -141,6 +141,7 @@ void gXAxis::Plot(gGraphWindow & w,float scrx,float scry)
|
||||
vertarray[vertcnt++]=py;
|
||||
vertarray[vertcnt++]=start_py-4;
|
||||
}
|
||||
w.qglColor(Qt::black);
|
||||
for (qint64 i=aligned_start;i<maxx;i+=step) {
|
||||
px=double(i-minx)*xmult;
|
||||
px+=start_px;
|
||||
@ -163,7 +164,9 @@ void gXAxis::Plot(gGraphWindow & w,float scrx,float scry)
|
||||
tmpstr=QString("%1:%2:%3:%4").arg(h,2,10,QChar('0')).arg(m,2,10,QChar('0')).arg(s,2,10,QChar('0')).arg(ms,3,10,QChar('0'));
|
||||
}
|
||||
}
|
||||
DrawText(w,tmpstr,px-(x/2),scry-(w.GetBottomMargin()-18),0);
|
||||
|
||||
w.renderText(px-(x/2),(w.GetBottomMargin()-18),0,tmpstr);
|
||||
//DrawText(w,tmpstr,px-(x/2),scry-(w.GetBottomMargin()-18),0);
|
||||
py=px;
|
||||
for (int j=1;j<10;j++) {
|
||||
py+=step_pixels;
|
||||
|
@ -143,13 +143,15 @@ void gYAxis::Plot(gGraphWindow &w,float scrx,float scry)
|
||||
}
|
||||
}
|
||||
|
||||
w.qglColor(m_text_color);
|
||||
for (double i=miny; i<=maxy+min_ytick-0.00001; i+=min_ytick) {
|
||||
ty=(i - miny) * ymult;
|
||||
fd=Format(i*m_yaxis_scale); // Override this as a function.
|
||||
GetTextExtent(fd,x,y);
|
||||
if (x>labelW) labelW=x;
|
||||
h=start_py+ty;
|
||||
DrawText(w,fd,start_px-12-x,scry-(h-(y/2.0)),0,m_text_color);
|
||||
w.renderText(start_px-12-x,h-(y/2.0),0,fd);
|
||||
//DrawText(w,fd,start_px-12-x,scry-(h-(y/2.0)),0,m_text_color);
|
||||
|
||||
vertarray[vertcnt++]=start_px-4;
|
||||
vertarray[vertcnt++]=h;
|
||||
|
@ -53,8 +53,8 @@ Daily::Daily(QWidget *parent,QGLWidget * shared, MainWindow *mw)
|
||||
|
||||
//scrollArea=new MyScrollArea(this);
|
||||
|
||||
QString s="QTreeWidget::selection-background-color { qlineargradient(x1: 0, y1: 0, x2: 0.5, y2: 0.5, stop: 0 #FF92BB, stop: 1 white); }";
|
||||
ui->treeWidget->setStyleSheet(s);
|
||||
//ui->webView->setStyleSheet("QWebView { background-color: qlineargradient(x1: 0, y1: 0, x2: 0.5, y2: 0.5, stop: 0 #FF92BB, stop: 1 white); }");
|
||||
//ui->treeWidget->setAlternatingRowColors(true);
|
||||
GraphLayout=new QWidget();
|
||||
ui->graphSizer->addWidget(GraphLayout,1);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user