82144

Qt process stays in memory after application closes

Question:

i have simple application that start QDialog from its main like this :

int main(int argc, char *argv[]) { Q_INIT_RESOURCE(resources); QApplication app(argc, argv); QCoreApplication::setApplicationName(APP_NAME); QCoreApplication::setApplicationVersion(APP_VERISON); QCoreApplication::setOrganizationDomain(APP_DOMAIN); app.setStyle("WindowsXP"); QTextCodec::setCodecForTr(QTextCodec::codecForName("utf8")); QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8")); AuthenticationDialogContainer *pAuthenticationDialogContainer = new AuthenticationDialogContainer(); if(pAuthenticationDialogContainer->exec() != QDialog::Accepted ) { return 0; } return app.exec(); }

when its pass the end of the application that is after app.exec() and the application doing what is suppose to do . when i open the windows xp task manager i see that the process is still in memory and i need manually kill it . how can i prevent it from happening ?

Answer1:

QDialog::exec is a blocking call: this code show and close the dialog before the QApplication start.<br /> You can use QDialog::show and handle the return code in QDialog::accept method.

Recommend

  • Changing stroke color changes previous strokes color
  • android drawing app: line cannot be drawn on a bitmap loaded from gallery
  • Couldn`t join two files with one key via Cascading
  • OpenLayers 3 Image and Text style zindex
  • How to get full file path from google drive using java
  • Transparent Divider in SplitPane
  • Switch between 2 values in a class [closed]
  • How to get JavaFX nodes (textarea, textfield) to resize correctly when user drags to resize the stag
  • Drawing with Transparent Paint on Android
  • Qt process stays in memory after application closes
  • Android notfication BigPictureStyle disappearing text
  • Minimize panel button
  • binding of
  • Notification using setFullScreenIntent() for BigTextStyle opening Activity automatically
  • javafx change style of a node frequently not by CSS
  • Mootools: How to Disallow `mouseenter` and `mouseleave` event when checkbox checked?
  • load a layout xml file in a View class android
  • Paint Class to draw Text
  • Can javascript be used in static FBML under pages' tab?
  • Angular 2 - style component on another components button click
  • how to draw nested circle programmatically
  • How to draw a curved line between 2 points on canvas?
  • Making games with JNativeHook
  • iText PDF body content Overlapping on Footer part
  • How can I rotate a label
  • JavaFx Images in Gridpane slowing down performance drastically
  • Draw and fill custom shape
  • Can I use setStyle() to directly change a Node's substructure class style?
  • How to change the text color in NumericStepper
  • Android - need help for ondraw() view sample
  • Error with dplyr group_by
  • CXF/JAXB Code-first service: modify XMLSchemaType of inputs
  • FLAG_SECURE not working on DialogFragment with style as DialogFragment.STYLE_NO_TITLE
  • Android Canvas drawLine not drawing on MainActivity
  • wrap content in JavaFX
  • Authenticate own Google account for Blogger API with Java
  • PictureBox zoom and scroll on mouse wheel C#
  • GCM registration works for debug APK but not release APK