Results 1 to 10 of 10

Thread: opening selected data details in a new window

  1. #1
    Join Date
    Apr 2016
    Posts
    17
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default 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.

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default 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,
    _

  3. #3
    Join Date
    Apr 2016
    Posts
    17
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default 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

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default 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,
    _

  5. #5
    Join Date
    Apr 2016
    Posts
    17
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default 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

  6. #6
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default 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,
    _

  7. #7
    Join Date
    Apr 2016
    Posts
    17
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default 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

  8. #8
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default 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,
    _

  9. #9
    Join Date
    Apr 2016
    Posts
    17
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default 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

  10. #10
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default 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,
    _

Similar Threads

  1. opening another window from mainwindow
    By namitha in forum Newbie
    Replies: 1
    Last Post: 10th June 2016, 08:29
  2. opening widgets in new window
    By robotics in forum Qt Programming
    Replies: 1
    Last Post: 1st July 2011, 04:52
  3. Replies: 0
    Last Post: 1st July 2010, 04:21
  4. opening a second window
    By benlyboy in forum Newbie
    Replies: 3
    Last Post: 2nd March 2010, 04:08
  5. Opening a new window
    By k12yp70n in forum Newbie
    Replies: 1
    Last Post: 26th March 2009, 15:31

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.