VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages

This example shows how to register for a VR-Link interaction (in this case the comment interaction) and can pass that information to the GUI via an event signaler.

This example is an example of a protocol dependent example.

This example will show how to:

exampleMenu.h

/******************************************************************************
** Copyright (c) 2012 MAK Technologies, Inc.
** All rights reserved.
******************************************************************************/
/******************************************************************************
** $RCSfile: exampleMenu.h,v $ $Revision: 1.2 $ $State: Exp $
******************************************************************************/
//\file exampleMenu.h
//\brief Contains declarations example menu and menu item classes
#pragma once
//New main menu. This menu will be used to hold the Remote Control Console menu item
{
public:
virtual ~DtCallbackMenu() override;
// Must implement in order to create Qt menu
virtual QMenu* createMenu(makVrv::DtDe& de, QWidget* parent) override;
};
//This menu item will use the DtExampleEventSignaler to signal the network thread to
//send out a pdu or interaction, depending on protocol.
{
public:
virtual ~DtCallbackMenuItem() override;
//Build a menu item (via an action).
virtual QAction* createAction(makVrv::DtDe&, QWidget* parent) override;
protected:
// Called when the menu item is selected by the user
virtual void on_triggered() override;
protected:
};

exampleMenu.cxx

/*******************************************************************************
** Copyright (c) 2012 MAK Technologies, Inc.
** All rights reserved.
*******************************************************************************/
//\file exampleMenu.cxx
//\brief Defines example menu and menu item to be used in the networkCallbackManager
//example
#include "exampleMenu.h"
#include <QtWidgets/QMenu>
#include <QtWidgets/QAction>
using namespace makVrv;
//New main menu. This menu will be used to hold the Remote Control Console menu item
: DtMenu(de, "DtCallbackMenu")
{
}
{
}
QMenu* DtCallbackMenu::createMenu( DtDe& de, QWidget* parent )
{
QMenu* menu = new QMenu(QObject::tr("Network Callback"), parent);
return menu;
}
//This menu item will use the DtExampleEventSignaler to signal the network thread to
//send out a pdu or interaction, depending on protocol.
: DtMenuItem("DtCallbackMenuItem")
, myDe(de)
{
}
{
}
//Build a menu item (via an action).
{
return new QAction(tr("Send Network Message"), parent);
}
{
DtExampleEventSignaler::instance(DtSharedSettingsManager::instance(myDe)).signal_sendPdu();
}

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)