opening selected data details in a new window
Hi,
I have a TableWidget where basic information about data is displayed. More details about this is given in a TreeWidget below. Now I want to open that information in a new window when the user double clicks on particular row in the table . Can you please suggest me to how to open Treewidget corresponding to particular row in a new window when the user double clicks on it.
Thanks in advance,
Namitha.
Re: opening selected data details in a new window
QTableWidget has a cellDoubleClicked() signal that contains the row index.
Since you already know how to handle the single click you shouldn't have a problem handle the double click in the same way
Cheers,
_
Re: opening selected data details in a new window
Hi,
Thanks for the reply. But i know that i have to use celldoubleclicked() my doubt is how to open treewidget in a new window. Like whether should we use treewidget->show or something?
Regards,
Namitha
Re: opening selected data details in a new window
Yes, either the tree widget itself without a parent (parent == 0) or by putting the tree widget into a QDialog based sub window.
Cheers,
_
Re: opening selected data details in a new window
Hi,
Thanks for your reply. My treewidget is part of mainwindow.ui so is it possible to include it also as a subwindow based on QDialog. And can you explain me how to make treewidget without parent?
Thanks in advance
Namitha
Re: opening selected data details in a new window
If it is part of mainwindow.ui it is part of the main window, not a separate window.
Create a separate for if you want to have a separate window.
Cheers,
_
Re: opening selected data details in a new window
Hi,
Thanks for the reply.
Actually my requirement is i want to see treewidget as part of mainwindow when i run the project. If the user double clicks on table only it should open as new window.
Regards
Namitha
Re: opening selected data details in a new window
Not sure what you wanted to say with that, you already have the first part working, no?
Cheers,
_
Re: opening selected data details in a new window
Hi,
Actually my window is having a treewidget and tablewidget. For the data given in the table tree will give more information. now when the user double clicks on table tree should open as a new widget . this is my requirement.
Thanks in advance.
Regards
Namitha
Re: opening selected data details in a new window
OK, then you are all settled, right?
The question regarding the secondary window has been answered, the view in the main window works, right?
Cheers,
_