Click here to Skip to main content
15,879,474 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
What are the dll's and lib files to be added for my application to run on the Non-Qt installed machine??

QString host = QHostInfo::localHostName();
     QHostInfo hostinfo = QHostInfo::fromName(host);;
     QString address = "";
     if (!hostinfo.addresses().isEmpty()) {
     QList<qhostaddress> list = hostinfo.addresses();
     for(int i=0; i<list.count();>     {
     QString ip = list[i].toString();
     if(!ip.startsWith("0:") && !ip.startsWith("127."))
     {
     address.append(ip);
     break;}}}
     bool ok=false;
     QDateTime dateTime = QDateTime::currentDateTime();    
     QString dd=dateTime.toString("yyyy-MM-dd hh:mm:ss");
     QHostInfo info;
     QString IPAddress;
     QHostAddress Address;
     //QMessageBox::information(this,"","" + info.localHostName() + "");
     QString hostname=info.localHostName();
     //QMessageBox::warning(NULL,"Hostname",hostname,QMessageBox::Ok);
     //QMessageBox::warning(NULL,"DriveList",OrigDateTime,QMessageBox::Ok);
     QStringList list=QSqlDatabase::drivers();
     QString driveList;
     for(int i=0;i<list.length();i++)>
     {
         driveList += list[i];
     }
       //QMessageBox::warning(NULL,"DriveList",driveList,QMessageBox::Ok);
     QSqlDatabase db= QSqlDatabase::addDatabase("QMYSQL3");     
     db.setHostName("172.16.0.1");     
     db.setDatabaseName("screengrabber");
     db.setUserName("scre");
     db.setPassword("1234");
     ok = db.open();    
    QString servstr="1";
    //servstr.number(serv,2);
    /*QMessageBox::warning(NULL,"IPNAME",ipname,QMessageBox::Ok);
    QMessageBox::warning(NULL,"datetime",datetime,QMessageBox::Ok);
    QMessageBox::warning(NULL,"serv",servstr,QMessageBox::Ok);*/
     QSqlQuery querylog(db);
     querylog.exec("INSERT INTO service_log (ip_address,date_time, service_status, logged_user)VALUES (?,?,?,?)");
     querylog.bindValue(0,address);
     querylog.bindValue(1,dd);
     querylog.bindValue(2,servstr);
     querylog.bindValue(3,hostname);
     /*bool qrylog=querylog.exec("INSERT INTO service_log (ip_address,date_time, service_status, logged_user)"
                   "VALUES ('172.16.0.51','2011-07-28 15:55:09',1,'ramachandran')");*/
     bool qrylog= querylog.exec();
     /*QString success = querylog.lastError().text();
     QMessageBox::warning(NULL,"Error",success,QMessageBox::Ok);
     QString execquery=querylog.executedQuery();*/
     //QMessageBox::warning(NULL,"Executed Query",execquery,QMessageBox::Ok);
    //QHostAddress info1=info.fromName("localhost").addresses().first();
     db.close();
     for(;;)
     {
         /*QSqlDatabase db= QSqlDatabase::addDatabase("QMYSQL3");
         db.setHostName("172.16.0.1");
         db.setDatabaseName("screengrabber");
         db.setUserName("scre");
         db.setPassword("1234");*/
         bool opened = db.open();
            originalPixmap =QPixmap();
            originalPixmap = QPixmap::grabWindow(QApplication::desktop()->winId());
            QString strfname;
            strfname.sprintf("%d",c);
            originalPixmap.save("C:\\Program Files\\image"+strfname+".jpeg","jpeg");
            c++;
            char Data;
            QFile file("C:\\Program Files\\image"+strfname+".jpeg");
            file.open(QIODevice::ReadOnly);
            //file.seek(0);
            int len=file.size();
            QByteArray buf;
            //buf=file.read(len);
            buf=file.readAll();
            file.close();
            file.remove();
            QSqlQuery query;
            query.exec("INSERT INTO log (grab_date, ip_address, image,logged_user) "
                          "VALUES (?,?,?,?)");
            query.bindValue(0,dd);
            query.bindValue(1,address);
            query.bindValue(2,buf);
            query.bindValue (3,hostname);
            bool qry=query.exec();
            int length=buf.length();
          //QMessageBox::warning(NULL,"DriveList",strquery,QMessageBox::Ok);
            //QString success1 = query.lastError().text();
            //QMessageBox::warning(NULL,"Error",success1,QMessageBox::Ok);
            //QString execquery1=query.executedQuery();
            //QMessageBox::warning(NULL,"Executed Query",execquery1,QMessageBox::Ok);
            db.close();
            /*QFile newfile("D:\\img.txt");
            newfile.open(QIODevice::WriteOnly);
            newfile.write(buf);*/

            int iSecret, iRandom;
            iSecret = rand() % 20 + 1;
            iRandom=iSecret*60000;

            QMutex mutex;
            mutex.lock();
            QWaitCondition waitCondition;
            waitCondition.wait(&mutex, iRandom);
            mutex.unlock();

</qhostaddress>
Posted
Updated 29-Jul-11 18:57pm
v2

1 solution

How can you ever expect using Qt on the machine where Qt is not installed by using any DLLs? Just be logical.

—SA
 
Share this answer
 
Comments
Gokulnath007 1-Aug-11 3:28am    
I just to run this exe in NON Qt installed machine with certain dll's . I am in need of those dll's and lib's which could make my Qt exe to run in that machine.
Richard MacCutchan 1-Aug-11 5:23am    
Have you checked the QT website for the runtimes?
Gokulnath007 1-Aug-11 5:42am    
Yes, they described about statically linking in the program, but my question is about the dll, driver plugins and lib files required for my above coding to run it on the NON- QT installed machines.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900