Welcome! Log In Create A New Profile


Finished Ass 2, Very Unhappy

Posted by Hellocat 
Announcements Last Post
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
Finished Ass 2, Very Unhappy
April 01, 2010 12:43PM
I just finished assignment 2, and I've got to say I'm very unhappy with this module. Granted it's the first time they've run it, and there will be some teething problems, but it's really a bit extreme.

To start with, the prescribed book is bad. Very bad. Oh so very bad it makes me want to set it on fire. The authors don't actually explain anything at all. They'll give a brief definition of a very tricky concept (let's take chapter 9, for example, dealing with composite patterns, slots, signals etc.), then give us a hugely complex example that's embedded in an even more complex overall program. The SliderLCD exampled in chapter 9 is a joke. It uses a variety of things that the authors have never spoken of up to this point, and it really doesn't explain the concept of slots and signals at all, it kind of just assumes you'll figure it out. The fact that the lecturers repeatedly point out that the textbook is wrong on many points should have tipped them off to the fact that it sucks.

The assumption in the book seems to be that you'll check out the QT documentation for some actual proper insight into how everything works. Woe unto us if this is the case. The QT documentations is appaling. I never though I'd say MSDN is better than anything on this earth, but compared to the QT stuff it's awesome.

The internet is also sadly lacking in useful information about QT. The reason is simply that no one uses it. It's a terribly unstable joke of a program. It has major issues with Vista, and even throws a tantrum when you work on XP. The error messages are unintelligble for the most part, and code often bizarrely refuses to compile, even when it's the simplest of programs (of course paste the code into Visual C++ and it works fine).

Why on earth we are using QT is beyond me. We should be doing MFC if we want to do C++, or if we want to do something that is actually used in the industry, we should be learning C# and WPF, or at least java.

The actual amount of work expected of us in the assigment is also incredible. I'm doing 10 subjects this semester, and COS2144's 2nd assignment is probably as much work as 3 of the others combined (and I'm including COS 211X in that calculation).

Am I the only one who feels this way? Becaue I've never been this angry over a UNISA module.
avatar Re: Finished Ass 2, Very Unhappy
April 01, 2010 03:03PM
Having programmed in Java, MFC and Qt, I find the latter the easiest.

As far as the Qt documentation goes, it never claims to be a documentation on how to program in C++. It actually assumes you know what you're doing. If you know the language, the documentation appears clear and complete. I've never had a problem understanding it. I agree with you, I find MSDN fantastic but it's usefulness is for C++/C#/VB/J# reference and Windows APIs. It is a lot more dense and the examples less complete as those in the Qt Documentation. The latter has sections that go in-depth into fundamental concepts whereas MSDN is purely a reference.

To say nobody uses Qt is an unsubstantiated lie. There are many people who use it and it's usage is rapidly increasing. The entirety of KDE is built with it. Ever used Skype? VLC Media Player? Google Earth?


It's a terribly unstable joke of a program

It is not a program, it's a framework and it's extremely stable. There were some issues with Vista (a lot of languages, frameworks, and programs had them), these have largely been sorted out with the release of version 4.6.

If you think MFC is better, consider the following beginners tutorial I googled (top entry for the search string "MFC Tutorial"winking smiley:

Language: C++
#include <afxwin.h>   class MFC_Tutorial_Window :public CFrameWnd { public: MFC_Tutorial_Window() { Create(NULL,"MFC Tutorial Part 1 CoderSource Window"); } };   class MyApp :public CWinApp { MFC_Tutorial_Window *wnd; public: BOOL InitInstance() { wnd = new MFC_Tutorial_Window(); m_pMainWnd = wnd; m_pMainWnd->ShowWindow(1); return 1; } };   MyApp theApp;

You say that you're still doing COS211. Assuming that most of your fellow students are also doing COS211 - ie the majority only have COS111 and COS112 behind them - how would you even explain where the program begins. How would you explain the program flow?

Consider the following equivalent using the Qt Framework:

Language: C++ (QT)
#include <QApplication> #include <QLabel>   int main(int argc, char **argv){ QApplication app(argc, argv);   QLabel display("Qt Example - Hello World"); display.show();   return app.exec(); }

Which would you say would be easier to explain to your average co-student?

You say that signals and slots have not been adequately explained. Have you had a look at the documentation? I found that quite clear and understandable. Have you seen the equivalent for MFC? I might be mistaken but I'm not aware that either MFC, Java or C# contain the Observer Pattern built-in. This is a very powerful and useful concept.

I suggest that you are misplacing your frustrations on the tool instead of your lack of understanding. The tool is good. Get your head around the basics and your eyes will open.
Re: Finished Ass 2, Very Unhappy
April 01, 2010 04:45PM
Hi Guys

Must say I have grown to like the QT framework, it also seems to be used is a few places, have a look at Wiki
I don’t think the problem with this module is the QT framework , having been involved with programming and C++ for a few years I must say I do find the book to be a bit vague at times however the QT documentation available at trolltech.com seems to be pretty complete along with numerous examples and demos.

Also I did not find the amount of work in the assignment to be all that much, granted it made you think a bit but alot of what had to be done in the console app was just basics, the SLiderLCD app did require the learning of some new things within and about the QT framework , once again the principles are still the same as if you were coding in most other languages i.e. creating objects and calling methods and setting properties on those objects, just in another flavour.

I think this module has been good exercise in learning a new framework , all that they are trying to teach are the basics , there are always going to be new languages, technologies and frameworks to learn , and if you have learnt and have managed to understand the ground work you will have a much easier time understanding things to come.

I am doing 9 modules this year part time , with the majority of them being 3rd level modules , not sure if you have done any 3rd level modules yet, most of them have way more material to cover and the assignments require more thinking and research and less "spoon" feeding.

I must say i do agree with robanaurochs ,QT is good , but i do also agree with Hellocat about the prescribed book not being that great.

Anyway , just my opinion.

avatar Re: Finished Ass 2, Very Unhappy
April 01, 2010 05:24PM
FYI, It's not QT, it's Qt and apparently the Danes pronounce it "cute".
Re: Finished Ass 2, Very Unhappy
April 01, 2010 06:11PM
I've never actually registered on these forums, cause i've never seen the need. But I thought this post warranted it.

I agree with Hellocat, the textbook is atrocious. It assumes A LOT from the reader, and a lot of its information is vague, misleading and downright wrong (the lecturers even admit this). Why we are using it i am not sure. The Qt documentation is also not great, but I think Hellocat overstates it a bit.

Robanaurochs, I think you're being extremely condescending. You say "It actually assumes you know what you're doing. If you know the language, the documentation appears clear and complete." and " I found that quite clear and understandable." You've been on these boards since 2005. I think it's fair to say you have a pretty damn good head start on the rest of us, so for you to say how easy it is for you to understand really isn't very helpful. There is a HUGE gap between COS112 and this module, and I think this module does nothing to address it. If they told use "here's the stuff, learn it", it would be fair enough, but the lecturers seem to think we'll all just figure it out somehow. Of course we CAN do that, but what the hell am I paying the university for then?

Also, Qt is really not that popular. Of course it has been used by some people, but it is by NO means an industry standard or anything close to it. MFC is probably more widely used than Qt and WPF combined. And while your little code sample makes MFC look very complicated, it isn't really. If you use Visual Studio the amount of coding you have to do is minimal, and the Visual IDE is a breeze to use.

I asked a couple of friends in the industry, and to a man they all said C# is the only way to go, and the don't even know why we're doing C++. Now I understand C++ is a nice foundation language, and I quite enjoy it, I would also like to at least learn something else like Java or C#. I understand this module was Java before. We're doing quite a lot of C++ already, why not mix it up a little?

And finally, the Observer Pattern is not exactly the be-all and end-all feature of Qt. C# has had it from the start - http://stackoverflow.com/questions/32034/in-c-isnt-the-observer-pattern-already-implemented-using-events
avatar Re: Finished Ass 2, Very Unhappy
April 01, 2010 09:24PM
I wasn't being condescending at all. I was referring to the Qt documentation. They do not, at any point teach you anything to do with the C++ language, it is implied that you know it already. Hellocat was comparing the documentation to MSDN, where the layout and presentation is far more dense than the Qt documentation. In addition, there are few, if any, complete examples on MSDN.

I was mentioning MFC because:
Why on earth we are using QT is beyond me. We should be doing MFC if we want to do C++

My point was not about how quickly you can create a program using the IDE. The course, unless it's changed is about programming concepts. It's no longer about teaching the language. In COS111 and COS112, you were introduced to C++. What you learnt there is not enough to help you learn stuff like networking and threading. You need some kind of a library or framework. When I did COS214, we used Java which comes bundled with the Development Toolkit with all the classes you need to do the job.

Consider the difference between MFC and Qt from a pedagogical point of view, especially since you admit that there's a big jump between COS112 and COS214. Would you say that MFC would be easier to learn than Qt? Bear in mind that you can only assume that the student knows as much C++ as taught in COS112. Qt introduces new classes and a small addition to the language in the form of a few new keywords (signals, slots, emit, foreach, forever). MFC introduces the world of precompiler code and set of classes that are merely wrappers to the Windows API. Qt is a lot more abstract and doesnt' conform to any platform's API. Speaking of which, MFC is only easy from a GUI design point of view if you're using Visual Studio, by hand, it's tedious. You can program Qt with any C++ compiler and IDE

The point of the course is not to teach a framework but rather programming concepts. The more you burden the student with in terms of learning a framework or language, the less time you have to teach the concepts.

Lastly, I never said the Observer pattern was the "be-all and end-all feature of Qt". Neither did I imply it. The biggest feature is it's portability. Something it's rivalling only Java with. The events system in C# is a very limited implimentation of the Observer pattern. You cannot send messages across thread boundaries, using Qt's signals and slots, you can. Qt also has a similar events mechanism but it is mostly used only for handling messages from the operating system.
Unable to compile any of my programs
April 03, 2010 02:12PM
On every program that I try to compile I get the following error messages:

c:\Qt\2009.03\qt\lib/libqtmaind.a:-1: error: In function `WinMain':
C:/qt-greenhouse/Trolltech/Code_less_create_more/Trolltech/Code_less_create_more/Troll/4.5.0/qt/src/winmain/qtmain_win.cpp:136: undefined reference to `qMain(int, char**)'
:-1: error: collect2: ld returned 1 exit status

The compiler output shows this:

Exited with code 2.
Error while building project download2
When executing build step 'Make'

Can someone please help. I cannot get to finish my assignment 2, and it is now falling behind as it was due on the 1st April 2010

avatar Re: Finished Ass 2, Very Unhappy
April 03, 2010 07:51PM
What does your entry function look like? Is it

Language: C++ (QT)
int main(int argc, char **argv)


Check to see if you used capitalisation in your function name, check that you used two *'s and not one. Make sure your types are correct.
Re: Unable to compile any of my programs
April 04, 2010 07:31PM
This time I simply copied the program eventloops which I extracted from the CD2010 to my PC C:drive and I tried to compile it. I got exactly the error messages that I pasted previously.
This is the program exactly as it is on the disk CD2010 COS2144

#include <QApplication>
#include <QPushButton>
#include <QTextEdit>
#include <QVBoxLayout>
#include <QDebug>

#include "messager.h"

/** First interactive GUI application
Uses buttons, signals and slots.

//start id=setgui
QWidget* setGui(QWidget *box) {
QLayout* layout = new QVBoxLayout;
box->setLayout(layout); /* box is the parent of layout. */

QTextEdit *te = new QTextEdit; /* window for qDebug messages */
layout->addWidget(te); /* add as grandchild to box */

te->setHtml("Some <b>text</b> in the <tt>QTextEdit</tt>"
"edit window <i>please</i>?"winking smiley;

QPushButton *quitButton=new QPushButton("Quit"winking smiley;

QPushButton *shoutButton = new QPushButton("Shout"winking smiley;

Messager *msgr = new Messager("This dialog will self-destruct.", box);

QObject::connect(quitButton, SIGNAL(clicked()),
qApp, SLOT(quit())); /* qApp is a global variable that
points to the current QApplication object. */

qApp->connect(shoutButton, SIGNAL(clicked()), msgr, SLOT(shout()));
return box;

//start id=main
int main(int argc, char * argv[]) {
QApplication myapp(argc, argv); /* Every GUI, multithreaded,
or event-driven Qt Application must have
a QApplication object defined at the top
of main(). */

QWidget rootWidget;

rootWidget.show(); /* Show the widget on the screen. */
return myapp.exec(); /* Enter an event loop. */
This is the header file
#ifndef MESSAGER_H
#define MESSAGER_H

#include <QObject>
#include <QString>
#include <QErrorMessage>

class Messager : public QObject {
Messager (QString msg, QWidget* parent=0);

public slots:
void shout();

QWidget* m_Parent;
QErrorMessage* message;

and the messager program:
#include "messager.h"

Messager::Messager(QString msg, QWidget* parent)
: m_Parent(parent) {
message = new QErrorMessage(parent);

void Messager::shout() {

I even re-installed the Qt creator from another CD. I ams still not winning
avatar Re: Finished Ass 2, Very Unhappy
April 05, 2010 10:35AM
I know what your problem is and I can give you a work-around but I'm not quite sure how you would solve this.

The problem is that your program is not looking for main as it's entry point, it's looking for qMain. This only happens if you use the g++ or the Borland Compiler. When either of these two compilers are being used, the precompiler macro QT_USE_QMAIN is defined. This effectively makes qMain the entry point and not main.

I understand that this is, or was, because these two compilers define their own main function if you compile the program as a windows (as apposed to a console app) application and the Qt framework needs to pass control over to you.

Why this is only happening to you and not to other people, I don't know. Try running your program and changing your entry point function to qMain, I'll try and find out why it's happening. I use Visual Studio so I don't get this error.
Re: Finished Ass 2, Very Unhappy
April 05, 2010 03:08PM
Thanks very much for your support. I will try and work around the problem
Re: Finished Ass 2, Very Unhappy
April 05, 2010 04:02PM
This one ran fine:

//#include "main.h"
#include <QApplication>
#include <QString>
#include <QLabel>
#include <QWidget>
#include <QDebug>
#include <QTextStream>

int main(int argc, char* argv[])
QApplication myapp(argc, argv);
QWidget wid;
qDebug() << "sizeof widget: " << sizeof(wid)
<< " sizeof qapplication: " << sizeof(myapp) ;
QString message;
QTextStream buf(&message);
buf << "A QWidget is " << sizeof(wid)
<< " bytes. \nA QObject is " << sizeof(QObject)
<< " bytes. \nA QApplication is " << sizeof(myapp)
<< " bytes.";
qDebug() << message;
QLabel label(message);
return myapp.exec();

I just need to find out why that other one is not doing running.
avatar Re: Finished Ass 2, Very Unhappy
April 07, 2010 02:33PM
For those complaining about the complexity of COS214 this year compared to COS112, I do believe it was stated quite clearly in the UNISA documentation that you should complete COS211 first before attempting COS214. So, if you were arrogant enough to disregard their advice and are now complaining, it is your problem. You were advised.
avatar Re: Finished Ass 2, Very Unhappy
April 07, 2010 06:15PM
You cant complete a module without completing its required modules first? Anyway, I have completed both COS211, etc and still find it a little challenging but I know that I am not paying it enough attention... I have started downloading all the videos by EZUST and looks to be pretty more helpful... We will see...
Re: Finished Ass 2, Very Unhappy
April 07, 2010 10:45PM
Wow, thanks Henry, you've enlightened us all. I would LOVE for you to show us all where "quite clearly in the UNISA documentation" is. I've gone through the whole registration pack UNISA sent me, and according to that information the only prerequisite for COS2144 is COS112. I've gone through the whole of the COS211 documentation, as well as the COS214 documentation, and there is not one mention of any relationship between the two subjects, let alone anything about having to complete COS211 first.

So please, go on. Tell us how arrogant we are, I'm dying to know.
Re: Finished Ass 2, Very Unhappy
April 12, 2010 03:37PM
I also have this strong resentment to tht way that this module is being presented... I am paying money so I can be pointed in the right direction in as far as learning is concerned. But the way this module has been handed down to us... well all I can say is that I feel like I am a guinea pig. Are the lecturers going to leave us to wonder blindly or are they going to step in at some point and lend a hand. It's bad enough having to do this module thru distance education without the lecturers shutting themselves in and pretending that the textbook will do everything
Sorry, only registered users may post in this forum.

Click here to login