"Unhandled exception in App.exe (QtGuid4.dll): 0xc0000005:access violation" error resolution

Source: Internet
Author: User

The QT debugging problems to be solved in this article are as follows:

cause : Add a two-dimensional array of type Qcolor to the code to store each pixel of the picture.

Symptom : The error shown appears when debugging.

reason : After Baidu and repeatedly review the code, found in the code, there is an array out of bounds of the situation. Because the two dimensions of the array are not the same when defined, the actual

now qwidget the redraw event, because of the differences in the coordinate system, the two dimensions in order to make the array out of bounds.

In detail : The array I defined in the program is Qcolor color [height] [Width], and I meant height to represent the height of the image, and the initial value of height is 400;width

Represents the height of the picture, and the initial value of width is 600.

In the PaintEvent event of QT, however, in the Qpainter drawpoint (int x,int y) function, x represents the horizontal axis of the image, corresponding to the width of the array;

Y indicates the ordinate of the picture, corresponding to the height of the array.

Because the correspondence between the coordinate system and the array dimension is not realized at first, the corresponding error results in the cross-border.

If in doubt, please leave a message! If there is a problem, please correct me!

"Unhandled exception in App.exe (QtGuid4.dll): 0xc0000005:access violation" error resolution

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.