Thursday, May 14, 2015

Some Qt tickles for UNISA COS2614

Qt software
Some simple things to remember for the UNISA COS2614 exam, in no particular order:

Download Qt here:

Nice simple Qt examples here:

C++ if-else shorthand (ternary operators): 
condition ? value_if_true : value_if_false

Command Line Arguments: 
int main ( int argc, char *argv[] )
The integer, argc is the ARGument Count (hence argc). It is the number of arguments passed into the program from the command line, including the name of the program.

The array of character pointers is the listing of all the arguments. argv[0] is the name of the program, or an empty string if the name is not available. After that, every element number less than argc is a command line argument. You can use each argv element just like a string, or use argv as a two dimensional array. argv[argc] is a null pointer.

Explain two benefits of applying design patterns in OOP:
Improves re-usability and extensibility of software.
  • Re-usability - want to be able to re-use relevant bits of code in the simplest way possible. Design patterns attempt to express similar code in an abstract way, this allows for code reuse. We are able to design abstract classes in a way that allows us to derive from these classes and use similar code, this promotes code reusability.
  • Extensibility - how easy is it to add enhancements to an app. Design patterns also promote extensibility. A measure of how easy it is to add improvements to an application and one way of making code extensibility is to provide classes which can easily be sub-classed. Qt framework is a good example of this.

The keyword explicit can be placed before a single argument constructor in the class
definition to prevent automatic conversion from being used by the compiler. This is useful if the argument is not anything like the class it is constructing, or if there is something akin to a parent-child relationship between them.
Classes generated by QtCreator place this keyword before the generated custom widget constructors, and it is advisable that you do the same with your QWidget -derived classes.
(The keyword explicit prevents the compiler from automatically using that constructor for implicit type conversions.)

Stack and Heap stuff:
When QObjects are created with new, they are created on the heap.
Otherwise they are created on the stack.

Polymorphic Assignment:
Polymorphic assignment allows a pointer of type superclass to point to objects of its concrete subclasses.

QMessageBox::information (0, "String Reverse", reversed);

Very Simple Random number generator:

int main()
QTextStream cout(stdout);

int random = qrand() % 5;
cout << "Random number: " << random << endl;

return 0;

Very simple SIGNALS and SLOTS example:
//include necessary pre-processor directives here

int main(int argc, char *argv[]){
QApplication a(argc, argv);
QWidget w;
QLabel *label = new QLabel("Enter Text:");
QLineEdit *input = new QLineEdit("Hello");
QPushButton *clear = new QPushButton("Clear");
QVBoxLayout *layout = new QVBoxLayout();
QObject::connect(clear, SIGNAL(clicked()), input, SLOT(clear()));;
return a.exec();

What is the difference between a function declaration and a function
A function declaration describes how a function can be called.
A function definition includes the actual code that is to be executed.

Sunday, November 23, 2014

Free 3D coffee grinder

Grab this cool model for free over at turbosquid

  • Made by Turbosquid user PlastyForma
  • Created in 3ds Max 8, has V-Ray materials


Thursday, August 7, 2014

Free Terminator 3D models

Great T-800 Bust model available from TurboSquid member MarcuSCatu89 available here

Full terminator model by TurboSquid member mmarti available here

Saturday, July 26, 2014

Vray 3.0 for 3DS Max full pricelist

V-Ray 3.0 now supports 3ds Max 2015. This is how much it will cost you:

Free vuvuzela model

Thursday, December 31, 2009

V-Ray for 3ds Max - 1.5 SP4a official released

V-Ray/Max - 1.5 SP4a official is released, get it here

Modified features:
(*) Added support for projection mapping when doing texture baking;
(*) Added an option to link the V-Ray VFB to PDPlayer;

Bug fixes:
(*) Fixed some licensing issues;
(*) Turning off "Affect specular" for a dome light made it invisible to reflections as well;
(*) Fixed a crash when importing a particular .vrmesh file;
(*) Fixed crash with VRayFastSSS2 material with VRayDirt map and a standard light with VRayShadowMap;
(*) The "prepass samples" option in the motion blur rollout did not work;
(*) Fixed stuck buckets with VRayEnvironmentFog and mesh gizmos;
(*) Fixed issues with VRayEnvironmentFog and mesh gizmos with modifiers;
(*) User could not remove gizmos/lights from VRayEnvironmentFog;
(*) ParticleFlow instancing did not render all mapping channels of original mesh;
(*) Fixed crash with VFB region render when region is outside of image;
(*) Turned off by default the option to save the DR servers to the scene (caused slowdown on scene save if servers are offline);

3D models

More random 3d stuff I've made and rendered