Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8391299
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T19:13:26+00:00 2026-06-09T19:13:26+00:00

When programming a GUI (usually with Python and PyQt4), I try to organise my

  • 0

When programming a GUI (usually with Python and PyQt4), I try to organise my code neatly and I often face the same question:

How should the invisible objects (data) of my code relate to their visible widget counterparts (graphic representation)?

For instance, suppose I have a list of entries from a linguistic dictionary. Each entry is an abstract data object with various attributes and functions. Each entry also is represented graphically as a widget the user can interact with.

I believe there are four possible ways of organising them:

  1. the widget object is a child of the data object;
  2. the data object is a child of the widget object;
  3. the widget object and the data item are merged into one object (data are attributes of the widget);
  4. the widget object and the data object exist separately and the latter is fed into the former (e.g. as *args)

Now I am not sure whether or not there is some conventional agreement regarding this and I am not certain either whether these possible arrangements really make a difference.

What is the best practice?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T19:13:28+00:00Added an answer on June 9, 2026 at 7:13 pm

    I’ve never used Python or QT, but it sounds like you’re looking for an organization called:

    Model-View-Controller

    The idea is, that your Data Object (Model) can live far away from your Widget (View). They are coordinated by a Controller.

    This is extremely prevalent in Objective-C / Cocoa, and to a lesser extent, Android.

    Most modern web frameworks are also based on this concept, as well.

    EDIT: At least to some degree, QT does as well:

    http://doc.qt.nokia.com/qq/qq10-mvc.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to Python and am starting to teach myself GUI programming (hopefully) using
Is examples code of c++ GUI programming with QT4 source code available to download
I am trying to learn PyQt from rapid gui programming with python and qt
I am starting GUI programming and I have a question about windows. I have
I'm new with python programming and GUI. I search on internet about GUI programming
I'm sort of new to Windows GUI programming. I got some code which works
I've just started programming in PyQt and I'm following Rapid GUI programming in Python
In the following code from the C++ GUI Programming with Qt 4 , where
I'm teaching an introductory class to programming and GUI development using Python, and have
This is a Cocoa n00b question - I've been programming GUI applications for years

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.