[clazy] [Bug 403195] New: New check: warn on hidpi issues
Nyall Dawson
bugzilla_noreply at kde.org
Sun Jan 13 23:05:13 GMT 2019
https://bugs.kde.org/show_bug.cgi?id=403195
Bug ID: 403195
Summary: New check: warn on hidpi issues
Product: clazy
Version: unspecified
Platform: Other
OS: Linux
Status: REPORTED
Severity: wishlist
Priority: NOR
Component: general
Assignee: unassigned-bugs at kde.org
Reporter: nyall.dawson at gmail.com
CC: smartins at kde.org
Target Milestone: ---
I've been working on a large, legacy code base recently on a hi-dpi display.
This application is completely un-hdp-friendly, due to a multitude of fixed
sizes being set in pixels.
This had me thinking of a possible clazy check which would automatically flag
potential hi-dpi issues. A super-basic version of the check could flag whenever
calls to methods which set sizes (e.g. QWidget::setFixedSize,
QTreeView::setColumnWidth, etc) are called with literal size values. I.e. flag
a call to widget->setFixedSize( 16, 16 ), but not widget->setFixedSize(
someVariable, someVariable ). (even if someVariable is a const value such as
const int someVariable = 16; --- this would definitely be a very rough check
only!)
A more advanced check could detect if the arguments to the sizing methods use a
variable which has been set based on a result from a QFontMetrics/QFontMetricsF
call -- and throw the warning if this ISN'T the case.
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the Unassigned-bugs
mailing list