Details
-
Bug
-
Resolution: Invalid
-
Not Evaluated
-
None
-
5.13.2
-
None
Description
The following code produces wrong QPolygonF results in Release builds with Visual Studio 2019 Windows 10 64bit.
Debug builds seem to work fine.
Tests with MacOS seem also to be fine for both builds – Release and Debug.
=== SNIP ===
#include <QPainterPath>
#include <iostream>
int main(int argc, char** argv)
{
QPainterPath p = QPainterPath();
QRectF r(-10, -10, 20, 20);
p.addEllipse(r);
QPolygonF poly_fail = p.toFillPolygon();
std::cout << std::fixed;
for (auto p : poly_fail)
std::cout << "poly_fail size: " << poly_fail.size() << std::endl;
return 0;
}
=== SNIP ===
-
-
-
-
- Output in Debug (correct) **
-
-
-
10.000000 0.000000
9.214150 3.892451
7.071068 7.071068
3.892451 9.214150
0.000000 10.000000
-3.892451 9.214150
-7.071068 7.071068
-9.214150 3.892451
-10.000000 0.000000
-9.214150 -3.892451
-7.071068 -7.071068
-3.892451 -9.214150
0.000000 -10.000000
3.892451 -9.214150
7.071068 -7.071068
9.214150 -3.892451
10.000000 0.000000
poly_fail size: 17
-
-
-
-
- Output in Release (wrong) **
-
-
-
10.000000 0.000000
0.000000 0.000000
0.000000 0.000000
0.000000 10.000000
0.000000 0.000000
0.000000 0.000000
-10.000000 0.000000
0.000000 0.000000
0.000000 0.000000
0.000000 -10.000000
0.000000 0.000000
0.000000 0.000000
10.000000 0.000000
poly_fail size: 13
==== CMakeLists.txt ====
cmake_minimum_required(VERSION 3.1.0)
project(fillpoly)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
FIND_PACKAGE(Qt5Core)
FIND_PACKAGE(Qt5Gui)
add_executable(fillpoly main.cpp)
target_link_libraries(fillpoly Qt5::Gui)