Problem With frameless windows Qdark Style
-
hi i have 2 forms
and i want to add frameless to the 2 forms when i start first form from main it's 100%
but when start the second form the application force close
code in the first formFramelessWindow framelessWindow; MainWindow *mainWindow = new MainWindow ; framelessWindow.setFixedSize(1223,660); framelessWindow.setContent(mainWindow); framelessWindow.show();
-
Hi
is it this one ?
https://github.com/Jorgen-VikingGod/Qt-Frameless-Window-DarkStyleIts sample shows
FramelessWindow framelessWindow;
as its in main.cpp and it never runs out of scope due to the app.exec()However, if you place this in a function
then
FramelessWindow framelessWindow;
must be
FramelessWindow *framelessWindow = new FramelessWindow ;as else it will be deleted as soon as function ends as pr normal c++ scope rules.
(as @mpergand tries to point you to ) -
@fadu said in Problem With frameless windows Qdark Style:
FramelessWindow framelessWindow;
MainWindow *mainWindow = new MainWindow ;
framelessWindow.setFixedSize(1223,660);
framelessWindow.setContent(mainWindow);
framelessWindow.show();Most common newbee mistake posted in this forum !!
One hint for you: local variable -
-
Hi
is it this one ?
https://github.com/Jorgen-VikingGod/Qt-Frameless-Window-DarkStyleIts sample shows
FramelessWindow framelessWindow;
as its in main.cpp and it never runs out of scope due to the app.exec()However, if you place this in a function
then
FramelessWindow framelessWindow;
must be
FramelessWindow *framelessWindow = new FramelessWindow ;as else it will be deleted as soon as function ends as pr normal c++ scope rules.
(as @mpergand tries to point you to )