1 Attachment(s)
Issue when i open window from mainwindow after the 1st time - it will open very small
In my code code attached i have this issues:
1 - when i open the edit window at 1st time the window will be open right, next time it will open very small?
(if i make some mistake in my code tell me what is the right procedure to do the job by explain me with some code, thank you)
2 - I'm trying to reduce the "color-label" to the width of the combobox, i have tried some but with no effect, how i can do it?
3 - when i try to close the main window by pressing with the mouse on X button, no happen?
IN "application output" of Qt compiler is showed this message after the 1st open:
QWidget::setLayout: Attempting to set QLayout "" on EditObject "", which already has a layout
after i used an auxiliary update_val:
Code:
void EditObject::window_elements_update()
{
....
if (update_val){
update_val = 0;
setLayout(final_layout);
}
else {
layout()->update();
}
}
and the message "QWidget::setLayout: Attempting to set QLayout "" on EditObject "", which already has a layout" disappeared but the window still small after the 1st open window
Re: Issue when i open window from mainwindow after the 1st time - it will open very s
Every time you call EditObject:: window_elements_update() you are creating all of your EditObject's UI without removing the UI that was created in the last call. Extra checkboxes (without deleting the old ones - clear() does not do anything except erase the pointers. It does not delete the checkbox instances). You load all the same images over again even though you loaded them the last time through the function. You create a new list to hold the images without deleting the old one (another memory leak). This code is such a mess of mistakes it needs to be thrown out and completely rewritten.
I think you need to stop spewing out broken code, sit down, and write in words, not code what you want your application to do, and what should happen at each step in the process. Then, think about the data structures you need for the information your app handles, and the UI you need to display and interact with it.
If you don't do this, then every day you will run into another problem, your code will get buggier and buggier, and you will waste a huge amount of time trying random things to fix it because you haven't taken the time to do a proper design or to understand how to use Qt properly.
1 Attachment(s)
Re: Issue when i open window from mainwindow after the 1st time - it will open very s
Now this program do what i want, open an edit window, populate it like i want and i can update the mainwindow from the edit window.
I have some question:
1 - why when i try to do this setFixedSize( .... ) on a window (mainwindow or editwindow), the window that refer this setup have an issue: i can't close it by click with the mouse on X red button?
i avoid this issue by resize( .... ) + setMinimumSize( .... ) + setMaximumSize( ... ) ; i'm working on -> Qt Creator 4.11.0 Based on Qt 5.14.0
2 - i'm a beginner on Qt, an in progamming, is it the right way to structure the job?