Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Qt Academy Launch in California!

    Solved Add TreeWidget item from another dialog

    General and Desktop
    qtreewidget qlineedit qmainwindow qdialog
    2
    3
    515
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      HenrikSt. last edited by

      Hello everyone and merry christmas!

      I have a dialog with a QLineEdit.
      And i have a Mainwindow with a QTreeWidget

      So, when i clicked OK in the dialog, then in the QTreeWidget in the Mainwindow should added an item, and the item contains the text from the QLineEdit in the dialog.

      But i don't have any idea, how to pass these data...
      I hope, someone can help me,

      Thanks,
      Henrik

      1 Reply Last reply Reply Quote 0
      • mrjj
        mrjj Lifetime Qt Champion last edited by

        Hi
        merry christmas to you too.
        You can define a new signal in dialog
        and in mainwindow hook this new signal up to up to a slot.
        and in slot simply add the item.
        Sample:
        alt text

        code:
        https://www.dropbox.com/s/hf944ilyk12swvi/ex2.zip?dl=0

        1 Reply Last reply Reply Quote 1
        • H
          HenrikSt. last edited by

          Thanks, mrjj!
          That's it!

          Merry christmas

          1 Reply Last reply Reply Quote 0
          • First post
            Last post