Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Communication b/w Dialog and MainWindow
Forum Updated to NodeBB v4.3 + New Features

Communication b/w Dialog and MainWindow

Scheduled Pinned Locked Moved General and Desktop
3 Posts 3 Posters 893 Views 1 Watching
  • 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.
  • C Offline
    C Offline
    chronix
    wrote on last edited by
    #1

    Hey I was making a text editor! wanted add a find option in it! so i created a new dialog which pops up when someone clicks on find action! this dialog has a QlineEdit which takes in the word to searched! now i want this lineEdit text to update a QString which is declared in MainWindow.h!
    but it doesn't work gives some token related error! is there an other way to do this?
    ~thanks! :)

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      What's the exact error ?

      You can also use "QInputDialog::getText":http://qt-project.org/doc/qt-4.8/qinputdialog.html#getText

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • P Offline
        P Offline
        pkj__
        wrote on last edited by
        #3

        This is regular c++. You declare your dialog with a lineedit and buttons like ok, cancel on stack
        @
        MyDialog dialog;
        if (dialog.exec() == QDialog::Accepted) {
        myMainDialogStringVar = dialog.ui->textEdit->text();
        }
        @

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved