A
A
Andrey2018-05-23 10:19:54
Qt
Andrey, 2018-05-23 10:19:54

What is the reason for this behavior of the program?

The program has a lot of all sorts of windows that are static and live throughout the program from start to finish. There are quite a lot of ui elements in the windows. And now a situation arose when creating a new window, I try to create a new element in this window, for example: And the program crashes
table = new QTableView;

The program ended unexpectedly.
C:\Work_Folder\16\build-main-1.0-Desktop_Qt_5_5_1_MinGW_32bit-Debug\debug\main-1.exe crashed

log in build console
10:07:06: Running steps for project main-1.0...
10:07:06: Settings unchanged, skipping qmake step.
10:07:06: Run: "C:\Qt\Tools\mingw492_32\bin\mingw32-make.exe"
C:/Qt/Tools/mingw492_32/bin/mingw32-make -f Makefile.Debug
mingw32-make[1 ]: Entering directory 'C:/Work_Folder/16/build-main-1.0-Desktop_Qt_5_5_1_MinGW_32bit-Debug'
mingw32-make[1]: Nothing to be done for 'first'.
mingw32-make[1]: Leaving directory 'C:/Work_Folder/16/build-main-1.0-Desktop_Qt_5_5_1_MinGW_32bit-Debug'
10:07:09: Process 'C:\Qt\Tools\mingw492_32\bin\mingw32-make. exe" completed successfully.
10:07:09: Time elapsed: 00:03.

But if you comment out all the elements in any other screen, then suddenly the program starts :(
It feels like there is not enough memory, but according to the task manager, the program has 30 meters. What is it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey, 2018-05-23
@poslannikD

There were stupid typos in the code like

byte1 = new Button(ButtonType::ONLY_TEXT_BUTTON, this);
    byte1 = new Button(ButtonType::ONLY_TEXT_BUTTON, this);
    byte1 = new Button(ButtonType::ONLY_TEXT_BUTTON, this);
    byte1 = new Button(ButtonType::ONLY_TEXT_BUTTON, this);

but it was necessary
byte1 = new Button(ButtonType::ONLY_TEXT_BUTTON, this);
    byte2 = new Button(ButtonType::ONLY_TEXT_BUTTON, this);
    byte3 = new Button(ButtonType::ONLY_TEXT_BUTTON, this);
    byte4 = new Button(ButtonType::ONLY_TEXT_BUTTON, this);

accordingly, a pointer pointing to nothing was added to the root layout :(
+ one slot was not declared and defined, but there was an attempt to use a connection to it
After correcting all the stupid errors, the code started working :(

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question