Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qmovie does not show gif images in Mac

Qmovie does not show gif images in Mac

Scheduled Pinned Locked Moved Unsolved General and Desktop
13 Posts 4 Posters 995 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Z Offline
    Z Offline
    zandarina
    wrote on last edited by
    #1

    Hello,

    I would like to show the gif images. it works very well in windows but when i tried with Mac the gifs images are not loaded.

    I read that i must find the file qgif4.dll but i checked in the qt directory in imageformats and it does not appear. There are only dylib and dSYM. What do i have to do to get the dlls so i can use them in my project to show the gifs?

    Thank you very much

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi
      Do you have anything named qgif.dylib ?

      On windows its inside the compiler folder in the Qt folder.
      "C:\Qt\5.14.2\msvc2017_64\plugins\imageformats\qgif.dll"

      1 Reply Last reply
      0
      • Z Offline
        Z Offline
        zandarina
        wrote on last edited by
        #3

        Hi thank you for answering. I have something similar libqgif.dylib. I suppose it is the same but not a dll.

        Thanks

        mrjjM 1 Reply Last reply
        0
        • Z zandarina

          Hi thank you for answering. I have something similar libqgif.dylib. I suppose it is the same but not a dll.

          Thanks

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by mrjj
          #4

          @zandarina
          Well DLLS are a Windows thing.
          In linux its .SO files and i think dylib on MacOS is the same as a DLL/So file.
          A dynamic loadable library.

          Just to understand. ITs not working directly in Creator or when you run your app standalone ?

          Did you use
          https://doc.qt.io/qt-5.9/osx-deployment.html#macdeploy
          to deploy the app ?
          It often gets such extra files.

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            Hi,

            Where is your gif located ?
            Does it happen when running your application through Qt Creator ?
            What version of Qt are you using ?

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            1
            • Z Offline
              Z Offline
              zandarina
              wrote on last edited by zandarina
              #6

              Thank you for answering I put the directory imagefactory where the executable is. I have also tried in the release and debug directory and in the build directory. With no luck. I have qt 5.11.1. I checked the isvalid of qmovie and it returns false. I use cmake to generate the project and xcode to compile and run the application.

                  	std::unique_ptr<QLabel> phase_video_label(new QLabel("phase_video_label", main_frame_));
              phase_video_player_ = new QMovie(this);
              phase_video_player_->setFileName("/Users/xxxxx/xxx/s/images/videos/dicom.gif");
              std::string video_name = step.get_definition().get_video().c_str();
              std::cout << video_name;
              phase_video_label.get()->setAlignment(Qt::AlignCenter);
              phase_video_label.get()->setMovie(phase_video_player_);
              phase_video_player_->setScaledSize(QSize(230, 123));
                 phase_video_player_->start();
                  bool ivalid =  phase_video_player_->isValid();
              std::cout << ivalid;
              auto formats = phase_video_player_->supportedFormats();
              QTextCodec *codec = QTextCodec::codecForName("KOI8-R");
               QString string = codec->toUnicode(formats.value(0));
              

              Thank you

              1 Reply Last reply
              0
              • Z Offline
                Z Offline
                zandarina
                wrote on last edited by
                #7

                I found the error, Somehow Xcode does not detect the relative path and it does not find the files. If i put full paths it works. This is why in windows worked and here it doesn't. Someone had the same problem?

                jsulmJ 1 Reply Last reply
                0
                • Z zandarina

                  I found the error, Somehow Xcode does not detect the relative path and it does not find the files. If i put full paths it works. This is why in windows worked and here it doesn't. Someone had the same problem?

                  jsulmJ Offline
                  jsulmJ Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  @zandarina It's not XCode not finding the files, but your app. Relative paths are relative to current working directory.

                  https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  0
                  • SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by SGaist
                    #9

                    The structure of the app bundle on macOS has nothing to do with an application on Windows. Either you shall copy the file in the right place in the bundle or depending on its size and use store it using the Qt Resources System.

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply
                    1
                    • Z Offline
                      Z Offline
                      zandarina
                      wrote on last edited by zandarina
                      #10

                      Yes but it is because i use it in a cpp generated with moc. In windows it considers this file generated by moc within the source path when it generates it. But it seems in mac not to consider the source path from the project if not from where it has been generated (the bin). For that reason, i need to specify the full path. Because it does not consider it in the main project path so the relative path is not working anymore.

                      1 Reply Last reply
                      0
                      • SGaistS Offline
                        SGaistS Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on last edited by
                        #11

                        How are you using it in a cpp file generated by moc ?

                        Interested in AI ? www.idiap.ch
                        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                        1 Reply Last reply
                        0
                        • Z Offline
                          Z Offline
                          zandarina
                          wrote on last edited by
                          #12

                          Thank you very much for anwering. I have solved it following your suggestions. I created a bundle indicating the resource folder and then I put all the folders there. Now it does not go to the bin folder. Thank you very much for all your help. I am very new in Mac and I am finding quite hard to work with it. So I appreciate all the help. Cheers

                          1 Reply Last reply
                          0
                          • SGaistS Offline
                            SGaistS Offline
                            SGaist
                            Lifetime Qt Champion
                            wrote on last edited by
                            #13

                            Glad you got it working !

                            Since everything is ok now, please mark the thread as solved using the "Topic Tools" button or the three doted menu beside the answer you deem correct so that other forum users may know a solution has been found :-)

                            Interested in AI ? www.idiap.ch
                            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                            1 Reply Last reply
                            0

                            • Login

                            • Login or register to search.
                            • First post
                              Last post
                            0
                            • Categories
                            • Recent
                            • Tags
                            • Popular
                            • Users
                            • Groups
                            • Search
                            • Get Qt Extensions
                            • Unsolved