假設我在我的應用程序中有兩個窗口,並且有兩個窗口負責它們: class MainWindow: public QMainWindow和class SomeDialog: public QWidget。 在我的主窗口中,我有一個按鈕。點擊時,我需要顯示第二個窗口。我這樣做: SomeDialog * dlg = new SomeDialog();
dlg.show();
現在,用戶在窗口中做了
我想在Qt中保存小部件的屏幕截圖。 我創建了下面的代碼應該工作: QWidget* activeWidget = getActiveWidget();//a function that returns the current widget.
if (activeWidget == NULL)
{
return;
}
QPixmap screensh