hi, in qt embeded, have an function change pixel to inch or mm. before i check qt assisent, i find a QScreen class, it have some information about screen, but i don't know how to use it, anyone have an exam. thanks.
hi, in qt embeded, have an function change pixel to inch or mm. before i check qt assisent, i find a QScreen class, it have some information about screen, but i don't know how to use it, anyone have an exam. thanks.
Use the QPainter to get the QPaintDevice and then use the various metrics it provides. These may not be entirely reliable though.
First take a look at this thread
http://www.qtcentre.org/threads/1559...een-pixel-size
then if you can't get it
Qt Code:
int PixelWidthDimension = myWidget->logicalDpiX(); //width dots per inch int PixelHeightDimesion = myWidget->logicalDpiY(); //width dots per inch double inch = (double)myWidthInPixel / (double)PixelWidthDimension;To copy to clipboard, switch view to plain text mode
thank you, i have finish my program, thanks your help.
Bookmarks