How to get the property value form the widget created by ShowNormal() method
-
@raf924
Does it possible to set the size and position for mydiaSaveSimple?It always show maxmun size when I exec() mydiaSaveSimple in my iOS.
mydiaSaveSimple=new diaSaveSimple(this); float tmpWidth=wDesktop; float tmpHeight=hDesktop; if(wDesktop>hDesktop){ tmpHeight=tmpWidth; } float tmpScale=gData->getScaleShow(tmpWidth,tmpHeight); float wformOpen=1357*tmpScale; float hformOpen=448*tmpScale; mydiaSaveSimple->setGeometry((wDesktop-wformOpen)/2 ,(hDesktop-hformOpen)/2 ,wformOpen ,hformOpen ); QString newFilePath=""; mydiaSaveSimple->setFocus(); if(mydiaSaveSimple->exec()==QDialog::Accepted){ //....omit }
-
@mkdh I just read that all windows and dialogs are show fullscreen on iOS when using the show method ( which is used by the exec method i guess) so what you have to do is show the dialog with showNormal and connect to the dialog's "accepted" signal.
-
@raf924
If I use showNormal method, than A, B and C Statement will be executed simultaneously.But C Statement depends on the result of B Statement.
If I use exec() method, C Statement will be executed after getting the result of B Statement.
How to deal this case?
//Pseudo code: function QQ(){ // A Statement. XXX // B Statement mydiaSaveSimple->showNormal(); // C Statement. // C Statement depends on the result of B Statement. // C will use the value from A Statement. XXX }
-
@mkdh If I understand it right showNormal() is a non-blocking call. You should implement a slot for accepted() and rejected() signals and move the C part to that slot. Then you connect this slot to the accepted()/rejected() signals of your dialog.
-
Is the line edit read-only?
-
@jsulm
I add a button even as below.void Dialog::on_pushButton_clicked() { SubView *QQ=new SubView(this); QQ->setModal(true); QQ->setEnabled(true); QQ->showNormal(); }
Then, I put a QEditline on the subview .
Of course, subview is a class inherited from the dialog.
This is a very simple code.Or
You can try this
https://github.com/mkdh/QEditlineOnNewWidgetiOS