Qt HUD(平显)演示程序绿色版

简介: 把一个黑底白字的程序改成黑底绿字

上对比图,左侧是原本,右侧是仿造,有些地方比例还是有问题

image.png

其实这个程序没有啥技术含量,就是画

#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QLayout>
#include <QDebug>
int painter_x =800,
painter_y =580;
int temp_temp_1 = 4408;
float temp_temp_2 = 10;
int temp_temp = 4408;
int angle = 0;
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    this->setWindowTitle("HUG_G");
    pixmap1.load(":/images/0001.png");
    pixmap2.load(":/images/0002.png");
    pixmap3.load(":/images/0003.png");
    pixmap4.load(":/images/0004.png");
    ui->label->installEventFilter(this);
    this->centralWidget()->layout()->setMargin(0);
    painter(painter_x,painter_y);
    timer = new QTimer;
    timer1 = new QTimer;
    connect(timer,SIGNAL(timeout()),this,SLOT(timer_out()));
    connect(timer1,SIGNAL(timeout()),this,SLOT(timer_out1()));
    timer->start(200);
    timer1->start(50);
    about_d = new about(this);
}
MainWindow::~MainWindow()
{
    timer->stop();
    timer1->stop();
    delete ui;
}
// show Full SCreen
void MainWindow::on_action_triggered()
{
    this->showFullScreen();
    this->menuBar()->hide();
}
// ESC quit FullScreen
void MainWindow::keyPressEvent(QKeyEvent *event)
{
    if(event->key() == Qt::Key_Escape)
    {
        this->showNormal();
        this->menuBar()->show();
    }
    else if (event->key() == Qt::Key_Enter||event->key() == Qt::Key_Return)
    {
        this->showFullScreen();
        this->menuBar()->hide();
    }
    else
    {
    }
}
bool MainWindow::eventFilter(QObject *watched, QEvent *event)
{
    if((watched == ui->label) && (event->type() == QEvent::Paint))
    {
        painter(painter_x,painter_y);
        return true;
    }
    else
    {
    }
    return false;
}
void MainWindow::timer_out()
{
    if(temp_temp<99999)
    {
        temp_temp++;
    }
    else
    {
        temp_temp = 1000;
    }
    if(angle>=-360)
    {
        angle--;
    }
    else
    {
        angle = 0;
    }
}
void MainWindow::timer_out1()
{
    if(temp_temp_1<99999)
    {
        temp_temp_1++;
    }
    else
    {
        temp_temp_1=1000;
    }
    if(temp_temp_2<99999)
    {
        temp_temp_2=temp_temp_2+0.1;
    }
    else
    {
        temp_temp_2=10.0;
    }
    this->update();
}
void MainWindow::resizeEvent(QResizeEvent *event)
{
    Q_UNUSED(event);
    painter_x = ui->label->width();
    painter_y = ui->label->height();
    //    painter(painter_x,painter_y);
}
//4:3
void MainWindow::painter(int x, int y)
{
    QPainter painter(ui->label);
    painter.setPen(QPen(Qt::green,2.0));
    painter.setFont(QFont("等线",12,QFont::Bold));
    if(x>=(y/3*4))
    {
        float temp_x = y/3*4;
        float flag_1 = y*175/1080.0;
        float flag_2 = flag_1+40;
        float flag_3 = y*110/1080.0;
        painter.drawText(QRect((x-y)/2,flag_1,100,20),Qt::AlignLeft,"A 0.2");
        painter.drawText(QRect((x-y)/2,flag_1+20,100,20),Qt::AlignLeft,"G 5.00");
        painter.drawText(QRect((x-y)/2,flag_1+40,100,20),Qt::AlignLeft,"GM 4.2");
        painter.drawText(QRect((x-y)/2,flag_1+60,100,20),Qt::AlignLeft,"     0.0");
        painter.drawText(QRect((x-y)/2,y-(y*120/580.0)+20,100,20),Qt::AlignLeft,"IEOS");
        painter.drawText(QRect((x-y)/2,y-(y*120/580.0)+40,100,20),Qt::AlignLeft,"RΘ");
        painter.drawText(QRect((x-y)/2,y-(y*120/580.0)+60,100,20),Qt::AlignLeft,"DGFT");
        painter.drawText(QRect((x-y)/2,y-(y*120/580.0)+80,100,20),Qt::AlignLeft,"LOAL");
        painter.drawText(QRect((x-y)/2+(y*60/580),y-(y*120/580.0)+60*(y/580.0),100,20),Qt::AlignLeft,"MRM");
        painter.drawText(QRect((x-y)/2+(y*60/580),y-(y*120/580.0)+80*(y/580.0),100,20),Qt::AlignLeft,"T:40");
        painter.drawText(QRect((x-y)/2+(y*60/580),y-(y*120/580.0)+100*(y/580.0),100,20),Qt::AlignLeft,"2/4");
        painter.drawText(QRect(x-(x-y)/2-100,flag_1-5,100,20),Qt::AlignRight,"00 0.0");
        painter.drawText(QRect(x-(x-y)/2-100,flag_1+25,100,20),Qt::AlignRight,"Time=0.00");
        painter.drawText(QRect(x-(x-y)/2-100,flag_1+40,100,20),Qt::AlignRight,"1500.0 Kg");
        painter.drawText(QRect(x-(x-y)/2-100,y-(y*120/580.0)+20,100,20),Qt::AlignRight,"0.0");
        painter.drawText(QRect(x-(x-y)/2-100,y-(y*120/580.0)+40,100,20),Qt::AlignRight,"   0R");
        painter.drawText(QRect(x-(x-y)/2-100,y-(y*120/580.0)+60,100,20),Qt::AlignRight,"+0");
        painter.drawText(QRect(x-(x-y)/2-100,y-(y*120/580.0)+80,100,20),Qt::AlignRight,"IRM");
        painter.drawLine(x/2-1,flag_2,x/2-1,flag_2+flag_3);
        painter.drawLine(x/2-1-(temp_x*54/1920)/2,(flag_2+flag_3)-flag_3*2/11,x/2-1+(temp_x*54/1920)/2,(flag_2+flag_3)-flag_3*2/11);
        int flag_r = (temp_x*54/1920*23/54);
        painter.drawArc((x/2-1)-flag_r/2,(flag_2+flag_3)-flag_3*2/11-flag_r/2,flag_r,flag_r,0,16*360);
        float line_temp = y*30/1080.0;
        float line_temp_1 = y*3/1080.0;
        float line_y = flag_1+80;
        float line_x = (x-y)/2+50;
        int line_temp_2 = temp_temp+100;
        float line_y_1 = (float)(line_y+line_temp_1*(line_temp_2%10));
        for(int i = 1;i<=200;i++)
        {
            if(line_temp_2%50 ==0)
            {
                painter.drawLine(line_x,line_y_1,line_x-x*30/1920.0,line_y_1);
                painter.drawText(QRect(line_x-105-x*30/1920.0,line_y_1-10,100,20),Qt::AlignRight,QString::number(line_temp_2/10,10));
                line_y_1=line_y_1+line_temp;
            }
            else
            {
                painter.drawLine(line_x,line_y_1,line_x-x*19/1920.0,line_y_1);
                if(line_temp_2%10 ==0)
                {
                    line_y_1=line_y_1+line_temp;
                }
            }
            line_temp_2--;
        }
        painter.setBrush(Qt::black);
        painter.drawRect(line_x-55-x*30/1920.0,(line_y+line_temp*10),50,20);
        painter.drawText(QRect(line_x-105-x*30/1920.0,(line_y+line_temp*10),100,20),Qt::AlignRight,QString::number(temp_temp,10));
        line_temp = y*30/1080.0;
        line_temp_1 = y*3/1080.0;
        line_y = flag_1+80;
        line_x = x-(x-y)/2-50;
        int line_temp_3 = temp_temp_1+100;
        line_y_1 = (float)(line_y+line_temp_1*(line_temp_3%10));
        for(int j = 1;j<=200;j++)
        {
            if(line_temp_3%50 ==0)
            {
                painter.drawLine(line_x,line_y_1,line_x+x*30/1920.0,line_y_1);
                painter.drawText(QRect(line_x-70+x*30/1920.0,line_y_1-10,100,20),Qt::AlignRight,QString::number(line_temp_3/100.0,10.0,1));
                line_y_1=line_y_1+line_temp;
            }
            else
            {
                painter.drawLine(line_x,line_y_1,line_x+x*19/1920.0,line_y_1);
                if(line_temp_3%10 ==0)
                {
                    line_y_1=line_y_1+line_temp;
                }
            }
            line_temp_3--;
        }
        painter.setBrush(Qt::black);
        painter.drawRect(line_x+3+x*30/1920.0,(line_y+line_temp*10),50,20);
        painter.drawLine(line_x-70*(y/800.0)+x*30/1920.0,(line_y+line_temp*10)+10,line_x-20*(y/800.0)+x*30/1920.0,(line_y+line_temp*10)+10);
        painter.drawText(QRect(line_x+3+x*30/1920.0,(line_y+line_temp*10),50,20),Qt::AlignLeft,QString::number(temp_temp_1,10));
        painter.drawText(QRect(line_x-90*(y/800.0)+x*30/1920.0,(line_y+line_temp*10)-10,50,20),Qt::AlignRight,"+0.0");
        painter.drawText(QRect(line_x-90*(y/800.0)+x*30/1920.0,(line_y+line_temp*10)+10,50,20),Qt::AlignRight,"'H");
        float line_temp_H = y*134/1080.0;
        float line_H_x = x-(x-y)/2.0-line_temp_H*2*(int(temp_temp_2*10)%10/10.0);
        float lint_temp_d = y*20/1080;
        float line_H_y = flag_1-10;
        for(int k =1;k<=7;k++)
        {
            if(k%2!=0)
            {
                painter.drawLine(line_H_x,line_H_y,line_H_x,line_H_y-lint_temp_d);
                painter.drawText(QRect(line_H_x-25,(line_H_y-lint_temp_d-20),50,20),Qt::AlignCenter,QString::number(temp_temp_2,10.0,1));
            }
            else
            {
                painter.drawLine(line_H_x,line_H_y,line_H_x,line_H_y-lint_temp_d/2.0);
            }
            line_H_x = line_H_x-line_temp_H;
        }
//        painter.drawArc((x-y)/2,(y/2.0-40),80,80,180*16,16*270);
        painter.drawPixmap((x-y)/2+112*(y/1080.0),y/2,112*(y/1080.0),124*(y/1080.0),pixmap1);
        painter.drawPixmap((x-y)/2+217*(y/1080.0),y-58*(y/1080.0),434*(y/1080.0),38*(y/1080.0),pixmap2);
        painter.translate((x/2-1),(y/2));
        painter.rotate(angle);
        painter.save();
        painter.drawLine(-220,0,-30,0);
        painter.drawLine(30,0,220,0);
        painter.drawLine(-180*(y/800.0),-150*(y/580.0),-30*(y/800.0),-150*(y/580.0));
        painter.drawLine(-180*(y/800.0),-150*(y/580.0),-180*(y/800.0),-150*(y/580.0)+20);
        painter.drawText(QRect(-230*(y/800.0),-150*(y/580.0),50,20),Qt::AlignCenter,"05");
        painter.drawLine(30*(y/800.0),-150*(y/580.0),180*(y/800.0),-150*(y/580.0));
        painter.drawLine(180*(y/800.0),-150*(y/580.0),180*(y/800.0),-150*(y/580.0)+20);
        painter.drawText(QRect(180*(y/800.0),-150*(y/580.0),50,20),Qt::AlignCenter,"05");
        painter.drawLine(-180*(y/800.0),-300*(y/580.0),-30*(y/800.0),-300*(y/580.0));
        painter.drawLine(-180*(y/800.0),-300*(y/580.0),-180*(y/800.0),-300*(y/580.0)+20);
        painter.drawText(QRect(-230*(y/800.0),-300*(y/580.0),50,20),Qt::AlignCenter,"10");
        painter.drawLine(30*(y/800.0),-300*(y/580.0),180*(y/800.0),-300*(y/580.0));
        painter.drawLine(180*(y/800.0),-300*(y/580.0),180*(y/800.0),-300*(y/580.0)+20);
        painter.drawText(QRect(180*(y/800.0),-300*(y/580.0),50,20),Qt::AlignCenter,"10");
//        painter.setPen(QPen(Qt::green,2.0,Qt::DotLine));
        painter.drawLine(-180*(y/800.0),150*(y/580.0),-30*(y/800.0),150*(y/580.0));
        painter.drawLine(-180*(y/800.0),150*(y/580.0),-180*(y/800.0),150*(y/580.0)-20);
        painter.drawText(QRect(-230*(y/800.0),150*(y/580.0),50,20),Qt::AlignCenter,"-05");
        painter.drawLine(30*(y/800.0),150*(y/580.0),180*(y/800.0),150*(y/580.0));
        painter.drawLine(180*(y/800.0),150*(y/580.0),180*(y/800.0),150*(y/580.0)-20);
        painter.drawText(QRect(180*(y/800.0),150*(y/580.0),50,20),Qt::AlignCenter,"-05");
        painter.drawLine(-180*(y/800.0),300*(y/580.0),-30*(y/800.0),300*(y/580.0));
        painter.drawLine(-180*(y/800.0),300*(y/580.0),-180*(y/800.0),300*(y/580.0)-20);
        painter.drawText(QRect(-230*(y/800.0),300*(y/580.0),50,20),Qt::AlignCenter,"-10");
        painter.drawLine(30*(y/800.0),300*(y/580.0),180*(y/800.0),300*(y/580.0));
        painter.drawLine(180*(y/800.0),300*(y/580.0),180*(y/800.0),300*(y/580.0)-20);
        painter.drawText(QRect(180*(y/800.0),300*(y/580.0),50,20),Qt::AlignCenter,"-10");
        painter.restore();
    }
    else
    {
        y = x*3/4;
        int temp_x = x;
        int flag_1 = y*175/1080;
        int flag_2 = flag_1+40;
        int flag_3 = y*110/1080;
        painter.drawText(QRect((x-y)/2,flag_1,100,20),Qt::AlignLeft,"A 0.2");
        painter.drawText(QRect((x-y)/2,flag_1+20,100,20),Qt::AlignLeft,"G 5.00");
        painter.drawText(QRect((x-y)/2,flag_1+40,100,20),Qt::AlignLeft,"GM 4.2");
        painter.drawText(QRect((x-y)/2,y-(y*120/580.0)+20,100,20),Qt::AlignLeft,"IEOS");
        painter.drawText(QRect((x-y)/2,y-(y*120/580.0)+40,100,20),Qt::AlignLeft,"RΘ");
        painter.drawText(QRect((x-y)/2,y-(y*120/580.0)+60,100,20),Qt::AlignLeft,"DGFT");
        painter.drawText(QRect((x-y)/2,y-(y*120/580.0)+80,100,20),Qt::AlignLeft,"LOAL");
        painter.drawText(QRect((x-y)/2+(y*60/580),y-(y*120/580.0)+60*(y/580.0),100,20),Qt::AlignLeft,"MRM");
        painter.drawText(QRect((x-y)/2+(y*60/580),y-(y*120/580.0)+80*(y/580.0),100,20),Qt::AlignLeft,"T:40");
        painter.drawText(QRect((x-y)/2+(y*60/580),y-(y*120/580.0)+100*(y/580.0),100,20),Qt::AlignLeft,"2/4");
        painter.drawText(QRect(x-(x-y)/2-100,flag_1-5,100,20),Qt::AlignRight,"00 0.0");
        painter.drawText(QRect(x-(x-y)/2-100,flag_1+25,100,20),Qt::AlignRight,"Time=0.00");
        painter.drawText(QRect(x-(x-y)/2-100,flag_1+40,100,20),Qt::AlignRight,"1500.0 Kg");
        painter.drawText(QRect(x-(x-y)/2-100,y-(y*120/580.0)+20,100,20),Qt::AlignRight,"0.0");
        painter.drawText(QRect(x-(x-y)/2-100,y-(y*120/580.0)+40,100,20),Qt::AlignRight,"   0R");
        painter.drawText(QRect(x-(x-y)/2-100,y-(y*120/580.0)+60,100,20),Qt::AlignRight,"+0");
        painter.drawText(QRect(x-(x-y)/2-100,y-(y*120/580.0)+80,100,20),Qt::AlignRight,"IRM");
        painter.drawLine(x/2-1,flag_2,x/2-1,flag_2+flag_3);
        painter.drawLine(x/2-1-(temp_x*54/1920)/2,(flag_2+flag_3)-flag_3*2/11,x/2-1+(temp_x*54/1920)/2,(flag_2+flag_3)-flag_3*2/11);
        int flag_r = (temp_x*54/1920*23/54);
        painter.drawArc((x/2-1)-flag_r/2,(flag_2+flag_3)-flag_3*2/11-flag_r/2,flag_r,flag_r,0,16*360);
        float line_temp = y*30/1080.0;
        float line_temp_1 = y*3/1080.0;
        float line_y = flag_1+80;
        float line_x = (x-y)/2+50;
        int line_temp_2 = temp_temp+100;
        float line_y_1 = (float)(line_y+line_temp_1*(line_temp_2%10));
        for(int i = 1;i<=200;i++)
        {
            if(line_temp_2%50 ==0)
            {
                painter.drawLine(line_x,line_y_1,line_x-x*30/1920.0,line_y_1);
                painter.drawText(QRect(line_x-105-x*30/1920.0,line_y_1-10,100,20),Qt::AlignRight,QString::number(line_temp_2/10,10));
                line_y_1=line_y_1+line_temp;
            }
            else
            {
                painter.drawLine(line_x,line_y_1,line_x-x*19/1920.0,line_y_1);
                if(line_temp_2%10 ==0)
                {
                    line_y_1=line_y_1+line_temp;
                }
            }
            line_temp_2--;
        }
        painter.setBrush(Qt::black);
        painter.drawRect(line_x-55-x*30/1920.0,(line_y+line_temp*10),50,20);
        painter.drawText(QRect(line_x-105-x*30/1920.0,(line_y+line_temp*10),100,20),Qt::AlignRight,QString::number(temp_temp,10));
        line_temp = y*30/1080.0;
        line_temp_1 = y*3/1080.0;
        line_y = flag_1+80;
        line_x = x-(x-y)/2-50;
        int line_temp_3 = temp_temp_1+100;
        line_y_1 = (float)(line_y+line_temp_1*(line_temp_3%10));
        for(int j = 1;j<=200;j++)
        {
            if(line_temp_3%50 ==0)
            {
                painter.drawLine(line_x,line_y_1,line_x+x*30/1920.0,line_y_1);
                painter.drawText(QRect(line_x-70+x*30/1920.0,line_y_1-10,100,20),Qt::AlignRight,QString::number(line_temp_3/10,10));
                line_y_1=line_y_1+line_temp;
            }
            else
            {
                painter.drawLine(line_x,line_y_1,line_x+x*19/1920.0,line_y_1);
                if(line_temp_3%10 ==0)
                {
                    line_y_1=line_y_1+line_temp;
                }
            }
            line_temp_3--;
        }
        painter.setBrush(Qt::black);
        painter.drawRect(line_x+3+x*30/1920.0,(line_y+line_temp*10),50,20);
        painter.drawText(QRect(line_x+3+x*30/1920.0,(line_y+line_temp*10),50,20),Qt::AlignLeft,QString::number(temp_temp_1,10));
        float line_temp_H = y*134/1080.0;
        float line_H_x = x-(x-y)/2.0-line_temp_H*2*(int(temp_temp_2*10)%10/10.0);
        float lint_temp_d = y*20/1080;
        float line_H_y = flag_1-10;
        for(int k =1;k<=7;k++)
        {
            if(k%2!=0)
            {
                painter.drawLine(line_H_x,line_H_y,line_H_x,line_H_y-lint_temp_d);
                painter.drawText(QRect(line_H_x-25,(line_H_y-lint_temp_d-20),50,20),Qt::AlignCenter,QString::number(temp_temp_2,10.0,1));
            }
            else
            {
                painter.drawLine(line_H_x,line_H_y,line_H_x,line_H_y-lint_temp_d/2.0);
            }
            line_H_x = line_H_x-line_temp_H;
        }
        painter.drawPixmap((x-y)/2+112*(y/1080.0),y/2,112*(y/1080.0),124*(y/1080.0),pixmap1);
        painter.drawPixmap((x-y)/2+217*(y/1080.0),y-58*(y/1080.0),434*(y/1080.0),38*(y/1080.0),pixmap2);
        painter.translate((x/2-1),(y/2));
        painter.rotate(angle);
        painter.save();
        painter.drawLine(-220,0,-30,0);
        painter.drawLine(30,0,220,0);
        painter.drawLine(-180*(y/800.0),-150*(y/580.0),-30*(y/800.0),-150*(y/580.0));
        painter.drawLine(-180*(y/800.0),-150*(y/580.0),-180*(y/800.0),-150*(y/580.0)+20);
        painter.drawText(QRect(-230*(y/800.0),-150*(y/580.0),50,20),Qt::AlignCenter,"05");
        painter.drawLine(30*(y/800.0),-150*(y/580.0),180*(y/800.0),-150*(y/580.0));
        painter.drawLine(180*(y/800.0),-150*(y/580.0),180*(y/800.0),-150*(y/580.0)+20);
        painter.drawText(QRect(180*(y/800.0),-150*(y/580.0),50,20),Qt::AlignCenter,"05");
        painter.drawLine(-180*(y/800.0),-300*(y/580.0),-30*(y/800.0),-300*(y/580.0));
        painter.drawLine(-180*(y/800.0),-300*(y/580.0),-180*(y/800.0),-300*(y/580.0)+20);
        painter.drawText(QRect(-230*(y/800.0),-300*(y/580.0),50,20),Qt::AlignCenter,"10");
        painter.drawLine(30*(y/800.0),-300*(y/580.0),180*(y/800.0),-300*(y/580.0));
        painter.drawLine(180*(y/800.0),-300*(y/580.0),180*(y/800.0),-300*(y/580.0)+20);
        painter.drawText(QRect(180*(y/800.0),-300*(y/580.0),50,20),Qt::AlignCenter,"10");
//        painter.setPen(QPen(Qt::green,2.0,Qt::DotLine));
        painter.drawLine(-180*(y/800.0),150*(y/580.0),-30*(y/800.0),150*(y/580.0));
        painter.drawLine(-180*(y/800.0),150*(y/580.0),-180*(y/800.0),150*(y/580.0)-20);
        painter.drawText(QRect(-230*(y/800.0),150*(y/580.0),50,20),Qt::AlignCenter,"-05");
        painter.drawLine(30*(y/800.0),150*(y/580.0),180*(y/800.0),150*(y/580.0));
        painter.drawLine(180*(y/800.0),150*(y/580.0),180*(y/800.0),150*(y/580.0)-20);
        painter.drawText(QRect(180*(y/800.0),150*(y/580.0),50,20),Qt::AlignCenter,"-05");
        painter.drawLine(-180*(y/800.0),300*(y/580.0),-30*(y/800.0),300*(y/580.0));
        painter.drawLine(-180*(y/800.0),300*(y/580.0),-180*(y/800.0),300*(y/580.0)-20);
        painter.drawText(QRect(-230*(y/800.0),300*(y/580.0),50,20),Qt::AlignCenter,"-10");
        painter.drawLine(30*(y/800.0),300*(y/580.0),180*(y/800.0),300*(y/580.0));
        painter.drawLine(180*(y/800.0),300*(y/580.0),180*(y/800.0),300*(y/580.0)-20);
        painter.drawText(QRect(180*(y/800.0),300*(y/580.0),50,20),Qt::AlignCenter,"-10");
        painter.restore();
    }
}
void MainWindow::on_action_HUD_G_triggered()
{
    about_d->show();
}


