### PySide6 Application Entry Point (`main.py`) Source: https://github.com/fernicar/pyside6_examples_doc_2025_v6.9.1/blob/6.9.1/examples/widgets/desktop/systray/README.md Describes the initialization process of the PySide6 application, including QApplication setup, system tray availability checks, crucial application settings like `setQuitOnLastWindowClosed(False)`, and starting the event loop. ```APIDOC main.py: - Initializes QApplication. - Checks for System Tray Availability: - Uses QSystemTrayIcon.isSystemTrayAvailable(). - If not available, shows critical message and exits. - Crucial Application Setting: - Calls QApplication.setQuitOnLastWindowClosed(False) to prevent termination when the main window is closed, allowing it to continue running with only the system tray icon visible. - Creates an instance of the Window class, shows it, and starts the event loop. ``` -------------------------------- ### Run PySide6 Basic Layouts Example Source: https://github.com/fernicar/pyside6_examples_doc_2025_v6.9.1/blob/6.9.1/examples/widgets/layouts/basiclayouts/README.md Instructions to execute the PySide6 application demonstrating various layout managers. Ensure PySide6 is installed and navigate to the example directory before running the script. ```Bash python basiclayouts.py ``` -------------------------------- ### PySide6 Main Application Setup Source: https://github.com/fernicar/pyside6_examples_doc_2025_v6.9.1/blob/6.9.1/examples/speech/hello_speak/README.md Describes the setup in `main.py`, including enabling Qt Speech debug logging, initializing `QApplication`, and showing the `MainWindow`. ```APIDOC main.py: - QLoggingCategory.setFilterRules("qt.speech.tts=true\nqt.speech.tts.*=true") - Enables detailed debug output from the Qt Speech module - Initializes QApplication - Creates and shows the MainWindow instance ``` -------------------------------- ### Execute PySide6 Anchor Layout Example Source: https://github.com/fernicar/pyside6_examples_doc_2025_v6.9.1/blob/6.9.1/examples/widgets/graphicsview/anchorlayout/README.md Instructions to run the PySide6 anchor layout example script from the command line, assuming PySide6 is installed and the current directory is `examples/widgets/graphicsview/anchorlayout`. ```Bash python anchorlayout.py ``` -------------------------------- ### Execute PySide6 Drag and Drop Example Script Source: https://github.com/fernicar/pyside6_examples_doc_2025_v6.9.1/blob/6.9.1/examples/widgets/draganddrop/dropsite/README.md Command-line instructions to run the provided PySide6 drag and drop example application. Ensure PySide6 is installed and navigate to the specified directory before execution. ```Bash python main.py ``` -------------------------------- ### Main Application Initialization (Python) Source: https://github.com/fernicar/pyside6_examples_doc_2025_v6.9.1/blob/6.9.1/examples/multimedia/camera/README.md Describes the entry point of the application, detailing the setup of the QApplication and the main Camera window, initiating the application's event loop. ```APIDOC main.py: - Initializes QApplication. - Creates an instance of the Camera main window. - Shows the window and starts the event loop. ``` -------------------------------- ### Run PySide6 Text Editor Example Source: https://github.com/fernicar/pyside6_examples_doc_2025_v6.9.1/blob/6.9.1/examples/widgets/richtext/textedit/README.md Instructions to execute the PySide6 rich text editor example from the command line. Ensure PySide6 and its `QtPrintSupport` module are installed. The example can be run without arguments to load a default HTML file, or with a file path to open a specific document. ```bash python textedit.py ``` ```bash python textedit.py your_document.html ``` -------------------------------- ### Run PySide6 QML Extension Example Source: https://github.com/fernicar/pyside6_examples_doc_2025_v6.9.1/blob/6.9.1/examples/qml/tutorials/extending-qml-advanced/extended/README.md Instructions to execute the PySide6 QML extension example. This involves ensuring PySide6 is installed, navigating to the specific example directory, and running the main Python script from the command line. ```Bash python main.py ``` -------------------------------- ### Execute PySide6 Fetch More Example Script Source: https://github.com/fernicar/pyside6_examples_doc_2025_v6.9.1/blob/6.9.1/examples/widgets/itemviews/fetchmore/README.md This command initiates the PySide6 'Fetch More' example application. Ensure PySide6 is installed and you are in the correct directory before execution. The script will open a window demonstrating incremental data loading. ```Bash python fetchmore.py ``` -------------------------------- ### PySide6 MainWindow Initialization with QTextToSpeech Source: https://github.com/fernicar/pyside6_examples_doc_2025_v6.9.1/blob/6.9.1/examples/speech/hello_speak/README.md Describes the initialization process of the `MainWindow` class, including UI setup, creation of the `QTextToSpeech` instance, population of available engines, and connection of UI signals to slots. ```APIDOC MainWindow: __init__(): - UI setup from ui_mainwindow.py - self._speech = QTextToSpeech() (initial instance, defaults to system engine) - Populate _ui.engine QComboBox: - Add "Default" - Add all QTextToSpeech.availableEngines() - Select first engine (triggers engine_selected slot) - Connect UI controls: - Sliders (rate, pitch, volume) to respective set_X slots - ComboBox currentIndexChanged signals - Button clicked signals ``` -------------------------------- ### Main Application Logic API Documentation Source: https://github.com/fernicar/pyside6_examples_doc_2025_v6.9.1/blob/6.9.1/examples/opengl/contextinfo/README.md Outlines the entry point and setup for the PySide6 OpenGL application, including command-line argument parsing for OpenGL implementation and the application lifecycle. ```APIDOC Main Application Logic (if __name__ == "__main__"): - Description: Initializes and runs the PySide6 application. - Details: Uses ArgumentParser to allow specifying OpenGL implementation (GLES, Software, Desktop) via command-line flags. These are set using QCoreApplication.setAttribute(). Creates QApplication. Creates and shows an instance of MainWindow. Calls main_window.update_description() to populate the info text edit *after* the window (and thus the OpenGL context) is likely initialized and shown. Starts the event loop. ``` -------------------------------- ### Run PySide6 Diagramscene Example Source: https://github.com/fernicar/pyside6_examples_doc_2025_v6.9.1/blob/6.9.1/examples/widgets/graphicsview/diagramscene/README.md Instructions on how to execute the PySide6 diagramscene example application from the command line. Ensure PySide6 is installed and navigate to the specified directory before running the script. ```Bash python diagramscene.py ``` -------------------------------- ### Camera Class Initialization (PySide6 APIDOC) Source: https://github.com/fernicar/pyside6_examples_doc_2025_v6.9.1/blob/6.9.1/examples/multimedia/camera/README.md Details the initial setup of the Camera window, including UI loading, handling camera and microphone permission requests for specific operating systems, creating audio input, and populating available video input devices. ```APIDOC Camera Class Methods: __init__ / initialize: - Loads UI from .ui file. - Handles camera and microphone permission requests (Android/macOS). - Creates QAudioInput (m_audioInput). - Populates menu with available video input devices (QMediaDevices.videoInputs()) using QActionGroup. - Calls setCamera() with default video input. ``` -------------------------------- ### PySide6 Python Modules for Application Setup Source: https://github.com/fernicar/pyside6_examples_doc_2025_v6.9.1/blob/6.9.1/examples/quick3d/intro/README.md This section lists the key PySide6 modules and classes used in the `main.py` file. These components are essential for initializing the GUI application, configuring the OpenGL surface format for 3D rendering, and loading the QML engine. ```APIDOC PySide6.QtGui.QGuiApplication PySide6.QtGui.QSurfaceFormat (Used to set default surface format properties like multisampling) PySide6.QtQml.QQmlApplicationEngine PySide6.QtQuick3D.QQuick3D (Used for idealSurfaceFormat()) ``` -------------------------------- ### Run PySide6 Dock Widgets Example Script Source: https://github.com/fernicar/pyside6_examples_doc_2025_v6.9.1/blob/6.9.1/examples/widgets/mainwindows/dockwidgets/README.md This command executes the `dockwidgets.py` script, launching the PySide6 application that demonstrates `QDockWidget` functionality. Before running, ensure PySide6 (including `PySide6.QtPrintSupport`) is installed and you are in the `examples/widgets/mainwindows/dockwidgets` directory. ```bash python dockwidgets.py ``` -------------------------------- ### Running the PySide6 QML Example Source: https://github.com/fernicar/pyside6_examples_doc_2025_v6.9.1/blob/6.9.1/examples/qml/tutorials/extending-qml/chapter2-methods/README.md Instructions to navigate to the example directory and execute the Python script to run the PySide6 QML application. This command starts the application demonstrating QML-Python interaction. ```Bash python methods.py ``` -------------------------------- ### APIDOC: Python Application Runner (main.py) Source: https://github.com/fernicar/pyside6_examples_doc_2025_v6.9.1/blob/6.9.1/examples/tutorials/finance_manager/README.md Documentation for the `main.py` script, which serves as the entry point for the PySide6 application. It outlines the standard setup for initializing the QML engine and loading the main QML component. ```APIDOC main.py (Python Script) Purpose: Application Entry Point Steps: 1. Initialize QApplication. 2. Initialize QQmlApplicationEngine. 3. Add import path for Python modules (e.g., for "Finance" module). 4. Load Finance/Main.qml from the "Finance" QML module (defined in Finance/qmldir). 5. Start the QApplication event loop. ``` -------------------------------- ### Run PySide6 Dir View Example Source: https://github.com/fernicar/pyside6_examples_doc_2025_v6.9.1/blob/6.9.1/examples/widgets/itemviews/dirview/README.md Execute the Python script to open the file system viewer, starting from the default directory (usually home or root). ```Bash python dirview.py ``` -------------------------------- ### FastAPI Backend Server Startup Source: https://github.com/fernicar/pyside6_examples_doc_2025_v6.9.1/blob/6.9.1/examples/tutorials/finance_manager/README.md Initializes the database and starts the FastAPI application server using Uvicorn. The server typically listens on `http://127.0.0.1:8000`, making the API accessible to clients. ```Python # In Backend/main.py from .database import initialize_database import uvicorn if __name__ == "__main__": initialize_database() uvicorn.run("rest_api:app", host="127.0.0.1", port=8000, reload=True) ``` -------------------------------- ### Start QStateMachine and Main Application Loop (PySide6) Source: https://github.com/fernicar/pyside6_examples_doc_2025_v6.9.1/blob/6.9.1/examples/widgets/animation/states/README.md Describes the final steps for initiating the QStateMachine and the overall application flow. It covers starting the machine, the immediate application of initial state properties, and how animations execute during transitions. It also outlines the standard PySide6 application setup, including QApplication, QGraphicsView, and the event loop. ```APIDOC Starting the State Machine and Main Application: - machine.start(): - Machine enters state1. - Properties assigned by state1 are applied (initial conditions, no animation occurs *into* the very first state). - On button click (e.g., t1 fires): - state2 becomes target. - Animations added to t1 run, interpolating properties from state1 values to state2 values. - Main Application Flow: - Create QApplication instance. - Set up QGraphicsScene with all items and proxies. - Create and configure QStateMachine. - Create QGraphicsView, set the scene, and show the view. - Start the event loop (app.exec()). ``` -------------------------------- ### Run PySide6 Dir View Example with Custom Path and Options Source: https://github.com/fernicar/pyside6_examples_doc_2025_v6.9.1/blob/6.9.1/examples/widgets/itemviews/dirview/README.md Execute the Python script, specifying a starting directory and optional flags to disable custom icons and file system change watching. ```Bash python dirview.py /path/to/your/directory # Start in the current directory, disable custom icons, and disable watching for changes python dirview.py . -c -w ``` -------------------------------- ### Execute PySide6 Lighting Example Source: https://github.com/fernicar/pyside6_examples_doc_2025_v6.9.1/blob/6.9.1/examples/widgets/effects/lighting/README.md This command runs the `lighting.py` script, which launches a PySide6 application demonstrating dynamic 2D lighting and shadow effects. Ensure PySide6 is installed and you are in the correct directory. ```bash python lighting.py ``` -------------------------------- ### Run PySide6 QML List Property Example Source: https://github.com/fernicar/pyside6_examples_doc_2025_v6.9.1/blob/6.9.1/examples/qml/tutorials/extending-qml/chapter5-listproperties/README.md This command executes the Python script `listproperties.py`, which initializes the QML application demonstrating the `ListProperty` functionality. Ensure PySide6 is installed and the current directory is `examples/qml/tutorials/extending-qml/chapter5-listproperties`. ```Bash python listproperties.py ``` -------------------------------- ### Application Entry Point Source: https://github.com/fernicar/pyside6_examples_doc_2025_v6.9.1/blob/6.9.1/examples/charts/pointconfiguration/doc/pointconfiguration.rst The main entry point for the application. It initializes the `QApplication`, creates an instance of `ChartWindow`, sets its size, makes it visible, and starts the Qt event loop. ```python import sys from PySide6.QtWidgets import QApplication from chartwindow import ChartWindow if __name__ == "__main__": app = QApplication(sys.argv) window = ChartWindow() window.resize(800, 600) window.show() sys.exit(app.exec()) ``` -------------------------------- ### PySide6 Main Application Execution Flow Source: https://github.com/fernicar/pyside6_examples_doc_2025_v6.9.1/blob/6.9.1/examples/spatialaudio/audiopanning/README.md API documentation for the main entry point of the PySide6 application, detailing the standard setup procedures including QApplication initialization, metadata configuration, command-line argument parsing for initial file loading, and the start of the Qt event loop. ```APIDOC if __name__ == '__main__': - QApplication: Initializes the Qt application instance - Application Metadata: Sets name and version - Command-line Arguments: Parses for initial audio file path - AudioWidget: Creates and displays an instance - Initial File Setting: If provided via command line, sets it on AudioWidget - Qt Event Loop: Starts the application's event loop (app.exec()) ``` -------------------------------- ### Run PySide6 PDF Viewer Application Source: https://github.com/fernicar/pyside6_examples_doc_2025_v6.9.1/blob/6.9.1/examples/pdfwidgets/pdfviewer/README.md This command executes the PySide6 PDF viewer application. Optionally, a path to a PDF file can be provided as a command-line argument to open it directly on startup. If no path is provided, the application will start with a blank view, allowing users to open a file via the 'Open' action. ```bash python main.py [path_to_pdf_file.pdf] ``` -------------------------------- ### Main Application Execution Flow Source: https://github.com/fernicar/pyside6_examples_doc_2025_v6.9.1/blob/6.9.1/examples/network/blockingfortuneclient/README.md Describes the entry point of the application, initializing the QApplication, creating the BlockingClient instance, showing the window, and starting the Qt event loop. ```APIDOC Main Application Execution (if __name__ == "__main__"): - Creates QApplication. - Creates an instance of BlockingClient. - Shows the client window. - Starts the Qt event loop. ``` -------------------------------- ### Python Backend Initialization with QWebChannel and WebSockets Source: https://github.com/fernicar/pyside6_examples_doc_2025_v6.9.1/blob/6.9.1/examples/webchannel/standalone/README.md Demonstrates the core setup of the Python backend using PySide6, including QApplication, QWebSocketServer, WebSocketClientWrapper, and QWebChannel to expose a Core object to JavaScript clients. It shows how the server is started, connections are managed, and the Core object is registered. ```Python # main.py setup from PySide6.QtWebSockets import QWebSocketServer from PySide6.QtWebChannel import QWebChannel from PySide6.QtNetwork import QHostAddress from PySide6.QtWidgets import QApplication from PySide6.QtGui import QDesktopServices # Assuming WebSocketClientWrapper and Core are defined elsewhere app = QApplication([]) server = QWebSocketServer("MyWebSocketServer", QWebSocketServer.NonSecureMode) server.listen(QHostAddress.LocalHost, 12345) client_wrapper = WebSocketClientWrapper(server) channel = QWebChannel() # Connect new client connections to the QWebChannel client_wrapper.client_connected.connect(channel.connectTo) # Create and register the Core object core = Core(dialog) # 'dialog' would be an instance of your GUI channel.registerObject("core", core) # Launch the HTML frontend QDesktopServices.openUrl("file:///path/to/index.html") app.exec() ``` -------------------------------- ### Run PySide6 QML Binding Example Source: https://github.com/fernicar/pyside6_examples_doc_2025_v6.9.1/blob/6.9.1/examples/qml/tutorials/extending-qml/chapter3-bindings/README.md This command executes the Python script that launches the PySide6 QML application demonstrating property bindings. Ensure PySide6 is installed and you are in the correct directory before running. ```Bash python bindings.py ``` -------------------------------- ### Build and Install PySide/Shiboken Example with CMake (MSBuild) Source: https://github.com/fernicar/pyside6_examples_doc_2025_v6.9.1/blob/6.9.1/examples/samplebinding/doc/samplebinding.rst Command to build and install the PySide/Shiboken example using CMake's build command, targeting the 'install' target with the 'Release' configuration. This method is suitable when a Visual Studio generator has been configured, providing an alternative to Ninja. ```bash cmake --build . --target install --config Release ``` -------------------------------- ### Python Application Runner (main.py) - Setup Source: https://github.com/fernicar/pyside6_examples_doc_2025_v6.9.1/blob/6.9.1/examples/quickcontrols/filesystemexplorer/README.md Describes the setup process for the PySide6/QML application, including initialization of the application engine, setting metadata, and configuring QML module paths. ```APIDOC main.py (Application Runner): 1. Initializes QGuiApplication and QQmlApplicationEngine. 2. Sets application metadata (name, version, icon). 3. QML Module Path Configuration: - engine.addImportPath(sys.path[0]): Adds the current directory to QML import paths, allowing QML to find 'FileSystemModule' and registered Python types. 4. Loading Main QML: - engine.loadFromModule("FileSystemModule", "Main"): Loads the root QML file 'Main.qml' from the 'FileSystemModule'. 5. Command-Line Argument Handling: - Optionally takes a path as a command-line argument to set the initial directory for the 'FileSystemModel' singleton after QML engine loads. ``` -------------------------------- ### Execute PySide6 Concentric Circles Example Source: https://github.com/fernicar/pyside6_examples_doc_2025_v6.9.1/blob/6.9.1/examples/widgets/painting/concentriccircles/README.md This command runs the Python script for the concentric circles example. Before execution, ensure PySide6 is installed and the current working directory is 'examples/widgets/painting/concentriccircles'. ```Bash python concentriccircles.py ``` -------------------------------- ### Python Application Entry Point: main.py Source: https://github.com/fernicar/pyside6_examples_doc_2025_v6.9.1/blob/6.9.1/examples/webenginewidgets/simplebrowser/README.md Describes the initialization and setup process of the PySide6 browser application, including QApplication setup, default QWebEngineSettings, and initial window creation. ```APIDOC main.py (Application Entry Point): - Initializes QApplication. - Sets default QWebEngineSettings on QWebEngineProfile.defaultProfile() (e.g., enabling plugins, DNS prefetch, screen capture). - Creates an instance of Browser (the application-level manager). - Calls browser.create_hidden_window() to get the first BrowserWindow. - Loads an initial URL (from command-line argument or a default like "chrome://qt") into the first tab of this window. - Shows the window. ``` -------------------------------- ### SQLAlchemy Database Setup in Python Source: https://github.com/fernicar/pyside6_examples_doc_2025_v6.9.1/blob/6.9.1/examples/tutorials/finance_manager/README.md This conceptual Python snippet illustrates the core components for setting up a SQLAlchemy ORM database. It defines the `Base` for declarative models, a `Finance` ORM class mapped to the 'finances' table, an `engine` for database connection, and a `Session` factory for database interactions. ```Python # From database.py (conceptual) Base = declarative_base() class Finance(Base): __tablename__ = 'finances' # ... column definitions ... engine = create_engine(DATABASE_URL) Session = sessionmaker(bind=engine) ``` -------------------------------- ### Main Application Entry Point Source: https://github.com/fernicar/pyside6_examples_doc_2025_v6.9.1/blob/6.9.1/examples/multimedia/player/README.md Illustrates the standard PySide6 application setup, including QApplication initialization, MainWindow instantiation, and entering the event loop. ```Python import sys from PySide6.QtWidgets import QApplication, QMainWindow, QToolBar, QAction, QSlider, QFileDialog from PySide6.QtCore import QUrl from PySide6.QtMultimedia import QMediaPlayer, QAudioOutput, QMediaFormat from PySide6.QtMultimediaWidgets import QVideoWidget from PySide6.QtGui import QIcon, QKeySequence # Assuming MainWindow class definition is available (e.g., in this file or imported) # class MainWindow(QMainWindow): # ... if __name__ == "__main__": app = QApplication(sys.argv) main_window = MainWindow() main_window.resize(800, 600) # Example size main_window.show() sys.exit(app.exec()) ``` -------------------------------- ### Execute PySide6 Thread Signals Example Source: https://github.com/fernicar/pyside6_examples_doc_2025_v6.9.1/blob/6.9.1/examples/widgets/thread_signals/README.md Instructions to run the PySide6 `thread_signals.py` example script from the command line. This command starts the application, which demonstrates background processing with thread signals. ```Bash python thread_signals.py ``` -------------------------------- ### Execute PySide6 Basic Sort/Filter Model Example Source: https://github.com/fernicar/pyside6_examples_doc_2025_v6.9.1/blob/6.9.1/examples/widgets/itemviews/basicfiltermodel/README.md This command executes the `basicsortfiltermodel.py` script, launching the PySide6 example application. It requires PySide6 to be installed and the current directory to be `examples/widgets/itemviews/basicfiltermodel` for successful execution. ```Bash python basicsortfiltermodel.py ``` -------------------------------- ### PySide6 Main Application Entry Point Source: https://github.com/fernicar/pyside6_examples_doc_2025_v6.9.1/blob/6.9.1/examples/widgets/draganddrop/dropsite/README.md Documentation for the `main.py` script, which serves as the entry point for the PySide6 application. It initializes the `QApplication` and displays the `DropSiteWindow`. ```APIDOC Script: main.py Purpose: Initializes the QApplication and displays the main application window. Actions: - Initializes QApplication. - Creates an instance of DropSiteWindow. - Shows the DropSiteWindow. - Starts the application event loop. ``` -------------------------------- ### Build PySide/Shiboken Example with Ninja Source: https://github.com/fernicar/pyside6_examples_doc_2025_v6.9.1/blob/6.9.1/examples/samplebinding/doc/samplebinding.rst Commands to build and install the configured PySide/Shiboken example using the Ninja build system after CMake configuration. ```bash ninja ninja install cd .. ``` -------------------------------- ### PySide6 Main Application Entry Point Source: https://github.com/fernicar/pyside6_examples_doc_2025_v6.9.1/blob/6.9.1/examples/widgets/dialogs/licensewizard/README.md Describes the main application setup, including QApplication instantiation, wizard creation, display, and event loop initiation, which launches the PySide6 wizard. ```APIDOC Main Application (main.py): - Creates QApplication instance. - Creates an instance of LicenseWizard. - Shows the wizard using wizard.show(). - Starts the event loop. ``` -------------------------------- ### PySide6 Application Initialization Source: https://github.com/fernicar/pyside6_examples_doc_2025_v6.9.1/blob/6.9.1/examples/tutorials/finance_manager/part1/README.md Standard PySide6 application setup in `main.py`, initializing `QApplication` and `QQmlApplicationEngine`, adding import paths, and loading the main QML file. ```Python import sys from pathlib import Path from PySide6.QtGui import QApplication from PySide6.QtQml import QQmlApplicationEngine # Ensure the Python module is discoverable by QML # This is crucial for @QmlElement decorated classes # sys.path.append(str(Path(__file__).parent)) if __name__ == "__main__": app = QApplication(sys.argv) engine = QQmlApplicationEngine() # Add the current directory to the QML import path # This allows QML to find the 'Finance' module defined by qmldir engine.addImportPath(str(Path(__file__).parent)) # Load the main QML file from the 'Finance' module engine.loadFromModule("Finance", "Main") if not engine.rootObjects(): sys.exit(-1) sys.exit(app.exec()) ``` -------------------------------- ### Run PySide6 Example Application via Command Line Source: https://github.com/fernicar/pyside6_examples_doc_2025_v6.9.1/blob/6.9.1/examples/widgets/mainwindows/application/README.md Instructions for executing the PySide6 example application from the terminal. This includes the basic command to launch the application and an option to open a specified file upon startup. ```bash python application.py ``` ```bash python application.py yourfile.txt ``` -------------------------------- ### Execute PySide6 Text Object Example Source: https://github.com/fernicar/pyside6_examples_doc_2025_v6.9.1/blob/6.9.1/examples/widgets/richtext/textobject/README.md This command runs the provided PySide6 example script, which demonstrates embedding custom SVG objects into a rich text editor. Ensure all PySide6 dependencies, including QtSvg, are installed before execution. ```Bash python textobject.py ``` -------------------------------- ### Run PySide6 JSON Model Example Source: https://github.com/fernicar/pyside6_examples_doc_2025_v6.9.1/blob/6.9.1/examples/widgets/itemviews/jsonmodel/README.md Instructions to execute the PySide6 JSON model application from the command line. Ensure PySide6 is installed and navigate to the correct directory before running. ```Bash python jsonmodel.py ``` -------------------------------- ### Building Scriptable Application with QMake Source: https://github.com/fernicar/pyside6_examples_doc_2025_v6.9.1/blob/6.9.1/examples/scriptableapplication/doc/scriptableapplication.rst Commands to build the scriptable application example using QMake. This involves creating a build directory, running qmake to generate Makefiles, and then compiling the project using make (or nmake/jom on Windows). ```bash mkdir build cd build qmake .. make # or nmake / jom for Windows ``` -------------------------------- ### PySide6 Application Main Entry Point APIDOC Source: https://github.com/fernicar/pyside6_examples_doc_2025_v6.9.1/blob/6.9.1/examples/multimedia/audiooutput/README.md Documentation for the main application entry point, responsible for initializing the Qt application, checking for available audio output devices, and starting the main window. ```APIDOC Application Main Entry Point: if __name__ == "__main__": - Initializes QApplication. - Checks for available audio output devices; exits if none are found. - Creates and shows the AudioTest main window. - Enters the Qt event loop. ``` -------------------------------- ### Run PySide6 Elastic Nodes Application Source: https://github.com/fernicar/pyside6_examples_doc_2025_v6.9.1/blob/6.9.1/examples/widgets/graphicsview/elasticnodes/README.md Instructions on how to execute the PySide6 elastic nodes example from the command line. This requires PySide6 to be installed and navigating to the correct directory where the 'elasticnodes.py' script resides. ```Bash python elasticnodes.py ``` -------------------------------- ### Python Application Runner Setup (main.py) Source: https://github.com/fernicar/pyside6_examples_doc_2025_v6.9.1/blob/6.9.1/examples/quick3d/proceduraltexture/README.md Describes the setup process for the PySide6 application, including initialization of the Qt application and QML engine, adding import paths, and loading the main QML file from a module. ```APIDOC main.py (Application Runner): 1. Initializes QGuiApplication. 2. Initializes QQmlApplicationEngine. 3. Adds application directory to QML import path: engine.addImportPath(os.fspath(app_dir)) 4. Loads main QML file from QML module: engine.loadFromModule("ProceduralTextureModule", "Main") ``` -------------------------------- ### Build and Install WigglyWidget C++ Binding with Ninja Source: https://github.com/fernicar/pyside6_examples_doc_2025_v6.9.1/blob/6.9.1/examples/widgetbinding/doc/widgetbinding.md Commands to compile the C++ binding project using the Ninja build system and then install the generated shared libraries, making them accessible for the Python application to import. ```bash ninja ninja install cd .. ``` -------------------------------- ### Run PySide6 Widget Gallery Example Source: https://github.com/fernicar/pyside6_examples_doc_2025_v6.9.1/blob/6.9.1/examples/widgets/widgetsgallery/README.md Executes the `main.py` script to launch the PySide6 Widget Gallery application, demonstrating various Qt widgets and their interactive features. ```bash python main.py ``` -------------------------------- ### Run PySide6 Regular Expression Example Application Source: https://github.com/fernicar/pyside6_examples_doc_2025_v6.9.1/blob/6.9.1/examples/widgets/tools/regularexpression/README.md Execute the main Python script to launch the PySide6 regular expression example application from the command line. Ensure PySide6 is installed and you are in the correct directory. ```Bash python regularexpression.py ``` -------------------------------- ### Python: `main.py` Application Entry Point Source: https://github.com/fernicar/pyside6_examples_doc_2025_v6.9.1/blob/6.9.1/examples/demos/documentviewer/README.md The `main.py` script serves as the application's entry point. It initializes the QApplication, configures application settings, parses command-line arguments for file opening, creates and displays the MainWindow, and handles initial file loading if provided. ```APIDOC main.py: - Initializes QApplication. - Sets QSettings organization and application names. - Parses command-line arguments (e.g., file path). - Creates and shows MainWindow. - Attempts to open a file if passed as an argument. ``` -------------------------------- ### Run PySide6 String List Model Example Source: https://github.com/fernicar/pyside6_examples_doc_2025_v6.9.1/blob/6.9.1/examples/quick/models/stringlistmodel/README.md Instructions to navigate to the example directory and execute the Python script to run the application. ```Bash python stringlistmodel.py ``` -------------------------------- ### Run PySide6 Address Book Example Source: https://github.com/fernicar/pyside6_examples_doc_2025_v6.9.1/blob/6.9.1/examples/widgets/itemviews/address_book/README.md Instructions to execute the main Python script for the PySide6 Address Book application from the command line. Ensure PySide6 is installed and navigate to the correct directory before running the command. ```Bash python address_book.py ``` -------------------------------- ### Run PySide6 Drag and Drop Robot Application Source: https://github.com/fernicar/pyside6_examples_doc_2025_v6.9.1/blob/6.9.1/examples/widgets/graphicsview/dragdroprobot/README.md This command executes the main Python script for the PySide6 drag and drop robot example. Ensure PySide6 is installed and you are in the correct directory (`examples/widgets/graphicsview/dragdroprobot`) before running. ```Bash python dragdrobrobot.py ``` -------------------------------- ### Running PySide6 QML Method Example and Output Source: https://github.com/fernicar/pyside6_examples_doc_2025_v6.9.1/blob/6.9.1/examples/qml/tutorials/extending-qml-advanced/methods/README.md Provides instructions on how to execute the PySide6 QML example from the command line and shows the expected console output, demonstrating the successful invocation of the Python `invite` method from QML and its effect on the guest list. ```bash python main.py ``` ```plaintext Bob Jones is having a birthday! They are inviting: Leo Hodges Jack Smith Anne Brown William Green ``` -------------------------------- ### Run PySide6 QML Default Property Example Source: https://github.com/fernicar/pyside6_examples_doc_2025_v6.9.1/blob/6.9.1/examples/qml/tutorials/extending-qml-advanced/advanced3-Default-properties/README.md This command demonstrates how to execute the Python script to run the PySide6 QML example. It assumes PySide6 is installed and the current directory is `examples/qml/tutorials/extending-qml-advanced/advanced3-Default-properties`. ```bash python main.py ``` -------------------------------- ### PySide6 Server Class Initialization and UI Setup Source: https://github.com/fernicar/pyside6_examples_doc_2025_v6.9.1/blob/6.9.1/examples/network/fortuneserver/README.md Details the `Server` class constructor, including UI element setup, fortune string storage, `QTcpServer` initialization, listening on an available port, and connecting the `newConnection` signal. ```APIDOC Server class (subclass of QDialog): __init__(): Purpose: Initializes the server application, sets up the UI, stores fortunes, and starts the TCP server. UI Setup: - status_label (QLabel): Displays IP address(es) and port. - Quit QPushButton: Closes the application. - Layouts: Basic Qt layouts. Fortune Storage: - self.fortunes (tuple): Predefined fortune strings. Server Initialization: - self._tcp_server (QTcpServer): Instance for handling TCP connections. - Start Listening: - Method: self._tcp_server.listen() (listens on QHostAddress.Any, OS picks port). - Error Handling: QMessageBox.critical on failure. - Port Retrieval: self._tcp_server.serverPort(). - Status Update: status_label updated with IP/port. - Signal Connection: - Signal: self._tcp_server.newConnection - Slot: self.send_fortune ``` -------------------------------- ### PySide6 Application Setup: Colliding Mice Simulation Source: https://github.com/fernicar/pyside6_examples_doc_2025_v6.9.1/blob/6.9.1/examples/widgets/graphicsview/collidingmice/README.md API documentation for the main application setup in 'collidingmice.py', detailing the configuration of QGraphicsScene and QGraphicsView, scene population with Mouse objects, and the animation loop using QTimer. ```APIDOC Main Application Setup (collidingmice.py - if __name__ == '__main__':): - Scene Initialization: Object: QGraphicsScene Configuration: Created with a defined scene rectangle. scene.setItemIndexMethod(QGraphicsScene.ItemIndexMethod.NoIndex) is set. - Populating the Scene: Action: Instantiates a specified number of Mouse objects (MOUSE_COUNT). Placement: Gives initial positions in a circular arrangement. Addition: Adds Mouse objects to the scene. - View Configuration: Object: QGraphicsView Display: Created to display the scene. Background: Set to 'cheese.jpg' loaded from Qt resource system (mice_rc.py). Rendering/Performance Hints: view.setRenderHint(QPainter.RenderHint.Antialiasing) view.setCacheMode(QGraphicsView.CacheModeFlag.CacheBackground) view.setViewportUpdateMode(QGraphicsView.ViewportUpdateMode.BoundingRectViewportUpdate) Interaction: view.setDragMode(QGraphicsView.DragMode.ScrollHandDrag) allows panning. - Animation Loop: Mechanism: QTimer Frequency: Configured to call scene.advance() periodically (approx. 30 times per second). Effect: Drives the advance(1) method on every Mouse item in the scene, controlling their movement and logic. ``` -------------------------------- ### Run PySide6 QML-Python Signal Example Source: https://github.com/fernicar/pyside6_examples_doc_2025_v6.9.1/blob/6.9.1/examples/qml/signals/qmltopy3/README.md Execute the main Python script from the command line to launch the application. This command starts the PySide6 application, demonstrating the QML-to-Python signal handling in action. ```Bash python main.py ``` -------------------------------- ### PySide6 QTreeView Basic Setup and Data Population Source: https://github.com/fernicar/pyside6_examples_doc_2025_v6.9.1/blob/6.9.1/examples/widgets/tutorials/modelview/README.md This snippet shows basic operations for populating a QStandardItemModel and setting it on a QTreeView, followed by expanding all nodes. It demonstrates initial data setup for a tree view. ```Python # america_item.appendRow(QStandardItem("Canada")) # # self._tree_view.setModel(self._standard_model) # self._tree_view.expandAll() ``` -------------------------------- ### Accessing Screen Objects (QScreen) Source: https://github.com/fernicar/pyside6_examples_doc_2025_v6.9.1/blob/6.9.1/examples/widgets/desktop/screenshot/README.md Methods provided by Qt to retrieve `QScreen` objects, which represent physical screens connected to the system. `primaryScreen()` gets the main screen, while `screen()` gets the screen a specific widget is on. ```APIDOC QGuiApplication.primaryScreen() -> QScreen Returns the primary screen of the application. QWidget.screen() -> QScreen Returns the QScreen object that the widget is currently displayed on. ``` -------------------------------- ### PySide6: Main Application Flow for JSON Model Example Source: https://github.com/fernicar/pyside6_examples_doc_2025_v6.9.1/blob/6.9.1/examples/widgets/itemviews/jsonmodel/README.md This section outlines the main application setup, demonstrating how to initialize the QApplication and QTreeView, instantiate and integrate the custom JsonModel, load JSON data, and customize the view's appearance. ```APIDOC Main Application Flow (jsonmodel.py's if __name__ == "__main__":): Steps: 1. Create QApplication instance. 2. Create QTreeView instance. 3. Instantiate JsonModel. 4. Set JsonModel on QTreeView using setModel(). 5. Load JSON data from 'example.json' using Python's standard json module (json.load()). 6. Pass the loaded Python dictionary/list to model.load(). 7. Customize QTreeView appearance (e.g., setHeaderData, setAlternatingRowColors). 8. Show the QTreeView. 9. Start the QApplication event loop. ``` -------------------------------- ### PySide6 Application Entry Point (main.py) API Documentation Source: https://github.com/fernicar/pyside6_examples_doc_2025_v6.9.1/blob/6.9.1/examples/opengl/threadedqopenglwidget/README.md API documentation for the `main.py` script, which serves as the application's entry point, initializing `QApplication` and allowing for single-threaded mode via command-line arguments. ```APIDOC main.py (Application Entry Point): - Initializes QApplication. - Allows command-line argument --single to run in single-threaded mode. ``` -------------------------------- ### Manually Start D-Bus Session Bus Source: https://github.com/fernicar/pyside6_examples_doc_2025_v6.9.1/blob/6.9.1/examples/dbus/listnames/README.md Provides a shell command to manually start a D-Bus session bus. This step is often necessary in minimal environments or remote sessions where the D-Bus session bus is not automatically active. ```Shell eval $(dbus-launch --auto-syntax) ``` -------------------------------- ### Running the PySide6 Custom Property Types Example Source: https://github.com/fernicar/pyside6_examples_doc_2025_v6.9.1/blob/6.9.1/examples/qml/tutorials/extending-qml/chapter4-customPropertyTypes/README.md This command line snippet provides instructions on how to execute the Python script for the custom property types example. It assumes PySide6 is installed and the user is in the correct directory. ```Bash python customPropertyTypes.py ``` -------------------------------- ### Run PySide6 Character Map Example Source: https://github.com/fernicar/pyside6_examples_doc_2025_v6.9.1/blob/6.9.1/examples/widgets/widgets/charactermap/README.md Instructions to navigate to the example directory and execute the main Python script to launch the PySide6 Character Map application. ```Bash python main.py ``` -------------------------------- ### APIDOC: PySide6 QTableView Main Application Setup Source: https://github.com/fernicar/pyside6_examples_doc_2025_v6.9.1/blob/6.9.1/examples/widgets/itemviews/spinboxdelegate/README.md Documentation for setting up the main application, including model and view creation, and assigning the custom SpinBoxDelegate to the QTableView. ```APIDOC Main Application Setup: Model: QStandardItemModel (4 rows, 2 columns) Populated with sample integer values. View: QTableView Model set: tableView.setModel(QStandardItemModel) Delegate Assignment: delegate = SpinBoxDelegate() tableView.setItemDelegate(delegate) ``` -------------------------------- ### Main Application Setup with QTableWidget and StarDelegate Source: https://github.com/fernicar/pyside6_examples_doc_2025_v6.9.1/blob/6.9.1/examples/widgets/itemviews/stardelegate/README.md Demonstrates how to set up a QTableWidget, apply the StarDelegate, populate it with sample data, and configure edit triggers for the custom delegate. ```APIDOC Main Application Setup (in stardelegate.py's if __name__ == '__main__':): 1. Initialize QApplication. 2. Create QTableWidget instance. 3. Create StarDelegate instance. 4. Set StarDelegate on QTableWidget: table_widget.setItemDelegate(delegate). 5. Populate table with sample data, storing integer ratings using QTableWidgetItem.setData(0, integer_rating). 6. Configure edit triggers (e.g., DoubleClicked, SelectedClicked). 7. Show the table widget and start the application event loop. ``` -------------------------------- ### Execute PySide6 Flow Layout Example Script Source: https://github.com/fernicar/pyside6_examples_doc_2025_v6.9.1/blob/6.9.1/examples/widgets/layouts/flowlayout/README.md This command executes the `flowlayout.py` script, which demonstrates a custom flow layout in PySide6. Ensure PySide6 is installed and you are in the correct directory (`examples/widgets/layouts/flowlayout`) before running. After execution, a window titled "Flow Layout" will appear, showcasing buttons that adapt their arrangement dynamically as the window is resized. ```bash python flowlayout.py ``` -------------------------------- ### Execute PySide6 Order Form Application Source: https://github.com/fernicar/pyside6_examples_doc_2025_v6.9.1/blob/6.9.1/examples/widgets/richtext/orderform/README.md Instructions to run the PySide6 rich text order form example. Ensure PySide6 and its QtPrintSupport module are installed. Navigate to the specified directory and execute the Python script from the command line. The application will launch, allowing users to generate and print formatted letters. ```bash python orderform.py ``` -------------------------------- ### Python QWebChannel Setup in MainWindow Source: https://github.com/fernicar/pyside6_examples_doc_2025_v6.9.1/blob/6.9.1/examples/webenginewidgets/markdowneditor/README.md Python code demonstrating how the `MainWindow` class initializes a `QWebChannel`, registers the `Document` instance (exposed as "content") with the channel, and associates the channel with the `PreviewPage` for inter-process communication. ```Python self._channel = QWebChannel(self) self._channel.registerObject("content", self.m_content) # Expose Document as "content" self._page.setWebChannel(self._channel) ``` -------------------------------- ### QML Main User Interface (main.qml) API Source: https://github.com/fernicar/pyside6_examples_doc_2025_v6.9.1/blob/6.9.1/examples/qml/editingmodel/README.md Outlines the structure of `main.qml`, including the `Window`, `ListView` instantiation with the Python model, delegate setup, and control buttons for model interaction. ```APIDOC Window { # Root item ListView { # id: lv orientation: ListView.Horizontal model: BaseModel {} # Instantiates and assigns the Python model delegate: DropArea { # Delegate for each item onEntered: lv.model.move(drag.source.modelIndex, index) # Handles drag-and-drop reordering } } // Control Buttons Button { text: "Reset view" onClicked: lv.model.reset() # Calls Python model's reset method } Button { text: "Add element" onClicked: lv.model.append() # Calls Python model's append method } Rectangle { # Background for ListView // Visual clarity } Component.onCompleted: lv.model.reset() # Initial population of the view } ``` -------------------------------- ### Run PySide6 PDF Viewer Example Source: https://github.com/fernicar/pyside6_examples_doc_2025_v6.9.1/blob/6.9.1/examples/pdf/quickpdfviewer/README.md Command to execute the PySide6 PDF viewer application from the command line. An optional path to a PDF file can be provided, which the application will attempt to open on startup. If no path is given, it defaults to loading `test.pdf` from the `resources` subdirectory. ```Bash python main.py [path_to_pdf_file.pdf] ``` -------------------------------- ### Run PySide6 Star Delegate Example Source: https://github.com/fernicar/pyside6_examples_doc_2025_v6.9.1/blob/6.9.1/examples/widgets/itemviews/stardelegate/README.md Instructions on how to execute the PySide6 star delegate example script from the command line. ```Bash python stardelegate.py ``` -------------------------------- ### PySide6 Main Application Execution Source: https://github.com/fernicar/pyside6_examples_doc_2025_v6.9.1/blob/6.9.1/examples/statemachine/trafficlight/README.md Standard Python entry point for a PySide6 application. It initializes QApplication, creates and displays the main TrafficLight widget, and starts the event loop. ```APIDOC Main Application Execution (if __name__ == '__main__':): - Creates QApplication. - Creates an instance of the main TrafficLight widget. - Resizes, shows the widget, and starts the event loop. ``` -------------------------------- ### Execute PySide6 MDI Application from Command Line Source: https://github.com/fernicar/pyside6_examples_doc_2025_v6.9.1/blob/6.9.1/examples/widgets/mainwindows/mdi/README.md These commands illustrate how to run the PySide6 MDI example application. Users can launch the application directly or specify one or more text files to be opened automatically upon startup, demonstrating file association capabilities. ```Bash python mdi.py python mdi.py file1.txt file2.txt ```