How to "lock" a new qdialog in another qdialog
Hi,
my main window (qdialog) has a tab-widget. Each Tab has its own dialog.
Each dialog in my tab-widget represents an individual Object in nature.
When the object in nature makes problems, my program gets this information and forwards this information to its dialog in the tab-widget.
I want to be able to show a MessageBox or a Dialog in the "natural-objects dialog".
When the user goes through the tabs he will see on TAB X that "natural object X" had a problem. But he should not see this information somewhere else...just in "TAB X".
I tried it with QMessageBox but I failed..
I made it non-modal but it was always outside the "tab-dialog". I want to lock it to that window, so the user can visit the other dialogs in the tab without beeing disturbed.
What can I do?
Re: How to "lock" a new qdialog in another qdialog
any ideas? or sth not understandable?
Re: How to "lock" a new qdialog in another qdialog
How about adding for example a normaly empty QLabel (for example with red foreground color) at the top of bottom of each form, and in case of error write a message ito it?
Another solution would be Dialogs for every tab which you hide/show when tabs change, for example using the signal QTabWidget::currentChanged(int)
Re: How to "lock" a new qdialog in another qdialog
By the term "dialog" do you mean a QDialog (top-level window, short-lived, possibly modal to its parent) or a "widget"? A screenshot might clear things out...
Re: How to "lock" a new qdialog in another qdialog
Hi,
with dialog i really mean QDialog.
The pages of my Tabs are self-made derived classes (of QDialog).
And what I want to show is a QMessageBox or a QDialog.
It doesnt matter....The main goal is that the user sees an alert in the middle of the screen of each QDialog(in the tab).
http://img217.imageshack.us/img217/7936/screen1cm8.png
http://img217.imageshack.us/my.php?image=screen1cm8.png
Re: How to "lock" a new qdialog in another qdialog
You can emit a signal from one of your tab widget, and connect it to main window.
Main Window can then display the error message .
Re: How to "lock" a new qdialog in another qdialog
Based on the screenshot I see you mean a widget after all :) The fact that you are using QDialog there only means you shouldn't be doing that. And I would advise against using QMessageBox or similar in the same fashion. Do it properly and create a plain QWidget (like QLabel or sth) just don't put it in the layout with other widgets of the tab. Instead use setGeometry to set its geometry to the centre of the tab's widget.
Re: How to "lock" a new qdialog in another qdialog
Thanks for you hints..
You mean I should create a QLabel for my error message (while runtime).
Use the setgeometry of it to place it in the tab I want,..right?
I will try this....thanks