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. Qimage failed to load file in pc which not install qt sdk
Forum Updated to NodeBB v4.3 + New Features

Qimage failed to load file in pc which not install qt sdk

Scheduled Pinned Locked Moved General and Desktop
8 Posts 4 Posters 2.5k Views 1 Watching
  • 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.
  • K Offline
    K Offline
    kevin_wmy
    wrote on last edited by
    #1

    i use QImage to load jpg and png file as below code show,in my pc it ok,but when deploy to others not install qt sdk ,it failed to load the image,i don't know why,i had put the qtgui.dll and qtcore.dll in the fold.Any one can help me,thanks.

    @
    QString fileName = QDir::currentPath() +"/TopoLogy/images.png";
    QMessageBox::information(this, "image path", fileName);

    if (!fileName.isEmpty()) {
        QImage image(fileName);
        if (image.isNull()) {
            QMessageBox::information(this, tr("Image Viewer"),
                                     tr("Cannot load %1.").arg(fileName));
            return;
        }
    

    @

    [EDIT: code formatting, please wrap in @-tags, Volker]

    1 Reply Last reply
    0
    • K Offline
      K Offline
      kevin_wmy
      wrote on last edited by
      #2

      it always show Image Viewer cannot laod ....

      1 Reply Last reply
      0
      • S Offline
        S Offline
        Sam
        wrote on last edited by
        #3

        Hi,

        Kindly use the code formatter so that your code is readable. You can edit your post and add @ tags for the code.

        1 Reply Last reply
        0
        • Q Offline
          Q Offline
          qxoz
          wrote on last edited by
          #4

          Did you put (plugins\imageformats)plugin libs too?

          1 Reply Last reply
          0
          • D Offline
            D Offline
            dbzhang800
            wrote on last edited by
            #5

            Please copy the plugin

            from
            @
            $QTDIR/plugins/imageformats/*
            @

            to

            @
            YouApplicationDirectory/imageformats/*
            @

            1 Reply Last reply
            0
            • K Offline
              K Offline
              kevin_wmy
              wrote on last edited by
              #6

              thanks
              [quote author="1+1=2" date="1335978596"]Please copy the plugin

              from
              @
              $QTDIR/plugins/imageformats/*
              @

              to

              @
              YouApplicationDirectory/imageformats/*
              @[/quote]

              1 Reply Last reply
              0
              • K Offline
                K Offline
                kevin_wmy
                wrote on last edited by
                #7

                this code is copy from qt example
                [quote author="Soumitra" date="1335953992"]Hi,

                Kindly use the code formatter so that your code is readable. You can edit your post and add @ tags for the code.

                [/quote]

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  Sam
                  wrote on last edited by
                  #8

                  [quote author="kevin_wmy" date="1336355175"]this code is copy from qt example
                  [quote author="Soumitra" date="1335953992"]Hi,

                  Kindly use the code formatter so that your code is readable. You can edit your post and add @ tags for the code.

                  [/quote]

                  [/quote]

                  Yes,
                  I was just saying about using the code formatter i.e @-tags around your code so that it can be readable. You can check your first post, the @-tags have been added by Volker. BTW did you get the solution ?

                  Thanks :)

                  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