Results 1 to 2 of 2

Thread: Recipe Manager

  1. #1

    Default Recipe Manager

    I am trying to create a Recipe Manager using PyQT. I have created a main window that displays all the recipes within a selected folder.

    I am trying to implement a New Recipe button to allow for new recipes to be created and stored in a text file.

    To do this I have created two dialog windows.
    The first window is used to enter the recipe name and the number of ingredients, and the second to enter each ingredient.

    However, I need some help displaying the ingredient window the required amount of time e.g. if the number of ingredients is 2, the ingredient window must be opened once, get the input and store in the text file, and then reopened for the second ingredient in the recipe.

    Is there any way to wait until the window has been closed?
    e.g. for x in range(0, Number of ingredients):
    self.IngredientWindow.show()
    wait untill IngredientWindow has been closed

    Any help on this would be much appreciated.

    EDIT: Would the structure be similar to this question: http://stackoverflow.com/questions/8...qwidget-closes
    Not sure how to apply this to Python
    Last edited by gecko2903; 12th February 2017 at 18:10.

  2. #2
    Join Date
    Aug 2010
    Posts
    99
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Recipe Manager

    If it's a modal dialog, then your code will not continue until the dialog is closed, so you don't have to do anything (i.e. that pseudo-code you provided will do what you want).

    However, your users may prefer entering all information on just one window, rather than having many windows pop up in turn. It seems like you are quite new to this, but perhaps in the future you might think about ways to allow ingredients to all be entered in one window. I'd imagine a text box with an "Add" button below that adds another text box for the next ingredient. The window would have to grow or show scroll bars when the number of ingredients gets large.

    That stack overflow page also mentions using a modal dialog. As for how to do it in Python, I'm sure PyQt also has a QDialog class with an exec method.
    Last edited by xtal256; 12th February 2017 at 23:47. Reason: updated contents

Similar Threads

  1. Replies: 1
    Last Post: 24th August 2011, 13:34
  2. Qt Memory manager
    By bunjee in forum Qt Programming
    Replies: 3
    Last Post: 19th August 2009, 18:43
  3. QXmlQuery problems - recipe example doesn't work
    By nhelseth in forum Qt Programming
    Replies: 0
    Last Post: 16th January 2009, 22:45
  4. Download Manager Like IDM(Internet Download Manager)
    By sathiskumarmsk in forum Qt Programming
    Replies: 1
    Last Post: 27th July 2008, 16:52
  5. mapping manager
    By sreedhar in forum Qt Programming
    Replies: 6
    Last Post: 16th February 2007, 14:48

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.