Save the screenshot of a widget

后端 未结 1 459
孤独总比滥情好
孤独总比滥情好 2021-01-27 06:15

I want to save a screenshot of a widget in Qt. I created the following code that should work:

  QWidget* activeWidget = getActiveWidget();//a function that retur         


        
相关标签:
1条回答
  • 2021-01-27 06:53

    In this answer and this forum post, people suggest the following:

    Most likely, the plugin which is required to handle .jpg files is not found by your application. In order to resolve this issue, do one of the following things:

    • If you are doing a static build, add QTPLUGIN += qjpeg to your .pro file or
    • if you are doing a dynamic build, put the imageformats folder from %QTDIR%\plugins next to your .exe
    0 讨论(0)
提交回复
热议问题