About 2,350,000 results
Open links in new tab
  1. python - PyQt4 - QWidget save as image - Stack Overflow

    Jun 25, 2014 · You can do this using the QPixmap.grabWindow() method. From the docs: Grabs the contents of the window window and makes a pixmap out of it. Returns the pixmap. The arguments (x, y) specify the offset in the window, whereas (w, h) specify the width and height of the area to be copied.

  2. python - How to set a window icon with PyQt5? - Stack Overflow

    I am trying to set a window icon (top left of the window) but the normal icon disappeared instead. I tried with many icon resolutions (8x8, 16x16, 32x32, 64x64) and extensions (.png and .ico). What am I doing wrong?

  3. QIcon — Qt for Python

    Such pixmaps are used by Qt widgets to show an icon representing a particular action. The simplest use of QIcon is to create one from a QPixmap file or resource, and then use it, allowing Qt to work out all the required icon styles and sizes.

  4. Setting the Application Icon - Qt for Python

    The application icon, typically displayed in the application dock area, is set by calling QWindow::setWindowIcon() on a window. It is possible that the program could appear in the application dock area before the function call, in which case a default icon will appear during the bouncing animation.

  5. How to Create Icons for Windows in PyQt6? - Python Guides

    Mar 28, 2025 · Learn how to create and set icons for windows in PyQt6 using QIcon. Customize your application’s appearance with icons for main windows, dialogs, and toolbars.

  6. How to save a gui created with qt and python as an image

    Mar 31, 2022 · A possible solution is to use a QTimer, on the other hand the grabWindow method grabs a window using the associated WID, in this case it is better to use the grab method: pixmap = widget.grab() if not pixmap.isNull(): pixmap.save("/fullpath/of/screenshot.png", "PNG") QApplication.quit() app = QtWidgets.QApplication(sys.argv) window = MainWindow()

  7. How to set icon to a window in PyQt5 - GeeksforGeeks

    Apr 25, 2025 · PyQt5 allows us to set the icon of window using setWindowIcon() method, on the other hand setWindowIconText() method is also present in it which allows us to set the text the icon. Although, it is not recommended to use as it has …

  8. Icons Example — Qt for Python

    May 15, 2011 · The Icons example shows how QIcon can generate pixmaps reflecting an icon’s state, mode and size. These pixmaps are generated from the set of pixmaps made available to the icon, and are used by Qt widgets to show an icon representing a particular action. Contents:

  9. Save a QWidget as PNG high resolution (retina) image.

    Jan 29, 2021 · Sometimes you want to make a screenshot of the window or control in a Qt app. In this article you learn how to create a window and render its contents to to a pixmap and save it as a PNG file. You also see how to support retina screens.

  10. PyQt set icon - python-commandments.org

    Here's how to display the application icon. First, in the folder, save the image file that you want to use as an icon, as shown below. Related course: Create Desktop Apps with Python PyQt5. Put the application icon. from PyQt5.QtWidgets import …

  11. Some results have been removed
Refresh