diff --git a/bin/syncqt.pl b/bin/syncqt.pl
index 6b8d847a78202317982ee6280ac6f2de9e79fcc1..faa39aa351f0d4e4eb28347e132c5b2236a1a36b 100755
--- a/bin/syncqt.pl
+++ b/bin/syncqt.pl
@@ -1004,6 +1004,9 @@ foreach my $lib (@modules_to_sync) {
                         my $clean_header;
                         my $iheader = $subdir . "/" . $header;
                         $iheader =~ s/^\Q$basedir\E/$out_basedir/ if ($shadow);
+                        if ($check_includes) {
+                            check_header($lib, $header, $iheader, $public_header, !$public_header && !$qpa_header);
+                        }
                         my @classes = $public_header && (!$minimal && $is_qt) ? classNames($iheader, \$clean_header) : ();
                         if($showonly) {
                             print "$header [$lib]\n";
@@ -1201,41 +1204,4 @@ foreach my $lib (@modules_to_sync) {
     }
 }
 
-if($check_includes) {
-    foreach my $lib (@modules_to_sync) {
-        next if ($modules{$lib} =~ /^!/);
-            #calc subdirs
-            my @subdirs = listSubdirs(map { s/^\^//; $_ } split(/;/, $modules{$lib}));
-
-            foreach my $subdir (@subdirs) {
-                my @headers = findFiles($subdir, "^[-a-z0-9_]*\\.h\$" , 0);
-                foreach my $header (@headers) {
-                    $header = 0 if($header =~ /^ui_.*.h/);
-                    $header = 0 if ($header eq lc($lib)."version.h");
-                    foreach (@ignore_headers) {
-                        $header = 0 if($header eq $_);
-                    }
-                    if($header) {
-                        # We need both $public_header and $private_header because QPA headers count as neither
-                        my $public_header = $header;
-                        my $private_header = 0;
-                        if($public_header =~ /_p.h$/ || $public_header =~ /_pch.h$/) {
-                            $public_header = 0;
-                            $private_header = $header =~ /_p.h$/ && $subdir !~ /3rdparty/
-                        } elsif (isQpaHeader($public_header)) {
-                            $public_header = 0;
-                        } else {
-                            foreach (@ignore_for_master_contents) {
-                                $public_header = 0 if($header eq $_);
-                            }
-                        }
-
-                        my $iheader = $subdir . "/" . $header;
-                        check_header($lib, $header, $iheader, $public_header, $private_header);
-                    }
-                }
-            }
-    }
-}
-
 exit 0;