Qt
  1. Qt
  2. QTBUG-29116

Program does not close if showing QAxWidget

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Not Evaluated Not Evaluated
    • Resolution: Invalid
    • Affects Version/s: 4.8.4, 5.0.0
    • Fix Version/s: None
    • Component/s: Qt for ActiveX
    • Labels:
      None

      Description

      With the following code, program is left hanging and does not close after QAxWidget has been closed.
      container code:

      int main(int argc, char *argv[])
      {
          QApplication a(argc, argv);
          QAxWidget* test = new QAxWidget("{4F05C0B7-BAD9-495F-98FB-1CE4545CE5CD}");
          test->show();
          return a.exec();
      }
      

      server dll code:

      class MyServerClass : public QWidget, public QAxBindable
      {
      	Q_OBJECT
      public:
          MyServerClass(QWidget *parent = 0);
      };
      
      MyServerClass::MyServerClass(QWidget *parent) : QWidget(parent), QAxBindable()
      {
      
      }
      
      #include "main.moc"
      
      QAXFACTORY_DEFAULT(MyServerClass,
      "{4F05C0B7-BAD9-495F-98FB-1CE4545CE5CD}",
      "{CE936593-204D-41FF-8836-D7FC9B7EAB28}",
      "{2F0BB06B-2D82-4482-83E6-36D04BBC71E2}",
      "{C114D3B4-2907-4BC8-A38A-FEB71511DF5B}",
      "{3E292927-FF4F-44AE-B2CD-C3E2A9B70748}")
      

      If server and container are not same mode (other is debug and other is release), program is closed after closing QAxWidget.
      Please find full code example attached.

      No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

        Hide
        Tuukka Turunen added a comment -

        Miikka, can you take a look into this one.

        Show
        Tuukka Turunen added a comment - Miikka, can you take a look into this one.
        Hide
        Miikka Heikkinen added a comment -

        This is a feature of applications that use inprocess ActiveQt servers, as they call qApp->setQuitOnLastWindowClosed(false) when created. To make the application quit when last window is closed, add the following line before a.exec() call in main():

        QObject::connect(qApp, SIGNAL(lastWindowClosed()), &a, SLOT(quit()));
        
        Show
        Miikka Heikkinen added a comment - This is a feature of applications that use inprocess ActiveQt servers, as they call qApp->setQuitOnLastWindowClosed(false) when created. To make the application quit when last window is closed, add the following line before a.exec() call in main(): QObject::connect(qApp, SIGNAL(lastWindowClosed()), &a, SLOT(quit()));
        Hide
        Miikka Heikkinen added a comment -

        Not a bug -> rejected

        Show
        Miikka Heikkinen added a comment - Not a bug -> rejected

          People

          • Assignee:
            Miikka Heikkinen
            Reporter:
            Qt Support
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Gerrit Reviews

              There are no open Gerrit changes