Home > Mobile >  QT display picture memory footprint is very large
QT display picture memory footprint is very large

Time:09-18

Written in Qt graphical interface program, the interface, USES a lot of pictures, use resource files and setStyleSheet display, run on Windows and ARM, respectively, in about 80 MB of memory on the Windows, can normal boot, but on the ARM, can not start properly, an error: QImage: out of memory, returning null image, removing part of the interface, you can start, but memory footprint is very big also, time is very long, excuse me what reason?

CodePudding user response:

Windows 80 m, the ARM is also similar, no code, can't help, consider a memory leak, such as the event called the event, function calls, such as its unlimited,

CodePudding user response:

It step by step screen which is a problem with the interface

CodePudding user response:

If a few small images, in the resource doesn't matter; Picture amount is large, put them out from the resources of the executable file, create a directory to store pictures alone,

CodePudding user response:

Optimization, and the hardware also has a certain relationship

CodePudding user response:

The specific use how many pictures
Is how to use the
Post all analysis for you

CodePudding user response:

First, the resolution to show down; Second, release memory remember, don't let the cat out of the,

CodePudding user response:

Simple say is: use less translucent, little with irregular shape, dynamic creating/closed, simple effect are replaced with QSS,

Details:
Resource files too much time to consider don't create too much at startup interface, each time you need to use interface new, when not close off rather than hide, other resource files can use QImage processing according to the size of the actually to show once again set to the control, the effect of some simple images such as gradients can use QPainter or QSS to achieve, but it does have its downside, when opening a new interface requires a certain time, another picture if it is PNG format takes up memory will be much larger than the JPG format, so use less, then there is the window and controls, the same interface, rounded corners and not rounded corners have certain gap,

CodePudding user response:

See how much you bat memory? Combined with practical application analysis

CodePudding user response:

reference separated sugar reply: 3/f
if a few small images, in the resource doesn't matter; Picture amount is large, put them out from the resources of the executable file, create a directory to store pictures alone,


If you can speak more detailed point?

I put the QRC files to RCC runtime loading, executable files less than 1 m, but after loading the main interface, process more than 500 m memory, don't know what's the matter,
  •  Tags:  
  • Qt
  • Related