Solved gui not showing, or closing to fast to see
-
@JonB both
ui->textEdit_40->setFixedSize(30, 30); ui->textEdit_41->setFixedSize(30, 30);
cause problems. comment out the first, second one crashes. comment out both, it runs.
-
@micha_eleric And the rest of the things I suggested you try?
-
qDebug() << ui->textEdit_40->objectName() << ui->textEdit_41->objectName(); qDebug() << ui->textEdit_40->objectName(); qDebug() << ui->textEdit_41->objectName();
all caused crash, no messages, that i found
-
Hi,
Is ui initialized properly ?
-
@micha_eleric
So it looks like you have a problem with those twotextEdit
pointers? Btw you have done a clean rebuild, so theuic
has been run on the latest.ui
file? You have initialised theui
prior to this code? -
@JonB said in gui not showing, or closing to fast to see:
At one point you said a
SIGSTOP
was reported. Now you talk about "crashing", or just exiting. In any case, are you compiling for debug and running inside the debugger? Does the debugger catch anything/stop/report anything when your code goes wrong or exits?if i dont compile for debug, it runs, till i get to code that crashes. compile debug, and it crashes before getting to error code, and tells me nothing about where.
-
@JonB said in gui not showing, or closing to fast to see:
@micha_eleric
So it looks like you have a problem with those twotextEdit
pointers? Btw you have done a clean rebuild, so theuic
has been run on the latest.ui
file? You have initialised theui
prior to this code?actually, i am using a .h file. just saw yesterday, that i could not open it with qt 5 designer, and qt 5 designer saves in .ui
most other text boxes and buttons run fine.
code in .h file for text boxes and buttons, look like copy/paste except numbers change.
dont know how to convert .h to .ui, or how to open .h with qt 5 designer. the qt designer i used before was much easier to design with. -
@micha_eleric
I happen to notice that afterui->textEdit_38
ui->textEdit_39
is absent, then you say it goes wrong atui->textEdit_40
. Don't know what you want 40+ text edits for, but anyway why not delete all afterui->textEdit_38
, make sure it works at that point. Then add the further ones in and see how it goes. -
@JonB said in gui not showing, or closing to fast to see:
@micha_eleric
I happen to notice that afterui->textEdit_38
ui->textEdit_39
is absent, then you say it goes wrong atui->textEdit_40
. Don't know what you want 40+ text edits for, but anyway why not delete all afterui->textEdit_38
, make sure it works at that point. Then add the further ones in and see how it goes.yah. not sure about that.
did find 39,40, and 41 cause a crash in another part that call those three, but not the other text boxes. -
@JonB said in gui not showing, or closing to fast to see:
@micha_eleric
I happen to notice that afterui->textEdit_38
ui->textEdit_39
is absent, then you say it goes wrong atui->textEdit_40
. Don't know what you want 40+ text edits for, but anyway why not delete all afterui->textEdit_38
, make sure it works at that point. Then add the further ones in and see how it goes.
runs finestd::cout << "InitTestBoard try 3 \n" << std::flush; // ui->textEdit_40->setFixedSize(30, 30); // ui->textEdit_41->setFixedSize(30, 30); ui->textEdit_42->setFixedSize(30, 30); ui->textEdit_43->setFixedSize(30, 30); ui->textEdit_44->setFixedSize(30, 30); ui->textEdit_45->setFixedSize(30, 30); std::cout << "InitTestBoard try end \n" << std::flush;
crashes
std::cout << "InitTestBoard try 3 \n" << std::flush; ui->textEdit_40->setFixedSize(30, 30); ui->textEdit_41->setFixedSize(30, 30); ui->textEdit_42->setFixedSize(30, 30); ui->textEdit_43->setFixedSize(30, 30); ui->textEdit_44->setFixedSize(30, 30); ui->textEdit_45->setFixedSize(30, 30); std::cout << "InitTestBoard try end \n" << std::flush;
-
found it
in CUi_MainWindow.h [the file that has gui layout] file 39, 40, and 41 are different -
@JonB said in gui not showing, or closing to fast to see:
Btw you have done a clean rebuild, so the
uic
has been run on the latest.ui
file?@micha_eleric
Do a complete project rebuild/make some change in Designer to update the.ui
file and forceuic
to run on it again.ui_MainWindow.h
is a generated file; don't change it yourself, it will get overwritten. -
@JonB not sure where to ui or uic files are. if i still have them
-
uic
is the User Interface Compiler, which does exactly what you've mentioned before.. creates an usable header from your*.ui
design template...
And every time you re-run it, your header file will be created or updated... so it makes no sense to edit the file yourself and change some object names -
@Pl45m4 just found the .iu file.
trying to remember what i did 4 years ago -
@micha_eleric
Go into Designer, make some small change, save, build, does it work now? -
@JonB build is gray
-
@JonB ok. default opens with qt creator, and build is gray
open with qt designer, and find no build -
@JonB said in gui not showing, or closing to fast to see:
@micha_eleric
Go into Designer, make some small change, save, build, does it work now?where is build in qt designer?
-
@micha_eleric said in gui not showing, or closing to fast to see:
where is build in qt designer?
There is no build in QtDesigner.
You build your project in QtCreator. And you also should rather edit ui files in QtCreator (QtDesigner is integrated there)...