haha thinking in C++ is a little less targeted than what I was expecting. But I suppose the message is that Qt doesn't add any garbage collection functionality? I only ask because in the examples I've seen there is never any reimplementation of the destructors to delete the memory allocated to the new members...
For instance maybe something like this:
#ifndef DIALOG_H
#define DIALOG_H
#include <QDialog>
#include "fortuneserver.h"
{
Q_OBJECT
public:
private:
FortuneServer server;
};
#endif
#ifndef DIALOG_H
#define DIALOG_H
#include <QDialog>
#include "fortuneserver.h"
class QLabel;
class QPushButton;
class Dialog : public QDialog
{
Q_OBJECT
public:
Dialog(QWidget *parent = 0);
private:
QLabel *statusLabel;
QPushButton *quitButton;
FortuneServer server;
};
#endif
To copy to clipboard, switch view to plain text mode
I don't see a specialized destructor and I'm just curious when I would need the destructor.
Bookmarks