Results 1 to 3 of 3

Thread: Suggestion about Modules in a foreign language learning program I'm developing

  1. #1
    Join Date
    Jan 2012
    Posts
    2
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Suggestion about Modules in a foreign language learning program I'm developing

    Hi. I'm developing a program for learning a foreign language, written in Qt with c++, but next thing I'm gonna be working at is "Modules" (the idea of modules came from switchboard (elementary OS system settings) which uses sockets). A module can be connected to the application (by using some kind of a slot system) (I'm thinking of simply copying the module file(s) in a folder, which my application will scan and automatically load every module it finds (unless it's disabled - done from the application).
    The module will contain (here I'm not sure, I got some ideas but I'm still thinking how to do this) the module's interface (will have, maybe, 2 interfaces (the interface from where you can take a test / study - loaded separate from main application window (as in: not embed in main app window), and another one which will be embed in main app window, which will have the controls for running it's main interface (the previous mentioned interface), which will have some buttons ("Start test", "Study", maybe some more..), maybe an icon, and a title (so maybe the module could just specify what buttons it has (enable / disable the list of button my app will offer - using XML or txt, and the icon path and the title).
    Also each module will have it's own settings page (accesible from the application's settings page (a tab for each module). And also i'm thinking of letting the module manage the statistics interface (again, having a tab for each module, and, in this sittuation, each module will have it's own save file for the statistics), or i could manage the statistics window, and offer a set of predefined interfaces, from which the module will choose (really don't know how to do with statistics).
    I got only 2 ideas about how to do this: each module has it's data (widgets start pos / width-height, and all the interface data) saved in one (or more) XML file(s). This has the advantage of being easily tradeable (I want the modules to be easily transfered from one pc to another, without the need to recompile the program or to transfer any other data than the modules files), but the creator of the module can only choose from a set of predefined (in my program) widgets. Also the creator of the module can't define functions in XML.
    The other idea is using pre-compiled dll, which creates the interface / classes (possibly defining it's own functions also), and connect it to the main application (to use some of my pre-created functions (like "Next", "Previous", or whichever) using signals (each module would have to define some signals with a predefined name). But the problem here is that the module (.so / .dll) has to be compiled (so the creator of the module has to have Qt for dev installed). I never worked with dll (creating my own and using it in my program directly), so i don't know the pluses or minuses of this approach (from a programming point of view), also the modules have to be loaded automatically, by finding them in a file (so in program i don't know the name of the dll's or anything about them except some fixed signals (and functions maybe)).

    After this long description, my question is:
    How do you think would be better to implement the modules system (any idea is welcomed, right now i'm just brainstorming), would be better using XML, or precompiled librarys (I'm looking for a good (better) ratio between ease of creating a new module, and the functionality avaible to it) ?
    If you have the patience to read the text, then you got a great patience !
    Thanks !

    Note: I downloaded the code for switchboard and looked in it to try to figure out how they do it, but, except the fact that switchboard is written in vala, not c++, i couldn't really figure much. The 'module' files call GnomeCC name_of_module, and it defines an icon, a title and a category (not needed in my case, for now, I guess). GnomeCC is a 'program' built inside switchboard (it seems), it seems to be the manager that builds these interfaces, but i couldn't figure out How it decides how they look / act...
    Last edited by FreddyGod; 11th June 2012 at 17:53.

  2. #2
    Join Date
    Jan 2012
    Posts
    2
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Suggestion about Modules in a foreign language learning program I'm developing

    hmm... couldn't edit this post....
    On short is like this: I wanna implement “(learning) Modules”, which will have an interface (maybe some functions also, depending on the solutions chosen), and which will be connected to the main application automatically, by scanning the folder where the modules are found (or maybe connected through the GUI, having something like “Add Module”). (If the modules contain functions, it should define some predefined functions and signals). The solutions I thought of are using XML (can't define functions here), or using a shared library (or something similar, never worked directly with shared libraries.)
    How would you suggest implementing the "Modules" system ? Using XML, or using library, or somehow else ...? This is the next item I'll be working at is the modules system, but I still have no idea how should I implement them, so any suggestion is welcome

  3. #3
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Suggestion about Modules in a foreign language learning program I'm developing

    Read about Qt Plugins and have a look at the Plug & Paint example

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

    FreddyGod (12th June 2012)

Similar Threads

  1. Replies: 3
    Last Post: 1st June 2012, 12:54
  2. Write Qt program to a language with special symbols
    By hakermania in forum Qt Programming
    Replies: 9
    Last Post: 7th September 2010, 00:05
  3. Qt modules on Win
    By Maluko_Da_Tola in forum Newbie
    Replies: 3
    Last Post: 25th July 2010, 12:24
  4. Developing file sharing program with QT
    By qt181818 in forum Newbie
    Replies: 1
    Last Post: 25th October 2007, 06:21
  5. Qt modules
    By ber_44 in forum Qt Programming
    Replies: 3
    Last Post: 30th May 2007, 22:10

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.