Results 1 to 4 of 4

Thread: examples/tutorial/Addressbook

  1. #1
    Join Date
    Dec 2018
    Posts
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default examples/tutorial/Addressbook

    My question is, how am I doing?
    To be more specific, I am learning to use python 3.6 and PyQt5.
    For me, the best (only?) way to learn is to read and work with well written code.
    I liked the examples provided by Qt, particularly the Addressbook tutorial, see
    https://github.com/baoboa/pyqt5/blob...ls/addressbook
    However, there were a lot of things I would have liked to have been included in the tutorial, so I did.
    Please review the attached file.
    Let me know if this tutorial helpful for other newbies like myself, what could I do better?
    Thanks, Tim
    Attached Files Attached Files

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    4,016
    Thanks
    233
    Thanked 638 Times in 628 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: examples/tutorial/Addressbook

    Tim,

    Thanks for your post. You could make the post much more helpful if you actually listed the "lot of things I would have liked to have been included in the tutorial, so I did."

    Right now, the only way anyone can find out what you did is to compare the old and new project files and figure out what you changed. As a result, probably not too many people will have the time or interest in doing that. Posting a list of what you added will also let your changes be indexed by the forum's search engine so that someone who searches for something similar in the future will be able to discover your post.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  3. #3
    Join Date
    Dec 2018
    Posts
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Re: examples/tutorial/Addressbook

    d_stranz
    Thanks for your time and the quick response. Your observations are 100% correct.

    So let me start again.

    I liked the idea of a series of files, one building on the next towards the final app, as a learning aid.
    However, in this case, I had to carefully read each one, several times, inorder to figure out what was being done, where and how.
    So I rewrote each one to include a simple preamble as to goals, and indicated which code segments were new or changed since the previous file.

    I find extended explanations in code to be distracting (in this case there were no comments at all...), so I only added a few key comments, and references to the best online support documents I could find.

    I really like being able to collapse an entire file, and then quickly reopen just the code segments I am interested in working with.
    So I rewrote the files to make this easier to do, using the IDE geany and a number of if True: # comment statements.

    I included a few simple utilities I developed and used to help figure out what the app is actually doing.
    For example, colored output to the terminal, depending on its content and origin, can really help deciphering whats going on.

    I really like the ability to click on a QlineEdit or QtextEdit widget, and automatically open a custom edit mode for that widget.
    Since these widgets apparently dont have have a mouseClick signal, I added a file to this tutorial in which the button signal-slot system,
    is replaced with the more versatile eventFIlter function.

    I learned a lot working with AddressBook, and would like to share my learning experience with other newbies like my self.
    Thanks, twallace51
    Step1-Initial.pyStep2-btnAddSubmit.pyStep3-btnNextPrevious.pyStep4-btnEditDelete.pyStep5-btnFind.py


    Added after 5 minutes:


    Limit was 5 files, here are the last 3 ... twallace51
    Attached Files Attached Files
    Last edited by twallace51; 20th December 2018 at 19:45.

  4. The following user says thank you to twallace51 for this useful post:

    d_stranz (21st December 2018)

  5. #4
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    4,016
    Thanks
    233
    Thanked 638 Times in 628 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: examples/tutorial/Addressbook

    So I rewrote each one to include a simple preamble as to goals, and indicated which code segments were new or changed since the previous file.
    Excellent idea.

    I added a file to this tutorial in which the button signal-slot system, is replaced with the more versatile eventFilter function.
    Also nice. Event filters are often misunderstood, and as you noticed are often a straightforward means to create "signal-like" methods to handle events for which the base widget has no signals.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

Similar Threads

  1. Problem understanding the addressbook tutorial (part 3)
    By Blackened Justice in forum Newbie
    Replies: 6
    Last Post: 24th February 2012, 20:38
  2. errors in addressbook tutorial?
    By Eolo in forum Newbie
    Replies: 5
    Last Post: 23rd April 2008, 21:39
  3. qtopia applications about addressbook
    By qtopiahooo in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 13th March 2007, 08:02
  4. Replies: 2
    Last Post: 29th October 2006, 07:54
  5. Where are tutorial 2 code examples?
    By Mariane in forum Newbie
    Replies: 6
    Last Post: 25th January 2006, 15:02

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.