i want to pass structure variable to qml file...
#ifndef MYTCPSOCKET_H
#define MYTCPSOCKET_H
#include <QObject>
#include <QTcpSocket>
#include <QAbstractSocket>
#include <QDebug>
#include <QXmlStreamReader>
typedef struct
{
int Sc_Index;
int Sc_Bitrate;
int Sc_Type;
int Sc_Language;
int Sc_Program_Type;
}ScInfo;
typedef struct
{
int bcid;
int Bitrate;
int Sc_Count;
ScInfo sc[8];
}BcInfo;
{
Q_OBJECT
public:
explicit MyTcpSocket
(QObject *parent
= 0);
void processBcInfo();
void processBC(BcInfo *pBcinfo);
void processSC(ScInfo *m_sScinfo);
signals:
public slots:
void connected();
void disconnected();
void hostFound();
void bytesWritten(qint64 bytes);
void readyRead();
void read();
private:
const char *m_np1;
QXmlStreamReader xml;
bool nLastElement;
};
#endif // MYTCPSOCKET_H
#ifndef MYTCPSOCKET_H
#define MYTCPSOCKET_H
#include <QObject>
#include <QTcpSocket>
#include <QAbstractSocket>
#include <QDebug>
#include <QXmlStreamReader>
typedef struct
{
int Sc_Index;
int Sc_Bitrate;
int Sc_Type;
int Sc_Language;
int Sc_Program_Type;
}ScInfo;
typedef struct
{
int bcid;
QString BcLabel;
int Bitrate;
int Sc_Count;
ScInfo sc[8];
}BcInfo;
class MyTcpSocket : public QObject
{
Q_OBJECT
public:
explicit MyTcpSocket(QObject *parent = 0);
void processBcInfo();
void processBC(BcInfo *pBcinfo);
void processSC(ScInfo *m_sScinfo);
QString readNextText();
signals:
public slots:
void connected();
void disconnected();
void hostFound();
void bytesWritten(qint64 bytes);
void readyRead();
void error(QAbstractSocket::SocketError socketError);
void read();
private:
QTcpSocket * socket;
QByteArray m_bWriteArray;
QByteArray m_bReadArray;
const char *m_np1;
QStringList myStringList;
QString m_sdatastring;
QString m_srequestString;
QXmlStreamReader xml;
bool nLastElement;
};
#endif // MYTCPSOCKET_H
To copy to clipboard, switch view to plain text mode
ListView
{
width: 200
height: 200
ListModel
{
id: mainModel
ListElement
{
name:"YazmiAud" // instead of this BcLabel; here
}
}
model: mainModel
delegate: Column
{
Text
{
text: name
}
}
ListView
{
width: 200
height: 200
ListModel
{
id: mainModel
ListElement
{
name:"YazmiAud" // instead of this BcLabel; here
}
}
model: mainModel
delegate: Column
{
Text
{
text: name
}
}
To copy to clipboard, switch view to plain text mode
BcLabel i want to give to listelement name in qt any body give the solution
Bookmarks