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-b...@kde.org
          Reporter: nyall.daw...@gmail.com
                CC: smart...@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 watching all bug changes.

Reply via email to