<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Jul 19, 2015 at 9:56 PM, Lubomir I. Ivanov <span dir="ltr"><<a href="mailto:neolit123@gmail.com" target="_blank">neolit123@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 19 July 2015 at 13:23, Gehad Elrobey <<a href="mailto:gehadelrobey@gmail.com">gehadelrobey@gmail.com</a>> wrote:<br>
><br>
><br>
> On Fri, Jul 17, 2015 at 9:28 PM, Lubomir I. Ivanov <<a href="mailto:neolit123@gmail.com">neolit123@gmail.com</a>><br>
> wrote:<br>
>><br>
>> On 17 July 2015 at 22:17, Lubomir I. Ivanov <<a href="mailto:neolit123@gmail.com">neolit123@gmail.com</a>> wrote:<br>
<span class="">>> > On 17 July 2015 at 22:10, Gehad Elrobey <<a href="mailto:gehadelrobey@gmail.com">gehadelrobey@gmail.com</a>> wrote:<br>
>> >><br>
>> >> Yes it does, you can test it on current master.<br>
>> >><br>
>> ><br>
>> ><br>
>> > this is technically a Qt bug of sorts, because the QPrintEngine<br>
>> > greyscale property for some *very odd* doesn't work in the preview<br>
>> > dialog.<br>
>><br>
>> (edit) "some *very odd* reason".<br>
>><br>
>> will need to go AFK in a bit; drop me a line when you need me to<br>
>> review again - e.g. tomorrow.<br>
><br>
><br>
> I have fixed the gray-scale issue as we discussed, Now we always use<br>
> QPrinter::setColorMode() during actual printing which produce nice grayscale<br>
> prints, and use the css filter with the profile rasterization only during<br>
> the previewing in the QPrintPreviewDialog with grayscale selected, I pushed<br>
> the updates to my branch.<br>
><br>
<br>
</span>just pulled the latest commits (at 185eff2a60).<br>
<br>
the preview works as expected - rasterized when greyscale and vector<br>
when in color.<br>
but the actual print always ends in color for me (table and profile)!<br>
<br>
looking at the code the branch here is entered correctly:<br>
<br>
if (printOptions->color_selected && printerPtr->colorMode()) {<br>
    printerPtr->setColorMode(QPrinter::Color);<br>
} else {<br>
    printerPtr->setColorMode(QPrinter::GrayScale); // <-------------<br>
this is called when "print in color" is unchecked<br>
}<br>
<br>
but setColorMode() simply doesn't work!<br>
are you sure this works for you?<br>
if it works for you but not for me, it could be Qt version specific in<br>
which case setColorMode() is *completely unreliable* and we need to<br>
use the raster/greyscale/css thing for the actual print as well.<br>
<br></blockquote><div><br></div><div>Yes, setColorMode works fine for me using Qt 5.5.0 on arch linux, I have attached a colored and gray-scale printouts with the current settings.<br></div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
BTW there is something very annoying in cmake and we need to fix that...<br>
<br>
sometimes(tm) it fails randomly for me in an absolutely clean build with:<br>
<br>
In file included from qt-models\filtermodels.cpp:2:0:<br>
qt-ui/mainwindow.h:15:27: fatal error: ui_mainwindow.h: No suc<br>
h file or directory<br>
 #include "ui_mainwindow.h"<br>
<br>
my set of commands are:<br>
mkdir ./build<br>
cd ./build<br>
cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Debug<br>
-DUSE_LIBGIT23_API=1 -DCMAKE_C_FLAGS="-Wall" -DCMAKE_CXX_FLAGS="-Wall"<br>
-DCMAKE_COLOR_MAKEFILE=0 -DLIBGRANTLEE_FROM_PKGCONFIG=1<br>
-DLIBGIT2_FROM_PKGCONFIG=1 -DLIBDC_FROM_PKGCONFIG=1 -DNO_DOCS=1<br>
-DNO_MARBLE=1 -DNO_TESTS=1 -DNO_PRINTING=0 ..<br>
make -j4<br>
<br>
if for some reason it doesn't end up with the ui_mainwindow.h, it<br>
builds correctly but then if i decide to change something in a source<br>
file e.g. printer.cpp and try to call 'make'.<br>
it throws this:<br>
CMakeFiles\printing_templatesLink.dir\build.make:48: recipe for target 'CMakeFil<br>
es/printing_templatesLink' failed<br>
make[2]: *** [CMakeFiles/printing_templatesLink] Error 1<br>
CMakeFiles\Makefile2:215: recipe for target 'CMakeFiles/printing_templatesLink.d<br>
ir/all' failed<br>
make[1]: *** [CMakeFiles/printing_templatesLink.dir/all] Error 2<br>
<br>
and i need to clean *the entire* build folder and rebuild the entire tree again!<br>
i can't call that an efficient build system...<br>
<br>
you can try asking on IRC why these errors are happening if no one<br>
responds in this thread.<br>
my guess is that not many people are building with NO_PRINTING=0, ATM.<br></blockquote><div><br></div><div>I ll try to figure out this. </div></div><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr">regards,</div></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><div dir="ltr"><div>Gehad</div></div></div></blockquote></div></div>
</div></div>