消息队列–两个进程间的通信
需求:
- 1.在Linux系统中
- 2.两个ui界面的程序切换,一个显示,另一个隐藏
.h
#ifndef PROGRAMWINDOWSWITCH2_H
#define PROGRAMWINDOWSWITCH2_H
#include <QObject>
#include <QThread>
#include <QMainWindow>
struct Message{
long msgType;
int msgText[2];
};
class MessageQueueReceiver : public QThread
{
Q_OBJECT
public:
MessageQueueReceiver(int msgid,QObject *parent = nullptr,int type = 1):QThread(parent),msgid(msgid),curWindowType(type){
}
signals:
void messageReceived(const int &message);
protected:
void run() override;
private:
int msgid;
int curWindowType