[Interest] Qt equivalent for Windows' PathCompactPath function?

Frédéric Martinsons frederic.martinsons at sigfox.com
Fri Sep 5 08:24:29 CEST 2014


Hello,

QFontMetrics::elidedText seems match your needs. See
http://qt-project.org/doc/qt-5/qfontmetrics.html#elidedText


2014-09-04 1:43 GMT+02:00 Sascha Offe <sascha.offe.x at gmail.com>:

> Hi,
>
> does Qt have something similar to Windows' PathCompactPath function
> <http://msdn.microsoft.com/en-us/library/windows/desktop/bb773575> for
> shortening a displayed file path?
>
> (After my quick search on the web, it seems not...)
>
> Example:
> | The un-truncated path is                C:\path1\path2\sample.txt
> | The truncated path at 125 pixels is :   C:\path1\...\sample.txt
> | The truncated path at 120 pixels is :   C:\pat...\sample.txt
>
> Thanks,
>         Sascha
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20140905/3822e58d/attachment.html>


More information about the Interest mailing list