Click here to Skip to main content
15,605,787 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionWhy #if 0 ... #endif Pin
Member 1496877115-Jan-23 15:45
Member 1496877115-Jan-23 15:45 
AnswerRe: Why #if 0 ... #endif Pin
Mircea Neacsu15-Jan-23 15:57
Mircea Neacsu15-Jan-23 15:57 
GeneralRe: Why #if 0 ... #endif Pin
Member 1496877115-Jan-23 16:43
Member 1496877115-Jan-23 16:43 
GeneralRe: Why #if 0 ... #endif Pin
CPallini15-Jan-23 20:36
mveCPallini15-Jan-23 20:36 
QuestionWhere does this .exe store its pane layout? Pin
Bardo Mueller15-Jan-23 9:09
Bardo Mueller15-Jan-23 9:09 
AnswerRe: Where does this .exe store its pane layout? Pin
OriginalGriff15-Jan-23 9:10
mvaOriginalGriff15-Jan-23 9:10 
GeneralRe: Where does this .exe store its pane layout? Pin
Bardo Mueller15-Jan-23 11:30
Bardo Mueller15-Jan-23 11:30 
QuestionWhy "so many " - include , forward declaration... Pin
Member 1496877114-Jan-23 5:42
Member 1496877114-Jan-23 5:42 
This .cpp has me confused.

It has @includes
some QT specific
QT_FORWARD_DECLARE_CLASS

and plain
forward declarations

Seems redundant...

Why so many "prerequisites" or whatever the correct term for all this is ?



C++
<pre>#define TRACE
#include "ui_chat.h"

// add library
#include "../BLUETOOTH_LIBRARY/bluetooth_library.h"
#include <QtWidgets/qdialog.h>



#include "QtBluetooth/qbluetoothdevicediscoveryagent.h"
#include "QtBluetooth/qbluetoothdeviceinfo.h"
#include "QtBluetooth/qbluetoothlocaldevice.h"

#include <QtBluetooth/qbluetoothhostinfo.h>
QT_FORWARD_DECLARE_CLASS(QBluetoothDeviceDiscoveryAgent)
QT_FORWARD_DECLARE_CLASS(QBluetoothDeviceInfo)
QT_USE_NAMESPACE

class ChatServer;
class ChatClient;

//! [declaration]
class Chat : public QDialog
{
    Q_OBJECT

public:
    explicit Chat(QWidget *parent = nullptr);
    ~Chat();

    MainWindow_ScanAdapters *MWSA = new MainWindow_ScanAdapters();
    QString text;
signals:
    void sendMessage(const QString &message);

private slots:

    // FROM BTSCANNER
#ifdef BYPASS
    void addDevice(const QBluetoothDeviceInfo&);
    void on_power_clicked(bool clicked);
    void on_discoverable_clicked(bool clicked);
    void displayPairingMenu(const QPoint &pos);
    void pairingDone(const QBluetoothAddress&, QBluetoothLocalDevice::Pairing);
#endif
    void connectClicked();
    void sendClicked();

    void showMessage(const QString &sender, const QString &message);

    void clientConnected(const QString &name);
    void clientDisconnected(const QString &name);
    void clientDisconnected();
    void connected(const QString &name);
    void reactOnSocketError(const QString &error);

    void newAdapterSelected();

    void on_connectButton_clicked();

private:
    int adapterFromUserSelection() const;
    int currentAdapterIndex = 0;
    Ui_Chat *ui;

    ChatServer *server;
    QList<ChatClient *> clients;
    QList<QBluetoothHostInfo> localAdapters;

public:
    QBluetoothDeviceDiscoveryAgent *discoveryAgent;
    QBluetoothLocalDevice *localDevice;
    // Ui_DeviceDiscovery *ui;



    QString localName;
};
//! [declaration]

AnswerRe: Why "so many " - include , forward declaration... Pin
CPallini14-Jan-23 7:23
mveCPallini14-Jan-23 7:23 
AnswerRe: Why "so many " - include , forward declaration... Pin
Richard MacCutchan14-Jan-23 22:25
mveRichard MacCutchan14-Jan-23 22:25 
AnswerRe: Why "so many " - include , forward declaration... Pin
jschell15-Jan-23 8:00
jschell15-Jan-23 8:00 
GeneralRe: Why "so many " - include , forward declaration... Pin
Member 1496877115-Jan-23 16:56
Member 1496877115-Jan-23 16:56 
GeneralRe: Why "so many " - include , forward declaration... Pin
jschell17-Jan-23 3:33
jschell17-Jan-23 3:33 
QuestionCRichEditCtrl size limit Pin
ForNow11-Jan-23 15:22
ForNow11-Jan-23 15:22 
AnswerRe: CRichEditCtrl size limit Pin
Mircea Neacsu11-Jan-23 15:47
Mircea Neacsu11-Jan-23 15:47 
GeneralRe: CRichEditCtrl size limit Pin
ForNow11-Jan-23 15:48
ForNow11-Jan-23 15:48 
QuestionBitmaps, device dependent vs device independent, which is faster (or better)? Pin
Member 1507871611-Jan-23 10:57
Member 1507871611-Jan-23 10:57 
AnswerRe: Bitmaps, device dependent vs device independent, which is faster (or better)? Pin
CPallini11-Jan-23 20:43
mveCPallini11-Jan-23 20:43 
Questionwhat I am doing regarding Heap corruption Pin
ForNow10-Jan-23 15:33
ForNow10-Jan-23 15:33 
AnswerRe: what I am doing regarding Heap corruption Pin
CPallini10-Jan-23 20:08
mveCPallini10-Jan-23 20:08 
GeneralRe: what I am doing regarding Heap corruption Pin
ForNow11-Jan-23 1:33
ForNow11-Jan-23 1:33 
GeneralRe: what I am doing regarding Heap corruption Pin
CPallini11-Jan-23 1:40
mveCPallini11-Jan-23 1:40 
GeneralRe: what I am doing regarding Heap corruption Pin
Mircea Neacsu11-Jan-23 7:04
Mircea Neacsu11-Jan-23 7:04 
GeneralRe: what I am doing regarding Heap corruption Pin
ForNow11-Jan-23 7:25
ForNow11-Jan-23 7:25 
QuestionHeap Storage Corruption Pin
ForNow10-Jan-23 3:44
ForNow10-Jan-23 3:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.