Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QPainter::drawLines does not always give the same output as multiple calls to QPainter::drawLine



  • In Qt 5.12.3 on Windows, given a number of lines to draw, a QPainter instance seems to give different output between a single call to drawLines and iterative calls to drawLine. In the case of drawLines, some of the lines were not visibly rendered at all. Has anyone encountered this issue before?

    Here is a minimal reproduction - the vast number of lines is a set of data known to produce the issue, and removing lines made the issue more difficult to observe. The output of iterative calls to drawLine is displayed in green, while that of a single call to drawLines is displayed in red.

    #include <QtWidgets>
    
    class Widget : public QWidget
    {
    public:
        Widget(QWidget *parent = 0) :
            QWidget(parent)
        {
            resize(600, 300);
        }
    
    protected:
        void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE
        {
            QVector<QLineF> lines;
            lines.append(QLineF(0.0000000000000000, 46.504257202148438, 1.0000000000000000, 46.504257202148438));
            lines.append(QLineF(1.0000000000000000, 46.502838134765625, 2.0000000000000000, 46.502838134765625));
            lines.append(QLineF(2.0000000000000000, 46.498580932617188, 2.0000000000000000, 46.485809326171875));
            lines.append(QLineF(3.0000000000000000, 46.494323730468750, 3.0000000000000000, 46.473037719726563));
            lines.append(QLineF(4.0000000000000000, 46.498580932617188, 4.0000000000000000, 46.471618652343750));
            lines.append(QLineF(5.0000000000000000, 46.508514404296875, 5.0000000000000000, 46.485809326171875));
            lines.append(QLineF(6.0000000000000000, 46.528381347656250, 6.0000000000000000, 46.487228393554688));
            lines.append(QLineF(7.0000000000000000, 46.531219482421875, 7.0000000000000000, 46.480133056640625));
            lines.append(QLineF(8.0000000000000000, 46.507095336914063, 8.0000000000000000, 46.473037719726563));
            lines.append(QLineF(9.0000000000000000, 46.507095336914063, 9.0000000000000000, 46.468780517578125));
            lines.append(QLineF(10.000000000000000, 46.509933471679688, 10.000000000000000, 46.453170776367188));
            lines.append(QLineF(11.000000000000000, 46.589404016733170, 11.000000000000000, 46.491485595703125));
            lines.append(QLineF(12.000000000000000, 46.614947229623795, 12.000000000000000, 46.532638549804688));
            lines.append(QLineF(13.000000000000000, 46.555346399545670, 13.000000000000000, 46.467361450195313));
            lines.append(QLineF(14.000000000000000, 46.495742797851563, 14.000000000000000, 46.436141967773438));
            lines.append(QLineF(15.000000000000000, 46.529800415039063, 15.000000000000000, 46.437561035156250));
            lines.append(QLineF(16.000000000000000, 46.644750416278839, 16.000000000000000, 46.512771606445313));
            lines.append(QLineF(17.000000000000000, 46.637655079364777, 17.000000000000000, 46.561022669076920));
            lines.append(QLineF(18.000000000000000, 46.606432825326920, 18.000000000000000, 46.519866943359375));
            lines.append(QLineF(19.000000000000000, 46.556765466928482, 19.000000000000000, 46.421951293945313));
            lines.append(QLineF(20.000000000000000, 46.467361450195313, 20.000000000000000, 46.380792796611786));
            lines.append(QLineF(21.000000000000000, 46.517028808593750, 21.000000000000000, 46.410598754882813));
            lines.append(QLineF(22.000000000000000, 46.502838134765625, 22.000000000000000, 46.426208496093750));
            lines.append(QLineF(23.000000000000000, 46.492904663085938, 23.000000000000000, 46.362344920635223));
            lines.append(QLineF(24.000000000000000, 46.484390258789063, 24.000000000000000, 46.359506785869598));
            lines.append(QLineF(25.000000000000000, 46.511352539062500, 25.000000000000000, 46.396402537822723));
            lines.append(QLineF(26.000000000000000, 46.525543212890625, 26.000000000000000, 46.394983470439911));
            lines.append(QLineF(27.000000000000000, 46.668874561786652, 27.000000000000000, 46.512771606445313));
            lines.append(QLineF(28.000000000000000, 46.670293629169464, 28.000000000000000, 46.481552124023438));
            lines.append(QLineF(29.000000000000000, 46.578051477670670, 29.000000000000000, 46.485809326171875));
            lines.append(QLineF(30.000000000000000, 46.612109094858170, 30.000000000000000, 46.495742797851563));
            lines.append(QLineF(31.000000000000000, 46.548251062631607, 31.000000000000000, 46.380792796611786));
            lines.append(QLineF(32.000000000000000, 46.420532226562500, 32.000000000000000, 46.243143260478973));
            lines.append(QLineF(33.000000000000000, 46.573794275522232, 33.000000000000000, 46.305582225322723));
            lines.append(QLineF(34.000000000000000, 46.776726454496384, 34.000000000000000, 46.484390258789063));
            lines.append(QLineF(35.000000000000000, 46.800850600004196, 35.000000000000000, 46.620623499155045));
            lines.append(QLineF(36.000000000000000, 46.783821791410446, 36.000000000000000, 46.654683887958527));
            lines.append(QLineF(37.000000000000000, 46.769631117582321, 37.000000000000000, 46.563860803842545));
            lines.append(QLineF(38.000000000000000, 46.710027515888214, 38.000000000000000, 46.482971191406250));
            lines.append(QLineF(39.000000000000000, 46.657522022724152, 39.000000000000000, 46.430465698242188));
            lines.append(QLineF(40.000000000000000, 46.529800415039063, 40.000000000000000, 46.196308493614197));
            lines.append(QLineF(41.000000000000000, 46.278619945049286, 41.000000000000000, 46.050144553184509));
            lines.append(QLineF(42.000000000000000, 46.336801707744598, 42.000000000000000, 46.102650046348572));
            lines.append(QLineF(43.000000000000000, 46.576632410287857, 43.000000000000000, 46.265848338603973));
            lines.append(QLineF(44.000000000000000, 46.657522022724152, 44.000000000000000, 46.500000000000000));
            lines.append(QLineF(45.000000000000000, 47.883632272481918, 45.000000000000000, 46.569537073373795));
            lines.append(QLineF(46.000000000000000, 55.956953287124634, 46.000000000000000, 48.065278440713882));
            lines.append(QLineF(47.000000000000000, 54.759224385023117, 47.000000000000000, 27.102174818515778));
            lines.append(QLineF(48.000000000000000, 43.287131667137146, 48.000000000000000, 23.924788713455200));
            lines.append(QLineF(49.000000000000000, 56.395458966493607, 49.000000000000000, 44.169819295406342));
            lines.append(QLineF(50.000000000000000, 57.884104996919632, 50.000000000000000, 55.793754994869232));
            lines.append(QLineF(51.000000000000000, 55.810783803462982, 51.000000000000000, 46.839168190956116));
            lines.append(QLineF(52.000000000000000, 46.400659739971161, 52.000000000000000, 43.900190949440002));
            lines.append(QLineF(53.000000000000000, 45.004258632659912, 53.000000000000000, 43.035951197147369));
            lines.append(QLineF(54.000000000000000, 43.883162140846252, 54.000000000000000, 42.177387714385986));
            lines.append(QLineF(55.000000000000000, 46.383630931377411, 55.000000000000000, 43.807946026325226));
            lines.append(QLineF(56.000000000000000, 47.633868098258972, 56.000000000000000, 45.815987348556519));
            lines.append(QLineF(57.000000000000000, 49.905867040157318, 57.000000000000000, 47.686376363039017));
            lines.append(QLineF(58.000000000000000, 49.630556881427765, 58.000000000000000, 47.626772761344910));
            lines.append(QLineF(59.000000000000000, 47.703405171632767, 59.000000000000000, 45.307944595813751));
            lines.append(QLineF(60.000000000000000, 45.605959832668304, 60.000000000000000, 44.811259925365448));
            lines.append(QLineF(61.000000000000000, 44.975877285003662, 61.000000000000000, 42.737935960292816));
            lines.append(QLineF(62.000000000000000, 44.818355262279510, 62.000000000000000, 42.428573727607727));
            lines.append(QLineF(63.000000000000000, 47.755913436412811, 63.000000000000000, 44.765844225883484));
            lines.append(QLineF(64.000000000000000, 48.696782827377319, 64.000000000000000, 47.814095199108124));
            lines.append(QLineF(65.000000000000000, 48.170292198657990, 65.000000000000000, 46.856196999549866));
            lines.append(QLineF(66.000000000000000, 47.692052632570267, 66.000000000000000, 46.739830702543259));
            lines.append(QLineF(67.000000000000000, 48.089405357837677, 67.000000000000000, 46.908702492713928));
            lines.append(QLineF(68.000000000000000, 46.792336195707321, 68.000000000000000, 45.664141595363617));
            lines.append(QLineF(69.000000000000000, 47.435193121433258, 69.000000000000000, 46.149479269981384));
            lines.append(QLineF(70.000000000000000, 47.201041460037231, 70.000000000000000, 46.458847045898438));
            lines.append(QLineF(71.000000000000000, 47.802742660045624, 71.000000000000000, 46.704351246356964));
            lines.append(QLineF(72.000000000000000, 48.246924608945847, 72.000000000000000, 47.791390120983124));
            lines.append(QLineF(73.000000000000000, 47.772942245006561, 73.000000000000000, 46.488647460937500));
            lines.append(QLineF(74.000000000000000, 46.657522022724152, 74.000000000000000, 45.652789056301117));
            lines.append(QLineF(75.000000000000000, 45.635760247707367, 75.000000000000000, 44.117313802242279));
            lines.append(QLineF(76.000000000000000, 47.137180656194687, 76.000000000000000, 44.250711679458618));
            lines.append(QLineF(77.000000000000000, 47.802742660045624, 77.000000000000000, 47.223746538162231));
            lines.append(QLineF(78.000000000000000, 47.317407757043839, 78.000000000000000, 45.671236932277679));
            lines.append(QLineF(79.000000000000000, 45.705300092697144, 79.000000000000000, 44.741720080375671));
            lines.append(QLineF(80.000000000000000, 45.798958539962769, 80.000000000000000, 44.543045103549957));
            lines.append(QLineF(81.000000000000000, 46.173603415489197, 81.000000000000000, 45.793282270431519));
            lines.append(QLineF(82.000000000000000, 46.715703785419464, 82.000000000000000, 45.769158124923706));
            lines.append(QLineF(83.000000000000000, 47.943235874176025, 83.000000000000000, 46.704351246356964));
            lines.append(QLineF(84.000000000000000, 47.890727609395981, 84.000000000000000, 46.734154433012009));
            lines.append(QLineF(85.000000000000000, 46.826396584510803, 85.000000000000000, 46.237466990947723));
            lines.append(QLineF(86.000000000000000, 47.019395291805267, 86.000000000000000, 46.307001292705536));
            lines.append(QLineF(87.000000000000000, 47.131504386663437, 87.000000000000000, 46.798012465238571));
            lines.append(QLineF(88.000000000000000, 47.054871976375580, 88.000000000000000, 46.488647460937500));
            lines.append(QLineF(89.000000000000000, 46.663198292255402, 89.000000000000000, 46.470199584960938));
            lines.append(QLineF(90.000000000000000, 47.171238273382187, 90.000000000000000, 46.219013571739197));
            lines.append(QLineF(91.000000000000000, 47.814095199108124, 91.000000000000000, 47.148533195257187));
            lines.append(QLineF(92.000000000000000, 47.738884627819061, 92.000000000000000, 46.394983470439911));
            lines.append(QLineF(93.000000000000000, 46.436141967773438, 93.000000000000000, 45.495267033576965));
            lines.append(QLineF(94.000000000000000, 47.025071561336517, 94.000000000000000, 45.547778069972992));
            lines.append(QLineF(95.000000000000000, 47.540206879377365, 95.000000000000000, 46.768212050199509));
            lines.append(QLineF(96.000000000000000, 46.803688734769821, 96.000000000000000, 45.056764125823975));
            lines.append(QLineF(97.000000000000000, 45.116364955902100, 97.000000000000000, 44.496215879917145));
            lines.append(QLineF(98.000000000000000, 45.828758955001831, 98.000000000000000, 44.852412879467010));
            lines.append(QLineF(99.000000000000000, 46.260172069072723, 99.000000000000000, 45.823082685470581));
            lines.append(QLineF(100.00000000000000, 46.061497092247009, 100.00000000000000, 45.776253461837769));
            lines.append(QLineF(101.00000000000000, 46.925734072923660, 101.00000000000000, 45.933775484561920));
            lines.append(QLineF(102.00000000000000, 47.714757710695267, 102.00000000000000, 46.850520730018616));
            lines.append(QLineF(103.00000000000000, 47.639547139406204, 103.00000000000000, 47.148533195257187));
            lines.append(QLineF(104.00000000000000, 47.767265975475311, 104.00000000000000, 47.171238273382187));
            lines.append(QLineF(105.00000000000000, 47.621096491813660, 105.00000000000000, 46.412017822265625));
            lines.append(QLineF(106.00000000000000, 46.412017822265625, 106.00000000000000, 46.096973776817322));
            lines.append(QLineF(107.00000000000000, 46.780983656644821, 107.00000000000000, 46.226108908653259));
            lines.append(QLineF(108.00000000000000, 47.545885920524597, 108.00000000000000, 46.792336195707321));
            lines.append(QLineF(109.00000000000000, 47.797066390514374, 109.00000000000000, 47.422421514987946));
            lines.append(QLineF(110.00000000000000, 47.516082733869553, 110.00000000000000, 46.441818237304688));
            lines.append(QLineF(111.00000000000000, 46.522705078125000, 111.00000000000000, 45.513720452785492));
            lines.append(QLineF(112.00000000000000, 45.571902215480804, 112.00000000000000, 45.154685318470001));
            lines.append(QLineF(113.00000000000000, 45.685433149337769, 113.00000000000000, 45.410122990608215));
            lines.append(QLineF(114.00000000000000, 46.224689841270447, 114.00000000000000, 45.536425530910492));
            lines.append(QLineF(115.00000000000000, 46.562441736459732, 115.00000000000000, 46.230371654033661));
            lines.append(QLineF(116.00000000000000, 46.732735365629196, 116.00000000000000, 46.494323730468750));
            lines.append(QLineF(117.00000000000000, 46.736992567777634, 117.00000000000000, 46.579470545053482));
            lines.append(QLineF(118.00000000000000, 47.050614774227142, 118.00000000000000, 46.568118005990982));
            lines.append(QLineF(119.00000000000000, 46.999528348445892, 119.00000000000000, 46.617785364389420));
            lines.append(QLineF(120.00000000000000, 46.894511818885803, 120.00000000000000, 46.667455494403839));
            lines.append(QLineF(121.00000000000000, 47.009461820125580, 121.00000000000000, 46.822139382362366));
            lines.append(QLineF(122.00000000000000, 47.029328763484955, 122.00000000000000, 46.746926039457321));
            lines.append(QLineF(123.00000000000000, 46.873225808143616, 123.00000000000000, 46.041624605655670));
            lines.append(QLineF(124.00000000000000, 46.282877147197723, 124.00000000000000, 45.895460665225983));
            lines.append(QLineF(125.00000000000000, 46.500000000000000, 125.00000000000000, 46.207661032676697));
            lines.append(QLineF(126.00000000000000, 46.934248477220535, 126.00000000000000, 46.461685180664063));
            lines.append(QLineF(127.00000000000000, 47.057710111141205, 127.00000000000000, 46.772469252347946));
            lines.append(QLineF(128.00000000000000, 46.830653786659241, 128.00000000000000, 46.542572021484375));
            lines.append(QLineF(129.00000000000000, 46.606432825326920, 129.00000000000000, 46.309839427471161));
            lines.append(QLineF(130.00000000000000, 46.441818237304688, 130.00000000000000, 46.295648753643036));
            lines.append(QLineF(131.00000000000000, 46.578051477670670, 131.00000000000000, 46.289972484111786));
            lines.append(QLineF(132.00000000000000, 46.775307387113571, 132.00000000000000, 46.583727747201920));
            lines.append(QLineF(133.00000000000000, 46.701513111591339, 133.00000000000000, 46.484390258789063));
            lines.append(QLineF(134.00000000000000, 46.505676269531250, 134.00000000000000, 46.156574606895447));
            lines.append(QLineF(135.00000000000000, 46.193470358848572, 135.00000000000000, 45.976347506046295));
            lines.append(QLineF(136.00000000000000, 46.186375021934509, 136.00000000000000, 45.989119112491608));
            lines.append(QLineF(137.00000000000000, 46.238886058330536, 137.00000000000000, 46.047306418418884));
            lines.append(QLineF(138.00000000000000, 46.250238597393036, 138.00000000000000, 45.997633516788483));
            lines.append(QLineF(139.00000000000000, 46.573794275522232, 139.00000000000000, 46.180698752403259));
            lines.append(QLineF(140.00000000000000, 46.820720314979553, 140.00000000000000, 46.519866943359375));
            lines.append(QLineF(141.00000000000000, 46.942762881517410, 141.00000000000000, 46.641912281513214));
            lines.append(QLineF(142.00000000000000, 46.710027515888214, 142.00000000000000, 46.251657664775848));
            lines.append(QLineF(143.00000000000000, 46.602175623178482, 143.00000000000000, 46.247400462627411));
            lines.append(QLineF(144.00000000000000, 46.739830702543259, 144.00000000000000, 46.528381347656250));
            lines.append(QLineF(145.00000000000000, 46.978239566087723, 145.00000000000000, 46.715703785419464));
            lines.append(QLineF(146.00000000000000, 46.976820498704910, 146.00000000000000, 46.708608448505402));
            lines.append(QLineF(147.00000000000000, 46.765373915433884, 147.00000000000000, 46.274362742900848));
            lines.append(QLineF(148.00000000000000, 46.363763988018036, 148.00000000000000, 46.184955954551697));
            lines.append(QLineF(149.00000000000000, 46.500000000000000, 149.00000000000000, 46.257333934307098));
            lines.append(QLineF(150.00000000000000, 46.569537073373795, 150.00000000000000, 46.426208496093750));
            lines.append(QLineF(151.00000000000000, 46.467361450195313, 151.00000000000000, 46.233209788799286));
            lines.append(QLineF(152.00000000000000, 46.763954848051071, 152.00000000000000, 46.284296214580536));
            lines.append(QLineF(153.00000000000000, 46.983915835618973, 153.00000000000000, 46.700094044208527));
            lines.append(QLineF(154.00000000000000, 46.928572207689285, 154.00000000000000, 46.719960987567902));
            lines.append(QLineF(155.00000000000000, 46.792336195707321, 155.00000000000000, 46.187794089317322));
            lines.append(QLineF(156.00000000000000, 46.254495799541473, 156.00000000000000, 46.034529268741608));
            lines.append(QLineF(157.00000000000000, 46.148060202598572, 157.00000000000000, 46.008986055850983));
            lines.append(QLineF(158.00000000000000, 46.468780517578125, 158.00000000000000, 46.091297507286072));
            lines.append(QLineF(159.00000000000000, 46.517028808593750, 159.00000000000000, 46.399240672588348));
            lines.append(QLineF(160.00000000000000, 46.512771606445313, 160.00000000000000, 46.417694091796875));
            lines.append(QLineF(161.00000000000000, 46.778145521879196, 161.00000000000000, 46.436141967773438));
            lines.append(QLineF(162.00000000000000, 47.280512005090714, 162.00000000000000, 46.795174330472946));
            lines.append(QLineF(163.00000000000000, 47.303217083215714, 163.00000000000000, 47.047776639461517));
            lines.append(QLineF(164.00000000000000, 47.054871976375580, 164.00000000000000, 46.683065235614777));
            lines.append(QLineF(165.00000000000000, 46.771050184965134, 165.00000000000000, 46.603594690561295));
            lines.append(QLineF(166.00000000000000, 46.640493214130402, 166.00000000000000, 46.508514404296875));
            lines.append(QLineF(167.00000000000000, 46.565279871225357, 167.00000000000000, 46.341058909893036));
            lines.append(QLineF(168.00000000000000, 46.410598754882813, 168.00000000000000, 46.207661032676697));
            lines.append(QLineF(169.00000000000000, 46.289972484111786, 169.00000000000000, 46.165089011192322));
            lines.append(QLineF(170.00000000000000, 46.271524608135223, 170.00000000000000, 46.095554709434509));
            lines.append(QLineF(171.00000000000000, 46.475875854492188, 171.00000000000000, 46.176441550254822));
            lines.append(QLineF(172.00000000000000, 46.551089197397232, 172.00000000000000, 46.448913574218750));
            lines.append(QLineF(173.00000000000000, 46.542572021484375, 173.00000000000000, 46.399240672588348));
            lines.append(QLineF(174.00000000000000, 46.484390258789063, 174.00000000000000, 46.333963572978973));
            lines.append(QLineF(175.00000000000000, 46.561022669076920, 175.00000000000000, 46.387888133525848));
            lines.append(QLineF(176.00000000000000, 46.610690027475357, 176.00000000000000, 46.500000000000000));
            lines.append(QLineF(177.00000000000000, 46.500000000000000, 177.00000000000000, 46.292810618877411));
            lines.append(QLineF(178.00000000000000, 46.660360157489777, 178.00000000000000, 46.338220775127411));
            lines.append(QLineF(179.00000000000000, 46.803688734769821, 179.00000000000000, 46.623461633920670));
            lines.append(QLineF(180.00000000000000, 46.796593397855759, 180.00000000000000, 46.404916942119598));
            lines.append(QLineF(181.00000000000000, 46.444656372070313, 181.00000000000000, 46.254495799541473));
            lines.append(QLineF(182.00000000000000, 46.572375208139420, 182.00000000000000, 46.307001292705536));
            lines.append(QLineF(183.00000000000000, 46.600756555795670, 183.00000000000000, 46.495742797851563));
            lines.append(QLineF(184.00000000000000, 46.592242151498795, 184.00000000000000, 46.474456787109375));
            lines.append(QLineF(185.00000000000000, 46.732735365629196, 185.00000000000000, 46.573794275522232));
            lines.append(QLineF(186.00000000000000, 46.725637257099152, 186.00000000000000, 46.524124145507813));
            lines.append(QLineF(187.00000000000000, 46.559603601694107, 187.00000000000000, 46.403497874736786));
            lines.append(QLineF(188.00000000000000, 46.444656372070313, 188.00000000000000, 46.245981395244598));
            lines.append(QLineF(189.00000000000000, 46.468780517578125, 189.00000000000000, 46.250238597393036));
            lines.append(QLineF(190.00000000000000, 46.519866943359375, 190.00000000000000, 46.436141967773438));
            lines.append(QLineF(191.00000000000000, 46.492904663085938, 191.00000000000000, 46.399240672588348));
            lines.append(QLineF(192.00000000000000, 46.492904663085938, 192.00000000000000, 46.373697459697723));
            lines.append(QLineF(193.00000000000000, 46.512771606445313, 193.00000000000000, 46.424789428710938));
            lines.append(QLineF(194.00000000000000, 46.545410156250000, 194.00000000000000, 46.441818237304688));
            lines.append(QLineF(195.00000000000000, 46.490066528320313, 195.00000000000000, 46.387888133525848));
            lines.append(QLineF(196.00000000000000, 46.538314819335938, 196.00000000000000, 46.397821605205536));
            lines.append(QLineF(197.00000000000000, 46.592242151498795, 197.00000000000000, 46.512771606445313));
            lines.append(QLineF(198.00000000000000, 46.606432825326920, 198.00000000000000, 46.518447875976563));
            lines.append(QLineF(199.00000000000000, 46.697255909442902, 199.00000000000000, 46.528381347656250));
            lines.append(QLineF(200.00000000000000, 46.573794275522232, 200.00000000000000, 46.349573314189911));
            lines.append(QLineF(201.00000000000000, 46.687322437763214, 201.00000000000000, 46.454589843750000));
            lines.append(QLineF(202.00000000000000, 46.749764174222946, 202.00000000000000, 46.663198292255402));
            lines.append(QLineF(203.00000000000000, 46.708608448505402, 203.00000000000000, 46.565279871225357));
            lines.append(QLineF(204.00000000000000, 46.596499353647232, 204.00000000000000, 46.417694091796875));
            lines.append(QLineF(205.00000000000000, 46.461685180664063, 205.00000000000000, 46.316934764385223));
            lines.append(QLineF(206.00000000000000, 46.534057617187500, 206.00000000000000, 46.366602122783661));
            lines.append(QLineF(207.00000000000000, 46.605013757944107, 207.00000000000000, 46.465942382812500));
            lines.append(QLineF(208.00000000000000, 46.606432825326920, 208.00000000000000, 46.522705078125000));
            lines.append(QLineF(209.00000000000000, 46.657522022724152, 209.00000000000000, 46.569537073373795));
            lines.append(QLineF(210.00000000000000, 46.695836842060089, 210.00000000000000, 46.529800415039063));
            lines.append(QLineF(211.00000000000000, 46.556765466928482, 211.00000000000000, 46.380792796611786));
            lines.append(QLineF(212.00000000000000, 46.430465698242188, 212.00000000000000, 46.331125438213348));
            lines.append(QLineF(213.00000000000000, 46.380792796611786, 213.00000000000000, 46.291391551494598));
            lines.append(QLineF(214.00000000000000, 46.363763988018036, 214.00000000000000, 46.284296214580536));
            lines.append(QLineF(215.00000000000000, 46.404916942119598, 215.00000000000000, 46.328287303447723));
            lines.append(QLineF(216.00000000000000, 46.443237304687500, 216.00000000000000, 46.350992381572723));
            lines.append(QLineF(217.00000000000000, 46.673131763935089, 217.00000000000000, 46.433303833007813));
            lines.append(QLineF(218.00000000000000, 46.793755263090134, 218.00000000000000, 46.660360157489777));
            lines.append(QLineF(219.00000000000000, 46.813622206449509, 219.00000000000000, 46.762535780668259));
            lines.append(QLineF(220.00000000000000, 46.813622206449509, 220.00000000000000, 46.698674976825714));
            lines.append(QLineF(221.00000000000000, 46.705770313739777, 221.00000000000000, 46.457427978515625));
            lines.append(QLineF(222.00000000000000, 46.464523315429688, 222.00000000000000, 46.236047923564911));
            lines.append(QLineF(223.00000000000000, 46.257333934307098, 223.00000000000000, 46.169346213340759));
            lines.append(QLineF(224.00000000000000, 46.336801707744598, 224.00000000000000, 46.193470358848572));
            lines.append(QLineF(225.00000000000000, 46.485809326171875, 225.00000000000000, 46.311258494853973));
            lines.append(QLineF(226.00000000000000, 46.654683887958527, 226.00000000000000, 46.451751708984375));
            lines.append(QLineF(227.00000000000000, 46.668874561786652, 227.00000000000000, 46.563860803842545));
            lines.append(QLineF(228.00000000000000, 46.596499353647232, 228.00000000000000, 46.512771606445313));
            lines.append(QLineF(229.00000000000000, 46.556765466928482, 229.00000000000000, 46.491485595703125));
            lines.append(QLineF(230.00000000000000, 46.532638549804688, 230.00000000000000, 46.465942382812500));
            lines.append(QLineF(231.00000000000000, 46.485809326171875, 231.00000000000000, 46.389307200908661));
            lines.append(QLineF(232.00000000000000, 46.420532226562500, 232.00000000000000, 46.365183055400848));
            lines.append(QLineF(233.00000000000000, 46.456008911132813, 233.00000000000000, 46.387888133525848));
            lines.append(QLineF(234.00000000000000, 46.573794275522232, 234.00000000000000, 46.446075439453125));
            lines.append(QLineF(235.00000000000000, 46.646169483661652, 235.00000000000000, 46.575213342905045));
            lines.append(QLineF(236.00000000000000, 46.677388966083527, 236.00000000000000, 46.627718836069107));
            lines.append(QLineF(237.00000000000000, 46.680227100849152, 237.00000000000000, 46.603594690561295));
            lines.append(QLineF(238.00000000000000, 46.613528162240982, 238.00000000000000, 46.453170776367188));
            lines.append(QLineF(239.00000000000000, 46.471618652343750, 239.00000000000000, 46.318353831768036));
            lines.append(QLineF(240.00000000000000, 46.338220775127411, 240.00000000000000, 46.280039012432098));
            lines.append(QLineF(241.00000000000000, 46.448913574218750, 241.00000000000000, 46.329706370830536));
            lines.append(QLineF(242.00000000000000, 46.565279871225357, 242.00000000000000, 46.440399169921875));
            lines.append(QLineF(243.00000000000000, 46.622042566537857, 243.00000000000000, 46.549670130014420));
            lines.append(QLineF(244.00000000000000, 46.622042566537857, 244.00000000000000, 46.559603601694107));
            lines.append(QLineF(245.00000000000000, 46.592242151498795, 245.00000000000000, 46.508514404296875));
            lines.append(QLineF(246.00000000000000, 46.522705078125000, 246.00000000000000, 46.437561035156250));
            lines.append(QLineF(247.00000000000000, 46.470199584960938, 247.00000000000000, 46.420532226562500));
            lines.append(QLineF(248.00000000000000, 46.450332641601563, 248.00000000000000, 46.406336009502411));
            lines.append(QLineF(249.00000000000000, 46.512771606445313, 249.00000000000000, 46.440399169921875));
            
            QPainter painter(this);
            painter.setPen(Qt::green);
            for (int i = 0; i < lines.size(); i++)
            {
                painter.drawLine(lines.at(i));
            }
    
            painter.setPen(Qt::red);
            painter.drawLines(lines.data(), lines.size());
        }
    };
    
    int main(int argc, char *argv[])
    {
        QApplication a(argc, argv);
    
        QPalette palette;
        palette.setColor(QPalette::Background, Qt::black);
    
        Widget w;
        w.setAutoFillBackground(true);
        w.setPalette(palette);
        w.show();
    
        return a.exec();
    }
    
    

  • Moderators

    hi @david_fmod and welcome

    First of, thanks for the working example :) I can confirm the same behavior on my PC.

    if you alternate the drawing, one can clearly see the difference and in my opinion this shouldn't be there.

    class Widget : public QWidget
    {
    public:
        Widget(QWidget *parent = 0) :
            QWidget(parent)
        {
            resize(600, 300);
            lines.append(QLineF(0.0000000000000000, 46.504257202148438, 1.0000000000000000, 46.504257202148438));
            lines.append(QLineF(1.0000000000000000, 46.502838134765625, 2.0000000000000000, 46.502838134765625));
            lines.append(QLineF(2.0000000000000000, 46.498580932617188, 2.0000000000000000, 46.485809326171875));
            lines.append(QLineF(3.0000000000000000, 46.494323730468750, 3.0000000000000000, 46.473037719726563));
            lines.append(QLineF(4.0000000000000000, 46.498580932617188, 4.0000000000000000, 46.471618652343750));
            lines.append(QLineF(5.0000000000000000, 46.508514404296875, 5.0000000000000000, 46.485809326171875));
            lines.append(QLineF(6.0000000000000000, 46.528381347656250, 6.0000000000000000, 46.487228393554688));
            lines.append(QLineF(7.0000000000000000, 46.531219482421875, 7.0000000000000000, 46.480133056640625));
            lines.append(QLineF(8.0000000000000000, 46.507095336914063, 8.0000000000000000, 46.473037719726563));
            lines.append(QLineF(9.0000000000000000, 46.507095336914063, 9.0000000000000000, 46.468780517578125));
            lines.append(QLineF(10.000000000000000, 46.509933471679688, 10.000000000000000, 46.453170776367188));
            lines.append(QLineF(11.000000000000000, 46.589404016733170, 11.000000000000000, 46.491485595703125));
            lines.append(QLineF(12.000000000000000, 46.614947229623795, 12.000000000000000, 46.532638549804688));
            lines.append(QLineF(13.000000000000000, 46.555346399545670, 13.000000000000000, 46.467361450195313));
            lines.append(QLineF(14.000000000000000, 46.495742797851563, 14.000000000000000, 46.436141967773438));
            lines.append(QLineF(15.000000000000000, 46.529800415039063, 15.000000000000000, 46.437561035156250));
            lines.append(QLineF(16.000000000000000, 46.644750416278839, 16.000000000000000, 46.512771606445313));
            lines.append(QLineF(17.000000000000000, 46.637655079364777, 17.000000000000000, 46.561022669076920));
            lines.append(QLineF(18.000000000000000, 46.606432825326920, 18.000000000000000, 46.519866943359375));
            lines.append(QLineF(19.000000000000000, 46.556765466928482, 19.000000000000000, 46.421951293945313));
            lines.append(QLineF(20.000000000000000, 46.467361450195313, 20.000000000000000, 46.380792796611786));
            lines.append(QLineF(21.000000000000000, 46.517028808593750, 21.000000000000000, 46.410598754882813));
            lines.append(QLineF(22.000000000000000, 46.502838134765625, 22.000000000000000, 46.426208496093750));
            lines.append(QLineF(23.000000000000000, 46.492904663085938, 23.000000000000000, 46.362344920635223));
            lines.append(QLineF(24.000000000000000, 46.484390258789063, 24.000000000000000, 46.359506785869598));
            lines.append(QLineF(25.000000000000000, 46.511352539062500, 25.000000000000000, 46.396402537822723));
            lines.append(QLineF(26.000000000000000, 46.525543212890625, 26.000000000000000, 46.394983470439911));
            lines.append(QLineF(27.000000000000000, 46.668874561786652, 27.000000000000000, 46.512771606445313));
            lines.append(QLineF(28.000000000000000, 46.670293629169464, 28.000000000000000, 46.481552124023438));
            lines.append(QLineF(29.000000000000000, 46.578051477670670, 29.000000000000000, 46.485809326171875));
            lines.append(QLineF(30.000000000000000, 46.612109094858170, 30.000000000000000, 46.495742797851563));
            lines.append(QLineF(31.000000000000000, 46.548251062631607, 31.000000000000000, 46.380792796611786));
            lines.append(QLineF(32.000000000000000, 46.420532226562500, 32.000000000000000, 46.243143260478973));
            lines.append(QLineF(33.000000000000000, 46.573794275522232, 33.000000000000000, 46.305582225322723));
            lines.append(QLineF(34.000000000000000, 46.776726454496384, 34.000000000000000, 46.484390258789063));
            lines.append(QLineF(35.000000000000000, 46.800850600004196, 35.000000000000000, 46.620623499155045));
            lines.append(QLineF(36.000000000000000, 46.783821791410446, 36.000000000000000, 46.654683887958527));
            lines.append(QLineF(37.000000000000000, 46.769631117582321, 37.000000000000000, 46.563860803842545));
            lines.append(QLineF(38.000000000000000, 46.710027515888214, 38.000000000000000, 46.482971191406250));
            lines.append(QLineF(39.000000000000000, 46.657522022724152, 39.000000000000000, 46.430465698242188));
            lines.append(QLineF(40.000000000000000, 46.529800415039063, 40.000000000000000, 46.196308493614197));
            lines.append(QLineF(41.000000000000000, 46.278619945049286, 41.000000000000000, 46.050144553184509));
            lines.append(QLineF(42.000000000000000, 46.336801707744598, 42.000000000000000, 46.102650046348572));
            lines.append(QLineF(43.000000000000000, 46.576632410287857, 43.000000000000000, 46.265848338603973));
            lines.append(QLineF(44.000000000000000, 46.657522022724152, 44.000000000000000, 46.500000000000000));
            lines.append(QLineF(45.000000000000000, 47.883632272481918, 45.000000000000000, 46.569537073373795));
            lines.append(QLineF(46.000000000000000, 55.956953287124634, 46.000000000000000, 48.065278440713882));
            lines.append(QLineF(47.000000000000000, 54.759224385023117, 47.000000000000000, 27.102174818515778));
            lines.append(QLineF(48.000000000000000, 43.287131667137146, 48.000000000000000, 23.924788713455200));
            lines.append(QLineF(49.000000000000000, 56.395458966493607, 49.000000000000000, 44.169819295406342));
            lines.append(QLineF(50.000000000000000, 57.884104996919632, 50.000000000000000, 55.793754994869232));
            lines.append(QLineF(51.000000000000000, 55.810783803462982, 51.000000000000000, 46.839168190956116));
            lines.append(QLineF(52.000000000000000, 46.400659739971161, 52.000000000000000, 43.900190949440002));
            lines.append(QLineF(53.000000000000000, 45.004258632659912, 53.000000000000000, 43.035951197147369));
            lines.append(QLineF(54.000000000000000, 43.883162140846252, 54.000000000000000, 42.177387714385986));
            lines.append(QLineF(55.000000000000000, 46.383630931377411, 55.000000000000000, 43.807946026325226));
            lines.append(QLineF(56.000000000000000, 47.633868098258972, 56.000000000000000, 45.815987348556519));
            lines.append(QLineF(57.000000000000000, 49.905867040157318, 57.000000000000000, 47.686376363039017));
            lines.append(QLineF(58.000000000000000, 49.630556881427765, 58.000000000000000, 47.626772761344910));
            lines.append(QLineF(59.000000000000000, 47.703405171632767, 59.000000000000000, 45.307944595813751));
            lines.append(QLineF(60.000000000000000, 45.605959832668304, 60.000000000000000, 44.811259925365448));
            lines.append(QLineF(61.000000000000000, 44.975877285003662, 61.000000000000000, 42.737935960292816));
            lines.append(QLineF(62.000000000000000, 44.818355262279510, 62.000000000000000, 42.428573727607727));
            lines.append(QLineF(63.000000000000000, 47.755913436412811, 63.000000000000000, 44.765844225883484));
            lines.append(QLineF(64.000000000000000, 48.696782827377319, 64.000000000000000, 47.814095199108124));
            lines.append(QLineF(65.000000000000000, 48.170292198657990, 65.000000000000000, 46.856196999549866));
            lines.append(QLineF(66.000000000000000, 47.692052632570267, 66.000000000000000, 46.739830702543259));
            lines.append(QLineF(67.000000000000000, 48.089405357837677, 67.000000000000000, 46.908702492713928));
            lines.append(QLineF(68.000000000000000, 46.792336195707321, 68.000000000000000, 45.664141595363617));
            lines.append(QLineF(69.000000000000000, 47.435193121433258, 69.000000000000000, 46.149479269981384));
            lines.append(QLineF(70.000000000000000, 47.201041460037231, 70.000000000000000, 46.458847045898438));
            lines.append(QLineF(71.000000000000000, 47.802742660045624, 71.000000000000000, 46.704351246356964));
            lines.append(QLineF(72.000000000000000, 48.246924608945847, 72.000000000000000, 47.791390120983124));
            lines.append(QLineF(73.000000000000000, 47.772942245006561, 73.000000000000000, 46.488647460937500));
            lines.append(QLineF(74.000000000000000, 46.657522022724152, 74.000000000000000, 45.652789056301117));
            lines.append(QLineF(75.000000000000000, 45.635760247707367, 75.000000000000000, 44.117313802242279));
            lines.append(QLineF(76.000000000000000, 47.137180656194687, 76.000000000000000, 44.250711679458618));
            lines.append(QLineF(77.000000000000000, 47.802742660045624, 77.000000000000000, 47.223746538162231));
            lines.append(QLineF(78.000000000000000, 47.317407757043839, 78.000000000000000, 45.671236932277679));
            lines.append(QLineF(79.000000000000000, 45.705300092697144, 79.000000000000000, 44.741720080375671));
            lines.append(QLineF(80.000000000000000, 45.798958539962769, 80.000000000000000, 44.543045103549957));
            lines.append(QLineF(81.000000000000000, 46.173603415489197, 81.000000000000000, 45.793282270431519));
            lines.append(QLineF(82.000000000000000, 46.715703785419464, 82.000000000000000, 45.769158124923706));
            lines.append(QLineF(83.000000000000000, 47.943235874176025, 83.000000000000000, 46.704351246356964));
            lines.append(QLineF(84.000000000000000, 47.890727609395981, 84.000000000000000, 46.734154433012009));
            lines.append(QLineF(85.000000000000000, 46.826396584510803, 85.000000000000000, 46.237466990947723));
            lines.append(QLineF(86.000000000000000, 47.019395291805267, 86.000000000000000, 46.307001292705536));
            lines.append(QLineF(87.000000000000000, 47.131504386663437, 87.000000000000000, 46.798012465238571));
            lines.append(QLineF(88.000000000000000, 47.054871976375580, 88.000000000000000, 46.488647460937500));
            lines.append(QLineF(89.000000000000000, 46.663198292255402, 89.000000000000000, 46.470199584960938));
            lines.append(QLineF(90.000000000000000, 47.171238273382187, 90.000000000000000, 46.219013571739197));
            lines.append(QLineF(91.000000000000000, 47.814095199108124, 91.000000000000000, 47.148533195257187));
            lines.append(QLineF(92.000000000000000, 47.738884627819061, 92.000000000000000, 46.394983470439911));
            lines.append(QLineF(93.000000000000000, 46.436141967773438, 93.000000000000000, 45.495267033576965));
            lines.append(QLineF(94.000000000000000, 47.025071561336517, 94.000000000000000, 45.547778069972992));
            lines.append(QLineF(95.000000000000000, 47.540206879377365, 95.000000000000000, 46.768212050199509));
            lines.append(QLineF(96.000000000000000, 46.803688734769821, 96.000000000000000, 45.056764125823975));
            lines.append(QLineF(97.000000000000000, 45.116364955902100, 97.000000000000000, 44.496215879917145));
            lines.append(QLineF(98.000000000000000, 45.828758955001831, 98.000000000000000, 44.852412879467010));
            lines.append(QLineF(99.000000000000000, 46.260172069072723, 99.000000000000000, 45.823082685470581));
            lines.append(QLineF(100.00000000000000, 46.061497092247009, 100.00000000000000, 45.776253461837769));
            lines.append(QLineF(101.00000000000000, 46.925734072923660, 101.00000000000000, 45.933775484561920));
            lines.append(QLineF(102.00000000000000, 47.714757710695267, 102.00000000000000, 46.850520730018616));
            lines.append(QLineF(103.00000000000000, 47.639547139406204, 103.00000000000000, 47.148533195257187));
            lines.append(QLineF(104.00000000000000, 47.767265975475311, 104.00000000000000, 47.171238273382187));
            lines.append(QLineF(105.00000000000000, 47.621096491813660, 105.00000000000000, 46.412017822265625));
            lines.append(QLineF(106.00000000000000, 46.412017822265625, 106.00000000000000, 46.096973776817322));
            lines.append(QLineF(107.00000000000000, 46.780983656644821, 107.00000000000000, 46.226108908653259));
            lines.append(QLineF(108.00000000000000, 47.545885920524597, 108.00000000000000, 46.792336195707321));
            lines.append(QLineF(109.00000000000000, 47.797066390514374, 109.00000000000000, 47.422421514987946));
            lines.append(QLineF(110.00000000000000, 47.516082733869553, 110.00000000000000, 46.441818237304688));
            lines.append(QLineF(111.00000000000000, 46.522705078125000, 111.00000000000000, 45.513720452785492));
            lines.append(QLineF(112.00000000000000, 45.571902215480804, 112.00000000000000, 45.154685318470001));
            lines.append(QLineF(113.00000000000000, 45.685433149337769, 113.00000000000000, 45.410122990608215));
            lines.append(QLineF(114.00000000000000, 46.224689841270447, 114.00000000000000, 45.536425530910492));
            lines.append(QLineF(115.00000000000000, 46.562441736459732, 115.00000000000000, 46.230371654033661));
            lines.append(QLineF(116.00000000000000, 46.732735365629196, 116.00000000000000, 46.494323730468750));
            lines.append(QLineF(117.00000000000000, 46.736992567777634, 117.00000000000000, 46.579470545053482));
            lines.append(QLineF(118.00000000000000, 47.050614774227142, 118.00000000000000, 46.568118005990982));
            lines.append(QLineF(119.00000000000000, 46.999528348445892, 119.00000000000000, 46.617785364389420));
            lines.append(QLineF(120.00000000000000, 46.894511818885803, 120.00000000000000, 46.667455494403839));
            lines.append(QLineF(121.00000000000000, 47.009461820125580, 121.00000000000000, 46.822139382362366));
            lines.append(QLineF(122.00000000000000, 47.029328763484955, 122.00000000000000, 46.746926039457321));
            lines.append(QLineF(123.00000000000000, 46.873225808143616, 123.00000000000000, 46.041624605655670));
            lines.append(QLineF(124.00000000000000, 46.282877147197723, 124.00000000000000, 45.895460665225983));
            lines.append(QLineF(125.00000000000000, 46.500000000000000, 125.00000000000000, 46.207661032676697));
            lines.append(QLineF(126.00000000000000, 46.934248477220535, 126.00000000000000, 46.461685180664063));
            lines.append(QLineF(127.00000000000000, 47.057710111141205, 127.00000000000000, 46.772469252347946));
            lines.append(QLineF(128.00000000000000, 46.830653786659241, 128.00000000000000, 46.542572021484375));
            lines.append(QLineF(129.00000000000000, 46.606432825326920, 129.00000000000000, 46.309839427471161));
            lines.append(QLineF(130.00000000000000, 46.441818237304688, 130.00000000000000, 46.295648753643036));
            lines.append(QLineF(131.00000000000000, 46.578051477670670, 131.00000000000000, 46.289972484111786));
            lines.append(QLineF(132.00000000000000, 46.775307387113571, 132.00000000000000, 46.583727747201920));
            lines.append(QLineF(133.00000000000000, 46.701513111591339, 133.00000000000000, 46.484390258789063));
            lines.append(QLineF(134.00000000000000, 46.505676269531250, 134.00000000000000, 46.156574606895447));
            lines.append(QLineF(135.00000000000000, 46.193470358848572, 135.00000000000000, 45.976347506046295));
            lines.append(QLineF(136.00000000000000, 46.186375021934509, 136.00000000000000, 45.989119112491608));
            lines.append(QLineF(137.00000000000000, 46.238886058330536, 137.00000000000000, 46.047306418418884));
            lines.append(QLineF(138.00000000000000, 46.250238597393036, 138.00000000000000, 45.997633516788483));
            lines.append(QLineF(139.00000000000000, 46.573794275522232, 139.00000000000000, 46.180698752403259));
            lines.append(QLineF(140.00000000000000, 46.820720314979553, 140.00000000000000, 46.519866943359375));
            lines.append(QLineF(141.00000000000000, 46.942762881517410, 141.00000000000000, 46.641912281513214));
            lines.append(QLineF(142.00000000000000, 46.710027515888214, 142.00000000000000, 46.251657664775848));
            lines.append(QLineF(143.00000000000000, 46.602175623178482, 143.00000000000000, 46.247400462627411));
            lines.append(QLineF(144.00000000000000, 46.739830702543259, 144.00000000000000, 46.528381347656250));
            lines.append(QLineF(145.00000000000000, 46.978239566087723, 145.00000000000000, 46.715703785419464));
            lines.append(QLineF(146.00000000000000, 46.976820498704910, 146.00000000000000, 46.708608448505402));
            lines.append(QLineF(147.00000000000000, 46.765373915433884, 147.00000000000000, 46.274362742900848));
            lines.append(QLineF(148.00000000000000, 46.363763988018036, 148.00000000000000, 46.184955954551697));
            lines.append(QLineF(149.00000000000000, 46.500000000000000, 149.00000000000000, 46.257333934307098));
            lines.append(QLineF(150.00000000000000, 46.569537073373795, 150.00000000000000, 46.426208496093750));
            lines.append(QLineF(151.00000000000000, 46.467361450195313, 151.00000000000000, 46.233209788799286));
            lines.append(QLineF(152.00000000000000, 46.763954848051071, 152.00000000000000, 46.284296214580536));
            lines.append(QLineF(153.00000000000000, 46.983915835618973, 153.00000000000000, 46.700094044208527));
            lines.append(QLineF(154.00000000000000, 46.928572207689285, 154.00000000000000, 46.719960987567902));
            lines.append(QLineF(155.00000000000000, 46.792336195707321, 155.00000000000000, 46.187794089317322));
            lines.append(QLineF(156.00000000000000, 46.254495799541473, 156.00000000000000, 46.034529268741608));
            lines.append(QLineF(157.00000000000000, 46.148060202598572, 157.00000000000000, 46.008986055850983));
            lines.append(QLineF(158.00000000000000, 46.468780517578125, 158.00000000000000, 46.091297507286072));
            lines.append(QLineF(159.00000000000000, 46.517028808593750, 159.00000000000000, 46.399240672588348));
            lines.append(QLineF(160.00000000000000, 46.512771606445313, 160.00000000000000, 46.417694091796875));
            lines.append(QLineF(161.00000000000000, 46.778145521879196, 161.00000000000000, 46.436141967773438));
            lines.append(QLineF(162.00000000000000, 47.280512005090714, 162.00000000000000, 46.795174330472946));
            lines.append(QLineF(163.00000000000000, 47.303217083215714, 163.00000000000000, 47.047776639461517));
            lines.append(QLineF(164.00000000000000, 47.054871976375580, 164.00000000000000, 46.683065235614777));
            lines.append(QLineF(165.00000000000000, 46.771050184965134, 165.00000000000000, 46.603594690561295));
            lines.append(QLineF(166.00000000000000, 46.640493214130402, 166.00000000000000, 46.508514404296875));
            lines.append(QLineF(167.00000000000000, 46.565279871225357, 167.00000000000000, 46.341058909893036));
            lines.append(QLineF(168.00000000000000, 46.410598754882813, 168.00000000000000, 46.207661032676697));
            lines.append(QLineF(169.00000000000000, 46.289972484111786, 169.00000000000000, 46.165089011192322));
            lines.append(QLineF(170.00000000000000, 46.271524608135223, 170.00000000000000, 46.095554709434509));
            lines.append(QLineF(171.00000000000000, 46.475875854492188, 171.00000000000000, 46.176441550254822));
            lines.append(QLineF(172.00000000000000, 46.551089197397232, 172.00000000000000, 46.448913574218750));
            lines.append(QLineF(173.00000000000000, 46.542572021484375, 173.00000000000000, 46.399240672588348));
            lines.append(QLineF(174.00000000000000, 46.484390258789063, 174.00000000000000, 46.333963572978973));
            lines.append(QLineF(175.00000000000000, 46.561022669076920, 175.00000000000000, 46.387888133525848));
            lines.append(QLineF(176.00000000000000, 46.610690027475357, 176.00000000000000, 46.500000000000000));
            lines.append(QLineF(177.00000000000000, 46.500000000000000, 177.00000000000000, 46.292810618877411));
            lines.append(QLineF(178.00000000000000, 46.660360157489777, 178.00000000000000, 46.338220775127411));
            lines.append(QLineF(179.00000000000000, 46.803688734769821, 179.00000000000000, 46.623461633920670));
            lines.append(QLineF(180.00000000000000, 46.796593397855759, 180.00000000000000, 46.404916942119598));
            lines.append(QLineF(181.00000000000000, 46.444656372070313, 181.00000000000000, 46.254495799541473));
            lines.append(QLineF(182.00000000000000, 46.572375208139420, 182.00000000000000, 46.307001292705536));
            lines.append(QLineF(183.00000000000000, 46.600756555795670, 183.00000000000000, 46.495742797851563));
            lines.append(QLineF(184.00000000000000, 46.592242151498795, 184.00000000000000, 46.474456787109375));
            lines.append(QLineF(185.00000000000000, 46.732735365629196, 185.00000000000000, 46.573794275522232));
            lines.append(QLineF(186.00000000000000, 46.725637257099152, 186.00000000000000, 46.524124145507813));
            lines.append(QLineF(187.00000000000000, 46.559603601694107, 187.00000000000000, 46.403497874736786));
            lines.append(QLineF(188.00000000000000, 46.444656372070313, 188.00000000000000, 46.245981395244598));
            lines.append(QLineF(189.00000000000000, 46.468780517578125, 189.00000000000000, 46.250238597393036));
            lines.append(QLineF(190.00000000000000, 46.519866943359375, 190.00000000000000, 46.436141967773438));
            lines.append(QLineF(191.00000000000000, 46.492904663085938, 191.00000000000000, 46.399240672588348));
            lines.append(QLineF(192.00000000000000, 46.492904663085938, 192.00000000000000, 46.373697459697723));
            lines.append(QLineF(193.00000000000000, 46.512771606445313, 193.00000000000000, 46.424789428710938));
            lines.append(QLineF(194.00000000000000, 46.545410156250000, 194.00000000000000, 46.441818237304688));
            lines.append(QLineF(195.00000000000000, 46.490066528320313, 195.00000000000000, 46.387888133525848));
            lines.append(QLineF(196.00000000000000, 46.538314819335938, 196.00000000000000, 46.397821605205536));
            lines.append(QLineF(197.00000000000000, 46.592242151498795, 197.00000000000000, 46.512771606445313));
            lines.append(QLineF(198.00000000000000, 46.606432825326920, 198.00000000000000, 46.518447875976563));
            lines.append(QLineF(199.00000000000000, 46.697255909442902, 199.00000000000000, 46.528381347656250));
            lines.append(QLineF(200.00000000000000, 46.573794275522232, 200.00000000000000, 46.349573314189911));
            lines.append(QLineF(201.00000000000000, 46.687322437763214, 201.00000000000000, 46.454589843750000));
            lines.append(QLineF(202.00000000000000, 46.749764174222946, 202.00000000000000, 46.663198292255402));
            lines.append(QLineF(203.00000000000000, 46.708608448505402, 203.00000000000000, 46.565279871225357));
            lines.append(QLineF(204.00000000000000, 46.596499353647232, 204.00000000000000, 46.417694091796875));
            lines.append(QLineF(205.00000000000000, 46.461685180664063, 205.00000000000000, 46.316934764385223));
            lines.append(QLineF(206.00000000000000, 46.534057617187500, 206.00000000000000, 46.366602122783661));
            lines.append(QLineF(207.00000000000000, 46.605013757944107, 207.00000000000000, 46.465942382812500));
            lines.append(QLineF(208.00000000000000, 46.606432825326920, 208.00000000000000, 46.522705078125000));
            lines.append(QLineF(209.00000000000000, 46.657522022724152, 209.00000000000000, 46.569537073373795));
            lines.append(QLineF(210.00000000000000, 46.695836842060089, 210.00000000000000, 46.529800415039063));
            lines.append(QLineF(211.00000000000000, 46.556765466928482, 211.00000000000000, 46.380792796611786));
            lines.append(QLineF(212.00000000000000, 46.430465698242188, 212.00000000000000, 46.331125438213348));
            lines.append(QLineF(213.00000000000000, 46.380792796611786, 213.00000000000000, 46.291391551494598));
            lines.append(QLineF(214.00000000000000, 46.363763988018036, 214.00000000000000, 46.284296214580536));
            lines.append(QLineF(215.00000000000000, 46.404916942119598, 215.00000000000000, 46.328287303447723));
            lines.append(QLineF(216.00000000000000, 46.443237304687500, 216.00000000000000, 46.350992381572723));
            lines.append(QLineF(217.00000000000000, 46.673131763935089, 217.00000000000000, 46.433303833007813));
            lines.append(QLineF(218.00000000000000, 46.793755263090134, 218.00000000000000, 46.660360157489777));
            lines.append(QLineF(219.00000000000000, 46.813622206449509, 219.00000000000000, 46.762535780668259));
            lines.append(QLineF(220.00000000000000, 46.813622206449509, 220.00000000000000, 46.698674976825714));
            lines.append(QLineF(221.00000000000000, 46.705770313739777, 221.00000000000000, 46.457427978515625));
            lines.append(QLineF(222.00000000000000, 46.464523315429688, 222.00000000000000, 46.236047923564911));
            lines.append(QLineF(223.00000000000000, 46.257333934307098, 223.00000000000000, 46.169346213340759));
            lines.append(QLineF(224.00000000000000, 46.336801707744598, 224.00000000000000, 46.193470358848572));
            lines.append(QLineF(225.00000000000000, 46.485809326171875, 225.00000000000000, 46.311258494853973));
            lines.append(QLineF(226.00000000000000, 46.654683887958527, 226.00000000000000, 46.451751708984375));
            lines.append(QLineF(227.00000000000000, 46.668874561786652, 227.00000000000000, 46.563860803842545));
            lines.append(QLineF(228.00000000000000, 46.596499353647232, 228.00000000000000, 46.512771606445313));
            lines.append(QLineF(229.00000000000000, 46.556765466928482, 229.00000000000000, 46.491485595703125));
            lines.append(QLineF(230.00000000000000, 46.532638549804688, 230.00000000000000, 46.465942382812500));
            lines.append(QLineF(231.00000000000000, 46.485809326171875, 231.00000000000000, 46.389307200908661));
            lines.append(QLineF(232.00000000000000, 46.420532226562500, 232.00000000000000, 46.365183055400848));
            lines.append(QLineF(233.00000000000000, 46.456008911132813, 233.00000000000000, 46.387888133525848));
            lines.append(QLineF(234.00000000000000, 46.573794275522232, 234.00000000000000, 46.446075439453125));
            lines.append(QLineF(235.00000000000000, 46.646169483661652, 235.00000000000000, 46.575213342905045));
            lines.append(QLineF(236.00000000000000, 46.677388966083527, 236.00000000000000, 46.627718836069107));
            lines.append(QLineF(237.00000000000000, 46.680227100849152, 237.00000000000000, 46.603594690561295));
            lines.append(QLineF(238.00000000000000, 46.613528162240982, 238.00000000000000, 46.453170776367188));
            lines.append(QLineF(239.00000000000000, 46.471618652343750, 239.00000000000000, 46.318353831768036));
            lines.append(QLineF(240.00000000000000, 46.338220775127411, 240.00000000000000, 46.280039012432098));
            lines.append(QLineF(241.00000000000000, 46.448913574218750, 241.00000000000000, 46.329706370830536));
            lines.append(QLineF(242.00000000000000, 46.565279871225357, 242.00000000000000, 46.440399169921875));
            lines.append(QLineF(243.00000000000000, 46.622042566537857, 243.00000000000000, 46.549670130014420));
            lines.append(QLineF(244.00000000000000, 46.622042566537857, 244.00000000000000, 46.559603601694107));
            lines.append(QLineF(245.00000000000000, 46.592242151498795, 245.00000000000000, 46.508514404296875));
            lines.append(QLineF(246.00000000000000, 46.522705078125000, 246.00000000000000, 46.437561035156250));
            lines.append(QLineF(247.00000000000000, 46.470199584960938, 247.00000000000000, 46.420532226562500));
            lines.append(QLineF(248.00000000000000, 46.450332641601563, 248.00000000000000, 46.406336009502411));
            lines.append(QLineF(249.00000000000000, 46.512771606445313, 249.00000000000000, 46.440399169921875));
    
            startTimer(2000);
        }
    
    protected:
        QVector<QLineF> lines;
    
        bool ok = false;
    
        virtual void timerEvent(QTimerEvent *) override{
            update();
        }
    
        void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE
        {
            QPainter painter(this);
            if(ok){
                painter.setPen(Qt::green);
                for (int i = 0; i < lines.size(); i++)
                {
                    painter.drawLine(lines.at(i));
                }
            } else {
    
                painter.setPen(Qt::red);
                painter.drawLines(lines.data(), lines.size());
            }
            ok = !ok;
        }
    };
    
    int main(int argc, char *argv[])
    {
        QApplication a(argc, argv);
    
        QPalette palette;
        palette.setColor(QPalette::Background, Qt::black);
    
        Widget w;
        w.setAutoFillBackground(true);
        w.setPalette(palette);
        w.show();
    
        return a.exec();
    }
    

    also surprisingly this overload:
    https://doc.qt.io/qt-5.12/qpainter.html#drawLines-1

    doesn't seem to exist, even so its documented.

    If no-one else can help you more, or knows what's going on, I would suggest bringing this to the bug tracker
    https://bugreports.qt.io

    Don't forget to post a link here, if you do so, so we can follow it as well


  • Qt Champions 2019


  • Moderators

    @Christian-Ehrlicher
    Yes, I need to to learn how to read to documentation more 🤦‍♂️


Log in to reply