Show all posts by user
Report spam
Page 1 of 31
Pages: 12345
Results 1 — 30 of 903
I was forced to downgrade to Windows 8 at work. It is blatantly clear that the people who designed the interface did not take into account people with OCD or any sense of organisation. I can't understand why Windows 8 and Unity have done away with the menu.
Not to worry though, I found an "app" which simulates the old start menu. www.pokki.com You can even set it so that it pops
by
robanaurochs
-
Useful NONACADEMIC tips & solutions
I'm an old student. I just haven't visited Osprey in a while.
by
robanaurochs
-
COS3712
Quotedubbelodub
The int will be your exit status (0 - Normal Termination , 1 - Abnormal Termination)
This is not a rule, this is merely a convention. You can return any value you wish. The return value is only of use if your program was executed by some other program and it needs to know whether your program succeeded or not, or if some other state was achieved. The actual values are irrelevan
by
robanaurochs
-
COS3712
Quoteerror C:\unisa\COS3712\Untitled11.cpp:233`main' must return `int'
C:\unisa\COS3712\Makefile.win exe: *** Error 1
You're all over-analysing and missing the point. You need to actually read the error messages before wildly guessing at possible causes.
When I read these two message lines, what I see is that there is one error. The second line merely restates that the comp
by
robanaurochs
-
COS3712
Hi Mac
1. There are multiple user accounts issuing spam messages in the COS3114 forum from 2011. For the past couple of days, I've gotten hundreds of relayed emails of new posts from this forum.
2. How do I un-link to a forum I'm no longer interested in following?
by
robanaurochs
-
Spam
Anytime you see an error of the type "undefined reference", it's a linker error. What's happening is that your code is referencing some code that somebody else wrote and compiled into a library of some sort, and that code has not been incorporated into your final executable yet.
It's all well and good to #include a header file to some 3rd party code but that only takes
by
robanaurochs
-
COS3711
What is a "sub". Were you hungry when you were typing this, thinking of a Debonair's sub perhaps?
You're probably referring to "sup", which is short for "supplementary examination"
Good luck.
by
robanaurochs
-
COS2144
@dubbelodub
If you didn't inherit BlackJack from QMainWindow, did you use QPushButtons instead of a QMenu and a QToolBar? This is the only way I can think you might have used to get around without using QActions.
If your program works and performs all of the requirements, excellent, congratulations.
A word of warning though for more complex programs. You've briefly started lea
by
robanaurochs
-
COS2144
@dubblelodub
Your coupling is unnecessarily tight.
Why do you want the BlackJack class to clean up the card layouts. If you look at the UML diagram, the QLabels belong to the Card class so that class should control their creation and deletion. The layouts are the property of the HandView class and thus cleanup is the responsibility of the HandView class.
The only GUI things the BlackJac
by
robanaurochs
-
COS2144
You're welcome.
The easiest part of learning to program is learning the language and a particular Framework/Toolkit. The hardest part is learning how to analyse a problem and to design a solution. That's what this course and the 3rd level course are really trying to do. Using Qt is largely irrelevant.
by
robanaurochs
-
COS2144
Your HandView should not be creating QLabels. It should be querying the Hand instance for what Cards it has and then getting a pointer to those Cards' labels.
Also, you've got duplication here. The constructor and HandView:: setModel(Hand *hand) should basically be doing the same things.
Apart from other initialisation, your HandView constructor should be like:
Language: C++ (Q
by
robanaurochs
-
COS2144
@Spectre
Don't panic. It's not as difficult as you think.
Go back to the basics. QWidget is a derivative of QObject so it can contain children. In the case of QWidget, any child QWidget will be drawn inside it unless it's visible property is set to false. Thus, in order to get any QWidget to draw inside another one, just set the one as the parent of the other.
Inside Hand
by
robanaurochs
-
COS2144
@Spectre
New Hand and Deal hand are two different tasks.
Remember that your HandView is in charge of displaying the cards. It doesn't own them, nor should it keep hold of references to them, that's the job of the Hand class. When you reset the game, the Hand instances should clear all references to cards and then let the HandView instance know of any changes.
The HandView class
by
robanaurochs
-
COS2144
@Spectre and @crunx
This task is not beyond your capabilities, nor are the lecturers asking too much of you. You're just panicking. The trick to becoming a good programmer is to be able to break a problem down into manageable subtasks. Once you've done that, you'll see that the subtasks are fairly easy to solve individually and that once you've put them altogether, your ent
by
robanaurochs
-
COS2144
@Spectre
QLayout (and it's derivatives) are just layout managers, they only affect the position and size of QWidgets. Removing a QWidget from a layout will not make it disappear, it will probably just move it to the upper left-hand corner of the parent QWidget.
by
robanaurochs
-
COS2144
@Spectre
This is normally how requirement specs sometimes turn out. You have to use a lot of imagination. How you do it is less important than getting it done.
I would suggest going through a number of iterations of divide-and-conquer and you'll end up with quite a number of classes. Don't limit yourself to only those in the UML diagram.
by
robanaurochs
-
COS2144
@crunx
Try using qsrand(QDateTime::currentDateTime(). toTime_t())
and then use qrand() whenever you need a random number.
by
robanaurochs
-
COS2144
If you take all the bells and whistles out of a computer game, there's very little difference between it and any other kind of computer program.
The MVC (Model, View, Controller) pattern comes in quite handy for this. You have your entire game's state stored inside a class or group of classes (the model) that is modified by other classes that handle user interaction (the controller).
by
robanaurochs
-
COS2144
There's no need to try and re-invent the wheel. This has been done many times in the past and is public knowledge. Google "suffle algorithm" and you'll find a lot of options.
Personally, the one that seems least of a hassle is the Durstenfeld version of the Fisher–Yates algorithm. It shouldn't be too difficult to implement.
by
robanaurochs
-
COS2144
Why do you have in the line:
LIBS += -L$$(CPPLIBS) \
-lutils \
-lcards2
The line for linking in a static library called cards2.a? Does this file actually exist? Are you not making a mistake here? Do you understand what a static library is and what it's for? What's in the cards2.a library that you need in your project?
by
robanaurochs
-
COS2144
QuoteSpecre
On the other hand, when I try to compile a program (Example 11.4 and 11.5), I always get these errors - "cannot find - lcards2" and "collect2: Id returned 1 exit status". Tutorial letter 102's so useless
If the linker says it can't find -lcards2 then it means you've told it to link in a static library called cards2.a and it is struggling to find i
by
robanaurochs
-
COS2144
@Crunx. Don't panic. You're not on your own here. It takes a while to get the idea of the Serializer Pattern into your mind but once you get it, it's fairly simple.
If you take the barebones concept behind the pattern, it's to take a complex hierarchical data structure and lay it out in a linear fashion (byte after byte) and then be able to reverse the process. In a nutshel
by
robanaurochs
-
COS2144
@Eddy
I think this was a retype and not a copy/paste. The errors you see would have been picked up by the compiler before they got to the linker.
by
robanaurochs
-
COS2144
@Ben
When looking up function pointers, ignore the highly complex examples. The syntax allows for some strange extremes that can boggle your mind and teachers of C++ love showing off with highly elaborate function pointer definitions but, to be honest, I've never seen any in real code that come even close to the extremes that you find in tutorials and textbooks.
by
robanaurochs
-
COS2144
OH!!!!!
You're deriving Single and Shared from Booking.
Give Booking an empty virtual destructor. This is a very important rule of thumb that's very seldomly documented. Whenever deriving a class, the base class should have a virtual destructor, otherwise the wrong destructor might get called.
This might not be the problem, but it's a very important thing to know.
by
robanaurochs
-
COS2144
What do all the constructors of Single look like?
by
robanaurochs
-
COS2144
QuoteE:\unisa\cos2614\A2Q1-build-desktop/../A2Q1/booking.cpp:5: undefined reference to `vtable for Booking'
This means that the error is on line 5 of booking.cpp
Paste this please.
by
robanaurochs
-
COS2144
Nope, that's not it Ben. QMake will convert the .pro file to a MAKEFILE and then it gets processed by MinGW like any other ordinary C++ project.
If you look at the header file of the Booking class' definition, you'll see there's a #include "Person.h". This means that the Person.h file will be opened by then precompiler and the Person class definition will be seen
by
robanaurochs
-
COS2144
Post more of the error list. That error message is not enough.
by
robanaurochs
-
COS2144
Try researching QObject:: children() in the documentation.
by
robanaurochs
-
COS2144
Page 1 of 31
Pages: 12345