[Qt-interest] problem while adding 'Next'button to movieplayer'

Avishek_Sharma Avishek_Sharma at satyam.com
Wed Dec 24 10:19:08 CET 2008


Hi everyone,
 I was trying out the movie player given in this link
http://doc.trolltech.com/4.4/widgets-movie.html (The complete code is given there)

I wanted to put a Next  button on it.But,the code for the 'Next 'button isn't working.
It also shows an error when I try to use 'filters' in the second line of code in the function next()

//Error shown is ---
 movieplayer.cpp: in member function 'void Movieplayer::next()'
 movieplayer.cpp:83:error:No matching function for call to 'QDir::entryList(constant char[6])'

I have attached the code for the next button which I wrote.Please check it out and let me know where i need to make changes to make it functional.

void MoviePlayer::next()
{
  QDir direc(currentMovieDirectory);
  QStringList lst=direc.entryList("*.mng");  //error when i use filters in this line
  int res;
  QStringList::Iterator it=lst.begin();
 while( it!= lst.end())
    {
        res= QString::compare(QString(*it),fileName);
        if(res!=0)
          {
            ++it;
          }

        if(res==0)
        {
            it++;
            if(it == lst.end())
            {
                it=lst.begin();
            }

           fileName=QString(*it);
           openFile(fileName);
           break;
        }
    }

}

 changes I made in .h file- added a QString fileName under 'private', QToolButton *nextButton and a slot next() under private slots.

changes made in .cpp- added  in the createButtons() function the folowing code

   //creating Next Button
     nextButton=new QToolButton;
     nextButton->setIcon(QIcon(":/images/next.png"));
     nextButton->setIconSize(iconSize);
     nextButton->setToolTip(tr("Next item"));
     connect(nextButton, SIGNAL(clicked()), this, SLOT(next()));

Any advice/suggestion is welcome.
Thank you.

Avi

DISCLAIMER:
This email (including any attachments) is intended for the sole use of the intended recipient/s and may contain material that is CONFIDENTIAL AND PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or distribution or forwarding of any or all of the contents in this message is STRICTLY PROHIBITED. If you are not the intended recipient, please contact the sender by email and delete all copies; your cooperation in this regard is appreciated.




More information about the Qt-interest-old mailing list