PDA

View Full Version : error: invalid use of undefined type ‘struct QVariant’



ashukla
15th October 2007, 14:05
Dear Everyone!
see problem and suggest solution!


frameplaylist.cpp: In member function ‘void FramePlaylist::read(int, int, int, dataPlay*)’:
frameplaylist.cpp:59: error: invalid use of undefined type ‘struct QVariant’
/usr/local/Trolltech/Qt-4.3.1/include/QtCore/qobject.h:60: error: forward declaration of ‘struct QVariant’
frameplaylist.cpp:60: error: invalid use of undefined type ‘struct QVariant’
/usr/local/Trolltech/Qt-4.3.1/include/QtCore/qobject.h:60: error: forward declaration of ‘struct QVariant’
frameplaylist.cpp:65: error: invalid use of undefined type ‘struct QVariant’
/usr/local/Trolltech/Qt-4.3.1/include/QtCore/qobject.h:60: error: forward declaration of ‘struct QVariant’
frameplaylist.cpp:66: error: invalid use of undefined type ‘struct QVariant’
/usr/local/Trolltech/Qt-4.3.1/include/QtCore/qobject.h:60: error: forward declaration of ‘struct QVariant’
frameplaylist.cpp:67: error: invalid use of undefined type ‘struct QVariant’
/usr/local/Trolltech/Qt-4.3.1/include/QtCore/qobject.h:60: error: forward declaration of ‘struct QVariant’
frameplaylist.cpp:68: error: invalid use of undefined type ‘struct QVariant’
/usr/local/Trolltech/Qt-4.3.1/include/QtCore/qobject.h:60: error: forward declaration of ‘struct QVariant’
make: *** [frameplaylist.o] Error 1

/*this is a frameplaylist.h*/
#ifndef FRAMEPLAYLIST_H
#define FRAMEPLAYLIST_H
#include<QtGui/QWidget>
#include<QtCore/QProcess>
//#include"playlist.h"
//#include"qscrollerview.h"
#include <QDesktopWidget>
#include <QRect>
//#include "data.h"
#include <QDebug>
#include <QtCore/QRect>
#include<QApplication>
#include <QString>
#include <QtSql/QSqlDatabase>
#include <QtSql/QSqlQuery>
#include <QtSql/QSqlError>
#include <QMessageBox>

struct dataPlay
{
QString SeqData[100];
QString mfileData[100];
QString filetypeData[100];
QString EndTimeData[100];
QString filepathData[100];
QString framenameData;
};
class FramePlaylist: public QWidget
{
Q_OBJECT

public:
int tempId,frameId; //TemplateId,FrameId
int locx,locy; //location X,location Y
int h,w; //FrameHeight,FrameWidth
int totalMediaFiles; //No.of MediaFiles in Each Frame
int currentIndex; //Position of MediaFiles
QString mediaPath[50]; //Location of MediaFile
QString mediaType[50]; //Type of MediaFile

//public:
//int h2,w2; //resolution hight,resolution width
int seqNo; //SequenceNo.of MediaFiles in Each Frame
int playaudio; //Play Audio Flag
int stopFlag; //Stop Process Flag
int playFlag;
QString frameName; //Play Process Flag
QProcess *mp;
//QScrollerView *v;
QRect screen;
QSqlDatabase db1;
protected:

int checkMediaType(QString mediaType[],int seqNo);
void playUrl();
void playMplayer();
void playScroller();
public:
FramePlaylist(QWidget *parent=0);
~FramePlaylist();
//void loadFramePlaylistData();
void read(int i, int id, int index, dataPlay* frameData);
void loadMediaFiles(int i, int index, dataPlay* frameData);
void play();
void stop();
void cal();
//void readfile1();
//void readfile2();
void reSize(FramePlaylist *a,FramePlaylist *b);
//void stopScroller();
public slots:
void endPlayProcess();
//void stopPlay();
};


#endif



/*this is frameplaylist.cpp*/
#include "frameplaylist.h"


/************************************************** ********************************************
Initiate the Constructor and read the System Resolution
************************************************** ********************************************/
FramePlaylist::FramePlaylist(QWidget *parent)
: QWidget(parent)
{
currentIndex=0;
stopFlag=0;
setWindowFlags(Qt::FramelessWindowHint);

//system("xvidtune -show | cut -d ' ' -f1|cut -d'x' -f1|tee h1");
//system("xvidtune -show | cut -d ' ' -f1|cut -d'x' -f2|tee w1");

//readfile1();
//readfile2();
db1 = QSqlDatabase::addDatabase( "QMYSQL" ); //Establised database canation
db1.setDatabaseName("VistaPenguin" );
db1.setUserName( "root" );
db1.setHostName( "localhost" );
if (!db1.open())
{
QMessageBox::critical(0,QObject::tr("Database Error"),db1.lastError().text());
exit(0);
}
}

void FramePlaylist::read(int i, int id,int index, dataPlay* frameData)
{

QSqlQuery playquery("Select * from ScreenTemplateDetail");
if(playquery.isActive())
{

while(playquery.next())
{
int typeId=playquery.value(0).toInt();
frameName=playquery.value(2).toString();
if(id==typeId)
{
if(frameName==frameData[i].framenameData)
{
h=playquery.value(3).toInt();
w=playquery.value(4).toInt();
locx=playquery.value(5).toInt();
locy=playquery.value(6).toInt();
}


}
}
}

cal();
loadMediaFiles(i,index,frameData);
}

I am calling like this;
f1.read(0,id,indexNo,frameData);
Thanks in advance!

Gopala Krishna
15th October 2007, 15:21
Looks like you forgot

#include <QtCore/QVariant>

P.S: Please use code tag to post the source code as the syntax highlighting makes your code more readable to everyone. :)