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. QPainter.begin returns false on prod machine
Forum Updated to NodeBB v4.3 + New Features

QPainter.begin returns false on prod machine

Scheduled Pinned Locked Moved Solved General and Desktop
qt5.2.1qprinterqpainterpdfwindows
11 Posts 4 Posters 5.5k Views 3 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.
  • E Offline
    E Offline
    euchkatzl
    wrote on last edited by
    #2

    I think thats a dependency problem, anyhow.

    Are you using windeployqt.exe tool ?

    If not look here : http://doc.qt.io/qt-5/windows-deployment.html

    To check wether there are dlls missing you can use DependencyWalker : http://www.dependencywalker.com/

    P 1 Reply Last reply
    0
    • E euchkatzl

      I think thats a dependency problem, anyhow.

      Are you using windeployqt.exe tool ?

      If not look here : http://doc.qt.io/qt-5/windows-deployment.html

      To check wether there are dlls missing you can use DependencyWalker : http://www.dependencywalker.com/

      P Offline
      P Offline
      PierreFIL
      wrote on last edited by PierreFIL
      #3

      @euchkatzl

      Thansk, I am not using windeployqt.exe, I am gonna have a look.

      Anyway I do use DependencyWalker, and that's the problem : it doesn't give me any wrong feedback, all is green...

      I have even tried to copy all the Qt dlls into my app folder (hardcore attempt when you suspect that you are missing a dll), but nothing changed.

      raven-worxR 1 Reply Last reply
      0
      • P PierreFIL

        @euchkatzl

        Thansk, I am not using windeployqt.exe, I am gonna have a look.

        Anyway I do use DependencyWalker, and that's the problem : it doesn't give me any wrong feedback, all is green...

        I have even tried to copy all the Qt dlls into my app folder (hardcore attempt when you suspect that you are missing a dll), but nothing changed.

        raven-worxR Offline
        raven-worxR Offline
        raven-worx
        Moderators
        wrote on last edited by raven-worx
        #4

        @PierreFIL
        make sure the printer plugins are found and successfully loaded.
        Set QT_DEBUG_PLUGINS env variable to a non-zero and check the console output.
        Note: plugins are searched in special-named folders.

        --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
        If you have a question please use the forum so others can benefit from the solution in the future

        P 1 Reply Last reply
        1
        • raven-worxR raven-worx

          @PierreFIL
          make sure the printer plugins are found and successfully loaded.
          Set QT_DEBUG_PLUGINS env variable to a non-zero and check the console output.
          Note: plugins are searched in special-named folders.

          P Offline
          P Offline
          PierreFIL
          wrote on last edited by PierreFIL
          #5

          @raven-worx

          The only plugin that seems to be used is windowsprintersupport.dll, and it's correctly loaded from the special-named folder "printsupport"

          1 Reply Last reply
          0
          • E Offline
            E Offline
            euchkatzl
            wrote on last edited by
            #6

            I dont think this a QPrinter problem but more a QPainter problem.

            As a notice you don't need any printers to be installed on your prod machine.
            You want to write to an PDF file and not print the resulting document. Is this right ?

            Try deploying the imageformats that windeployqt.exe gives you.

            P 1 Reply Last reply
            0
            • E euchkatzl

              I dont think this a QPrinter problem but more a QPainter problem.

              As a notice you don't need any printers to be installed on your prod machine.
              You want to write to an PDF file and not print the resulting document. Is this right ?

              Try deploying the imageformats that windeployqt.exe gives you.

              P Offline
              P Offline
              PierreFIL
              wrote on last edited by
              #7

              @euchkatzl

              Correct, this is what I want it to do.

              I tried to use the deploying tool, so I got imageformats dlls + other files added ( some files.qm, D3Dcompiler46.dll, accessible and iconengines folders containing other dlls...), but it doesn't solve the problem.

              K 1 Reply Last reply
              0
              • P Offline
                P Offline
                PierreFIL
                wrote on last edited by
                #8

                I found part of the problem :

                Executing the application with user Windows session fails, BUT executing it with admin session works...

                Now I have to understand why, and how to fix that. Looks like the lambda user session can't access any printer from Qt.

                1 Reply Last reply
                0
                • P PierreFIL

                  @euchkatzl

                  Correct, this is what I want it to do.

                  I tried to use the deploying tool, so I got imageformats dlls + other files added ( some files.qm, D3Dcompiler46.dll, accessible and iconengines folders containing other dlls...), but it doesn't solve the problem.

                  K Offline
                  K Offline
                  kenchan
                  wrote on last edited by kenchan
                  #9

                  @PierreFIL

                  When I do this I use code like this...

                  printer->newPage();
                  QPainter l_oPainter(&l_oPrinter);
                  
                  ui.wdg_All->render(...);
                  

                  I think the newPage() line would also work just before the call to render.
                  Painter and printer then goes out of scope in my code. How about yours, does this not work for you?

                  P 1 Reply Last reply
                  0
                  • K kenchan

                    @PierreFIL

                    When I do this I use code like this...

                    printer->newPage();
                    QPainter l_oPainter(&l_oPrinter);
                    
                    ui.wdg_All->render(...);
                    

                    I think the newPage() line would also work just before the call to render.
                    Painter and printer then goes out of scope in my code. How about yours, does this not work for you?

                    P Offline
                    P Offline
                    PierreFIL
                    wrote on last edited by
                    #10

                    @kenchan

                    It works too yes, but I don't think it's related to newPage() method

                    1 Reply Last reply
                    0
                    • P Offline
                      P Offline
                      PierreFIL
                      wrote on last edited by
                      #11

                      OK, so now that I have launched the program with admin rights and came back with user session, the application is working (?!?)

                      So it was neither a DLL or plugins problem, but just a weird right access blocking. I am sad I can't explain why I had to launch it once with admin session, but at least I am glad I solved my problem.

                      Thanks anyway to those who give their time to help.

                      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