目录
相关文章
|
5月前
|
Web App开发 存储 Linux
Linux(33)Rockchip RK3568 Ubuntu22.04上通过SSH运行Qt程序和关闭Chrome的密钥提示
Linux(33)Rockchip RK3568 Ubuntu22.04上通过SSH运行Qt程序和关闭Chrome的密钥提示
412 0
|
5月前
【QT】读写.ini配置文件的程序实现
【QT】读写.ini配置文件的程序实现
|
3月前
|
Linux iOS开发 开发者
Qt问题(二):无法定位程序输入点于动态链接库
动态链接库(Dynamic Link Library,简称DLL)是一种可执行文件格式,常见于Windows操作系统中,而在Linux和macOS等其他操作系统中,相似的概念通常被称为共享库(Shared Library)。动态链接库允许程序在运行时加载所需的代码和数据,而不是在编译时静态链接到应用程序中。这种方式带来了几个重要的优点:
381 3
|
28天前
|
C语言 Android开发 C++
基于MTuner软件进行qt的mingw编译程序的内存泄漏检测
本文介绍了使用MTuner软件进行Qt MinGW编译程序的内存泄漏检测的方法,提供了MTuner的下载链接和测试代码示例,并通过将Debug程序拖入MTuner来定位内存泄漏问题。
基于MTuner软件进行qt的mingw编译程序的内存泄漏检测
|
5月前
|
开发框架 自然语言处理 Linux
Qt:构建强大跨平台应用程序的框架
Qt:构建强大跨平台应用程序的框架
|
3月前
|
调度
【浅入浅出】Qt多线程机制解析:提升程序响应性与并发处理能力
在学习QT线程的时候我们首先要知道的是QT的主线程,也叫GUI线程,意如其名,也就是我们程序的最主要的一个线程,主要负责初始化界面并监听事件循环,并根据事件处理做出界面上的反馈。但是当我们只限于在一个主线程上书写逻辑时碰到了需要一直等待的事件该怎么办?它的加载必定会带着主界面的卡顿,这时候我们就要去使用多线程。
140 6
|
5月前
|
C++
QT第一个程序命名空间详解,解释ui_widget的和xxx.cpp的联系
QT第一个程序命名空间详解,解释ui_widget的和xxx.cpp的联系
99 0
|
5月前
|
编译器
QT creator开发环境下 界面更改后运行程序不能实时更新或者在源文件添加该控件后无法编译的问题
在使用QT Creator开发界面的过程中,偶尔会出现添加控件后,运行程序后,界面控件无法更新的情况,或者在源文件使用该控件却出现无法编译的情况,使用QT Creator 4.8.2也会出现这个情况,也不知道这种情况会不会在以后有所改善。
233 0
|
4月前
Qt MainWindow 程序主窗口
Qt MainWindow 程序主窗口