C++ is normally my least favorite of all of the major programming languages. I tend to avoid it like the plague, but I have always been fascinated by the Qt toolkit, so I bought a book on the Qt toolkit. It really is the sort of framework for writing software that makes you stand back and ask why something like it was never made the standard library for C++. If that had happened, C++ might not have ended up as nearly the nightmare that it is today. Hell, it might actually be somewhat friendly to casual developers! After a little bit of playing around, here is a quick bit of code that I threw together based on some samples. Pretty simple:
#include <QApplication>
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QLabel>
#include <QPushButton>
#include <QSlider>
#include <QSpinBox>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QWidget *window = new QWidget();
window->setWindowTitle("Testing...");
QSlider *slider = new QSlider(Qt::Horizontal);
slider->setRange(0,100);
QObject::connect(slider, SIGNAL(valueChanged(int)), slider, SLOT(setValue(int)));
QLabel *label = new QLabel("Testing!");
QObject::connect(slider, SIGNAL(valueChanged(int)), label, SLOT(setNum(int)));
QHBoxLayout *layout = new QHBoxLayout();
layout->addWidget(slider);
layout->addWidget(label);
QVBoxLayout *layout2 = new QVBoxLayout();
QPushButton *button = new QPushButton("Exit");
QObject::connect(button, SIGNAL(clicked()), &app, SLOT(quit()));
layout2->addLayout(layout);
layout2->addWidget(button);
window->setLayout(layout2);
window->show();
return app.exec();
}
To build it, run:
1) Save this code into a new directory (like qhello) as main.cpp
2) Run Qt\4.3.0\bin\qtvars.bat
3) cd to qhello
4) qmake -project
5) qmake qhello.pro
6) make
7) release\qhello.exe
The most significant feature besides the consistency of this toolkit is the signal/slot system that Trolltech created for Qt. Signals and slots allow you to bind your widgets together so that when something happens to one, it automatically communicates with another widget. No event handling code required!
Sorry about the multiple postss ... each time I posted I got an error message in return.
Oops! I accidentally deleted your comment when I was deleting the duplicates! In answer to your question, though, Java and Python would be my favorites.
Not a problem Mike ... though I'm still an old COBOL programmer.
I won't hold that against you...
If you haven't done so already, I highly suggest that you become an "expert" in J2EE as well. If you have those two skills, you could make even more money as you'd have the skills to transition systems away from COBOL.
I appreciate the advice MikeT.
Your Qt post caught my attention.
Sooooo many years ago I was so very much unimpressed with C though C++ was a major improvement (I'm overstating the obvious).
Strangely, I found myself more attracted to assembly language and writing macros.
Though upon further reflection, it definately seems strange about someone liking both Assembly and COBOL.