A little is hidden in Qt given splendid documentation. But given vastness of Qt functionality paradoxically many useful features have been overlooked by me (and reimplemented or work-arounded).
What Qt functions you wish you have noticed earlier?
A little is hidden in Qt given splendid documentation. But given vastness of Qt functionality paradoxically many useful features have been overlooked by me (and reimplemented or work-arounded).
What Qt functions you wish you have noticed earlier?
One feature I found too late was stdin-stout handling through QFile. I could drop then all std::*.
Other was (not easy to find in documetation):
qDebug () << x;
Which proved very convenient for debugging.
Recently I found easy serialization class QDataStream.
qPrintable( string )
is easier to remember and quicker to type than string..toLocal8Bit().constData()
.QSignalMapper
for funneling a lot of signals into one slot with an index.QPointer
I'm sure I'll think of more later, as well.
Here's a list that I blogged recently:
CONFIG += silent
for qmake project files. Hides full compiler output unless there's a warning or error.You can connect signals to signals in order to emit a signal automatically. This is useful to provide signals from underlying classes. QTabWidget uses a QTabBar and exposes the signals from the QTabBar using a trick like this:
connect(myObj, SIGNAL(internalSignal(int)), SIGNAL(externalSignal(int)));
Which will make the current class emit externalSignal(int) when myObj emits internalSignal(int). This helps with the signal side of things at least. There is no equivalent way to do this with slots that I know of; the only simple way is to make your externalSlot call internalSlot.
Source: http://goo.gl/laiU