1 在windows平台下,qt使用ptlib和opal。
main.h
#pragma once
#include <ptlib.h>
#include <ptlib/pprocess.h>
#include <ptclib/ipacl.h>
class Hello :
public PProcess
{
PCLASSINFO(Hello, PProcess)
public:
Hello(void);
~Hello(void);
public:
void Main();
};
main.cpp
#include <QtWidgets/QApplication>
#include "testptlib.h"
#include "main.h"
PCREATE_PROCESS(Hello)
Hello::Hello(void)
{
}
Hello::~Hello(void)
{
}
void Hello::Main()
{
PConfigArgs args1(GetArguments());
PStringStream str;
str << args1;
int argCount = str.GetSize();
char **argV = new char*[argCount + 1];
PStringArray arrayArgs;
for (int i = 0; i < argCount; i++)
{
arrayArgs.AppendString(str[i]);
argV[i] = const_cast<char*>(arrayArgs[i].GetPointer());
}
argV[argCount] = NULL;
QApplication a(argCount, argV);
testptlib w;
w.show();
a.exec();
}