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. [Solved]How to perform 'reject' of main dialog from inside widget?
QtWS25 Last Chance

[Solved]How to perform 'reject' of main dialog from inside widget?

Scheduled Pinned Locked Moved General and Desktop
5 Posts 2 Posters 971 Views
  • 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.
  • E Offline
    E Offline
    Eleviesta
    wrote on last edited by
    #1

    !http://puu.sh/dLyv6/55f199ccac.png(img)!
    There is a widget inside of main dialog
    this widget was promoted to a widget class
    I want to perform main dialog's 'reject' when press close button of inside widget.
    I tried 'exit(0)' but it doesn't perform 'reject'. so I have to add same redundant code to do some work before close.
    and 'close()' just close inside widget itself..

    How to deal with it?

    1 Reply Last reply
    0
    • E Offline
      E Offline
      Eleviesta
      wrote on last edited by
      #2

      @QApplication::closeAllWindows();@

      I found solution

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

        Hi and welcome to devnet,

        A cleaner solution would be to connect the clicked signal of your close button to the reject slot of your MainDialog

        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
        • E Offline
          E Offline
          Eleviesta
          wrote on last edited by
          #4

          [quote author="SGaist" date="1419712665"]Hi and welcome to devnet,

          A cleaner solution would be to connect the clicked signal of your close button to the reject slot of your MainDialog[/quote]

          In MainDialog's constructor
          @connect(ui->InsideWidget,SIGNAL(emitReject()),this,SLOT(reject()));@
          Is that right? Thank you!

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

            Yes, however you should rather call that signal reject also

            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

            • Login

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