### start Source: https://flameshot.org/docs/dev/flameshot/classLoadSpinner Starts the loading spinner animation. ```APIDOC ## start ### Description Starts the loading spinner animation. ### Signature ```cpp void LoadSpinner::start () ``` ``` -------------------------------- ### Start Flameshot Daemon and Pin Screenshot Source: https://flameshot.org/docs/guide/troubleshooting For tiling window managers, ensure DBus is running. This example first starts the Flameshot daemon and then uses it to capture and pin a specific region. ```bash # this will start the daemon flameshot & # this will select a 300 by 200 pixel area, and immediately pin it flameshot gui --region 300x200+300+300 --pin --accept-on-select ``` -------------------------------- ### Install Documentation Dependencies Source: https://flameshot.org/docs/dev/docs Installs necessary Python packages for building and serving the documentation locally. Ensure you are in the correct directory before running. ```bash pip install \ mkdocs \ mkdocs-material \ git+https://github.com/veracioux/mkdoxy@v1.0.0 ``` -------------------------------- ### start Source: https://flameshot.org/docs/dev/flameshot/classFlameshotDaemon Starts the Flameshot daemon process. ```APIDOC ## start ### Description Initializes and starts the Flameshot daemon. ### Request Example ```cpp FlameshotDaemon::start(); ``` ``` -------------------------------- ### Get All Users Start Menu Path Source: https://flameshot.org/docs/dev/flameshot/structWinLnkFileParser Retrieves the file path for the 'All Users' Start Menu directory. This is useful for locating system-wide shortcuts. ```cpp QString WinLnkFileParser::getAllUsersStartMenuPath () ``` -------------------------------- ### Install Flameshot on Solus Source: https://flameshot.org/docs/installation/installation-linux Use eopkg to install Flameshot on Solus. ```bash eopkg install flameshot ``` -------------------------------- ### Install Flameshot on openSUSE Source: https://flameshot.org/docs/installation/installation-linux Use zypper to install Flameshot on openSUSE. ```bash zypper install flameshot ``` -------------------------------- ### Install Flameshot on Guix Source: https://flameshot.org/docs/installation/installation-linux Use guix to install Flameshot on Guix. ```bash guix install flameshot ``` -------------------------------- ### Daemon Control and Initialization Source: https://flameshot.org/docs/dev/flameshot/flameshotdaemon_8h_source Static methods for starting the daemon and retrieving its singleton instance. ```APIDOC ## FlameshotDaemon::start() ### Description Starts the Flameshot daemon process. This should be called once during application initialization. ### Method static void ### Endpoint N/A (Static method) ### Parameters None ``` ```APIDOC ## FlameshotDaemon::instance() ### Description Returns the singleton instance of the FlameshotDaemon. Use this to access daemon functionalities. ### Method static FlameshotDaemon* ### Endpoint N/A (Static method) ### Parameters None ``` -------------------------------- ### getAllUsersStartMenuPath Source: https://flameshot.org/docs/dev/flameshot/structWinLnkFileParser Retrieves the start menu path for all users. ```APIDOC ## getAllUsersStartMenuPath() ### Description Returns the file path to the 'All Users' start menu directory. ### Method QString ### Parameters None ### Response - **QString**: The path to the 'All Users' start menu. ``` -------------------------------- ### Install Flameshot on Void Linux Source: https://flameshot.org/docs/installation/installation-linux Use xbps-install to install Flameshot on Void Linux. ```bash xbps-install flameshot ``` -------------------------------- ### Install Flameshot using Scoop Source: https://flameshot.org/docs/installation/installation-windows Install Flameshot using the Scoop package manager. This involves adding the 'extras' bucket, updating Scoop, and then installing Flameshot. ```bash scoop bucket add extras scoop update scoop install flameshot ``` -------------------------------- ### Install Flameshot on ALT Linux Source: https://flameshot.org/docs/installation/installation-linux Use apt-get with su to install Flameshot on ALT Linux. ```bash su - -c "apt-get install flameshot" ``` -------------------------------- ### Initialize QGuiAppCurrentScreen Source: https://flameshot.org/docs/dev/flameshot/classQGuiAppCurrentScreen Constructor for the QGuiAppCurrentScreen class. No specific setup is required. ```cpp explicit QGuiAppCurrentScreen::QGuiAppCurrentScreen () ``` -------------------------------- ### Install Flameshot Source: https://flameshot.org/docs/installation/source-code Installs Flameshot to the system after compilation, typically requiring superuser privileges. ```bash make install ``` -------------------------------- ### Start Drawing for AbstractTwoPointTool Source: https://flameshot.org/docs/dev/flameshot/abstracttwopointtool_8cpp_source Initializes the tool when drawing starts, setting the color, first point, and size. ```cpp void AbstractTwoPointTool::drawStart(const CaptureContext& context) { onColorChanged(context.color); m_points.first = context.mousePos; m_points.second = context.mousePos; onSizeChanged(context.toolSize); } ``` -------------------------------- ### Install OSX Compilation Dependencies Source: https://flameshot.org/docs/installation/source-code Installs Qt6 and CMake on macOS using Homebrew, which are required for compilation. ```bash brew install qt6 brew install cmake ``` -------------------------------- ### Initialize Utility Panel and Connections Source: https://flameshot.org/docs/dev/flameshot/capturewidget_8cpp_source Sets up the main utility panel, connects its signals for layer changes and tool movement, and configures its appearance based on screen geometry and color picker width. ```cpp m_panel = new UtilityPanel(this); m_panel->hide(); makeChild(m_panel); #if defined(Q_OS_MACOS) QScreen* currentScreen = QGuiAppCurrentScreen().currentScreen(); panelRect.moveTo(mapFromGlobal(panelRect.topLeft())); m_panel->setFixedWidth(static_cast(m_colorPicker->width() * 1.5)); m_panel->setFixedHeight(currentScreen->geometry().height()); #else panelRect.moveTo(mapFromGlobal(panelRect.topLeft())); panelRect.setWidth(m_colorPicker->width() * 1.5); m_panel->setGeometry(panelRect); #endif connect(m_panel, &UtilityPanel::layerChanged, this, &CaptureWidget::updateActiveLayer); connect(m_panel, &UtilityPanel::moveUpClicked, this, &CaptureWidget::onMoveCaptureToolUp); connect(m_panel, &UtilityPanel::moveDownClicked, this, &CaptureWidget::onMoveCaptureToolDown); ``` -------------------------------- ### Initialize Keyboard Shortcuts Source: https://flameshot.org/docs/dev/flameshot/capturewidget_8cpp_source Sets up various keyboard shortcuts for common actions like undo, redo, toggling the panel, resizing and moving the selection, deleting/committing the current tool, selecting all, and escaping. ```cpp void CaptureWidget::initShortcuts() { newShortcut( QKeySequence(ConfigHandler().shortcut("TYPE_UNDO")), this, SLOT(undo())); newShortcut( QKeySequence(ConfigHandler().shortcut("TYPE_REDO")), this, SLOT(redo())); newShortcut(QKeySequence(ConfigHandler().shortcut("TYPE_TOGGLE_PANEL")), this, SLOT(togglePanel())); newShortcut(QKeySequence(ConfigHandler().shortcut("TYPE_RESIZE_LEFT")), m_selection, SLOT(resizeLeft())); newShortcut(QKeySequence(ConfigHandler().shortcut("TYPE_RESIZE_RIGHT")), m_selection, SLOT(resizeRight())); newShortcut(QKeySequence(ConfigHandler().shortcut("TYPE_RESIZE_UP")), m_selection, SLOT(resizeUp())); newShortcut(QKeySequence(ConfigHandler().shortcut("TYPE_RESIZE_DOWN")), m_selection, SLOT(resizeDown())); newShortcut(QKeySequence(ConfigHandler().shortcut("TYPE_SYM_RESIZE_LEFT")), m_selection, SLOT(symResizeLeft())); newShortcut(QKeySequence(ConfigHandler().shortcut("TYPE_SYM_RESIZE_RIGHT")), m_selection, SLOT(symResizeRight())); newShortcut(QKeySequence(ConfigHandler().shortcut("TYPE_SYM_RESIZE_UP")), m_selection, SLOT(symResizeUp())); newShortcut(QKeySequence(ConfigHandler().shortcut("TYPE_SYM_RESIZE_DOWN")), m_selection, SLOT(symResizeDown())); newShortcut(QKeySequence(ConfigHandler().shortcut("TYPE_MOVE_LEFT")), m_selection, SLOT(moveLeft())); newShortcut(QKeySequence(ConfigHandler().shortcut("TYPE_MOVE_RIGHT")), m_selection, SLOT(moveRight())); newShortcut(QKeySequence(ConfigHandler().shortcut("TYPE_MOVE_UP")), m_selection, SLOT(moveUp())); newShortcut(QKeySequence(ConfigHandler().shortcut("TYPE_MOVE_DOWN")), m_selection, SLOT(moveDown())); newShortcut( QKeySequence(ConfigHandler().shortcut("TYPE_DELETE_CURRENT_TOOL")), this, SLOT(deleteCurrentTool())); newShortcut( QKeySequence(ConfigHandler().shortcut("TYPE_COMMIT_CURRENT_TOOL")), this, SLOT(commitCurrentTool())); newShortcut(QKeySequence(ConfigHandler().shortcut("TYPE_SELECT_ALL")), this, SLOT(selectAll())); newShortcut(Qt::Key_Escape, this, SLOT(deleteToolWidgetOrClose())); } ``` -------------------------------- ### Get All Users Start Menu Path Source: https://flameshot.org/docs/dev/flameshot/winlnkfileparse_8cpp_source Retrieves the absolute path to the 'All Users' Start Menu programs folder using the Windows API function `SHGetFolderPathW` with `CSIDL_COMMON_PROGRAMS`. Returns an empty string if the path cannot be retrieved. ```cpp QString WinLnkFileParser::getAllUsersStartMenuPath() { QString sRet(""); WCHAR path[MAX_PATH]; HRESULT hr = SHGetFolderPathW(NULL, CSIDL_COMMON_PROGRAMS, NULL, 0, path); if (SUCCEEDED(hr)) { sRet = QDir(QString::fromWCharArray(path)).absolutePath(); } return sRet; } ``` -------------------------------- ### Initialize Color Selection Buttons Source: https://flameshot.org/docs/dev/flameshot/uicoloreditor_8cpp_source Sets up the buttons for selecting the main color and contrast color. This includes creating QGroupBoxes, CaptureToolButtons, ClickableLabels, and arranging them using layouts. Tooltips are also provided. ```cpp void UIcolorEditor::initButtons() { const int extraSize = GlobalValues::buttonBaseSize() / 3; int frameSize = GlobalValues::buttonBaseSize() + extraSize; m_vLayout->addWidget(new QLabel(tr("Select a Button to modify it"), this)); auto* frame = new QGroupBox(); frame->setFixedSize(frameSize, frameSize); m_buttonMainColor = new CaptureToolButton(m_buttonIconType, frame); m_buttonMainColor->move(m_buttonMainColor->x() + extraSize / 2, m_buttonMainColor->y() + extraSize / 2); auto* h1 = new QHBoxLayout(); h1->addWidget(frame); m_labelMain = new ClickableLabel(tr("Main Color"), this); h1->addWidget(m_labelMain); m_vLayout->addLayout(h1); m_buttonMainColor->setToolTip(tr("Click on this button to set the edition" " mode of the main color.")); auto* frame2 = new QGroupBox(); m_buttonContrast = new CaptureToolButton(m_buttonIconType, frame2); m_buttonContrast->move(m_buttonContrast->x() + extraSize / 2, m_buttonContrast->y() + extraSize / 2); auto* h2 = new QHBoxLayout(); h2->addWidget(frame2); frame2->setFixedSize(frameSize, frameSize); m_labelContrast = new ClickableLabel(tr("Contrast Color"), this); m_labelContrast->setStyleSheet(QStringLiteral("color : gray")); h2->addWidget(m_labelContrast); m_vLayout->addLayout(h2); m_buttonContrast->setToolTip(tr("Click on this button to set the edition" " mode of the contrast color.")); connect(m_buttonMainColor, &CaptureToolButton::pressedButtonLeftClick, this, &UIcolorEditor::changeLastButton); connect(m_buttonContrast, &CaptureToolButton::pressedButtonLeftClick, this, &UIcolorEditor::changeLastButton); // clicking the labels changes the button too connect(m_labelMain, &ClickableLabel::clicked, this, [this] { changeLastButton(m_buttonMainColor); }); } ``` -------------------------------- ### Get Daemon Instance Source: https://flameshot.org/docs/dev/flameshot/classFlameshotDaemon Returns the singleton instance of FlameshotDaemon. If the daemon is not running, it starts it. This is required for D-Bus signal handling. ```cpp static FlameshotDaemon * FlameshotDaemon::instance () ``` -------------------------------- ### Initialize ConfigWindow Source: https://flameshot.org/docs/dev/flameshot/configwindow_8cpp_source Sets up the main configuration window, including tab widgets for different settings categories and connects signals for configuration updates. It also initializes error indicators for configuration files. ```cpp // SPDX-License-Identifier: GPL-3.0-or-later // SPDX-FileCopyrightText: 2017-2019 Alejandro Sirgo Rica & Contributors #include "configwindow.h" #include "abstractlogger.h" #include "src/config/configresolver.h" #include "src/config/filenameeditor.h" #include "src/config/generalconf.h" #include "src/config/shortcutswidget.h" #include "src/config/strftimechooserwidget.h" #include "src/config/visualseditor.h" #include "src/utils/colorutils.h" #include "src/utils/confighandler.h" #include "src/utils/globalvalues.h" #include "src/utils/pathinfo.h" #include #include #include #include #include #include #include #include #include #include // ConfigWindow contains the menus where you can configure the application ConfigWindow::ConfigWindow(QWidget* parent) : QWidget(parent) { // We wrap QTabWidget in a QWidget because of a Qt bug auto* layout = new QVBoxLayout(this); m_tabWidget = new QTabWidget(this); m_tabWidget->tabBar()->setUsesScrollButtons(false); layout->addWidget(m_tabWidget); setAttribute(Qt::WA_DeleteOnClose); setWindowIcon(QIcon(GlobalValues::iconPath())); setWindowTitle(tr("Configuration")); connect(ConfigHandler::getInstance(), &ConfigHandler::fileChanged, this, &ConfigWindow::updateChildren); QColor background = this->palette().window().color(); bool isDark = ColorUtils::colorIsDark(background); QString modifier = isDark ? PathInfo::whiteIconPath() : PathInfo::blackIconPath(); // visuals m_visuals = new VisualsEditor(); m_visualsTab = new QWidget(); auto* visualsLayout = new QVBoxLayout(m_visualsTab); m_visualsTab->setLayout(visualsLayout); visualsLayout->addWidget(m_visuals); m_tabWidget->addTab( m_visualsTab, QIcon(modifier + "graphics.svg"), tr("Interface")); // filename m_filenameEditor = new FileNameEditor(); m_filenameEditorTab = new QWidget(); auto* filenameEditorLayout = new QVBoxLayout(m_filenameEditorTab); m_filenameEditorTab->setLayout(filenameEditorLayout); filenameEditorLayout->addWidget(m_filenameEditor); m_tabWidget->addTab(m_filenameEditorTab, QIcon(modifier + "name_edition.svg"), tr("Filename Editor")); // general m_generalConfig = new GeneralConf(); m_generalConfigTab = new QWidget(); auto* generalConfigLayout = new QVBoxLayout(m_generalConfigTab); m_generalConfigTab->setLayout(generalConfigLayout); generalConfigLayout->addWidget(m_generalConfig); m_tabWidget->addTab( m_generalConfigTab, QIcon(modifier + "config.svg"), tr("General")); // shortcuts m_shortcuts = new ShortcutsWidget(); m_shortcutsTab = new QWidget(); auto* shortcutsLayout = new QVBoxLayout(m_shortcutsTab); m_shortcutsTab->setLayout(shortcutsLayout); shortcutsLayout->addWidget(m_shortcuts); m_tabWidget->addTab( m_shortcutsTab, QIcon(modifier + "shortcut.svg"), tr("Shortcuts")); // connect update sigslots connect(this, &ConfigWindow::updateChildren, m_filenameEditor, &FileNameEditor::updateComponents); connect(this, &ConfigWindow::updateChildren, m_visuals, &VisualsEditor::updateComponents); connect(this, &ConfigWindow::updateChildren, m_generalConfig, &GeneralConf::updateComponents); // Error indicator (this must come last) initErrorIndicator(m_visualsTab, m_visuals); initErrorIndicator(m_filenameEditorTab, m_filenameEditor); initErrorIndicator(m_generalConfigTab, m_generalConfig); initErrorIndicator(m_shortcutsTab, m_shortcuts); } ``` -------------------------------- ### Get Flameshot Version Source: https://flameshot.org/docs/guide/issue-reporting Run this command to check your installed Flameshot version. This is often the first piece of information needed for bug reports. ```bash flameshot --version ``` -------------------------------- ### Set Uploader Plugin and Initialize Source: https://flameshot.org/docs/dev/flameshot/imguploadermanager_8cpp_source Sets the image uploader plugin and re-initializes the manager. It then returns a new uploader instance, potentially with a default QPixmap. ```cpp ImgUploaderBase* ImgUploaderManager::uploader(const QString& imgUploaderPlugin) { m_imgUploaderPlugin = imgUploaderPlugin; init(); return uploader(QPixmap()); } ``` -------------------------------- ### Start Color Grabbing Source: https://flameshot.org/docs/dev/flameshot/colorgrabwidget_8cpp_source Initiates the color grabbing process by setting the cursor to a crosshair, installing an event filter, and displaying key mapping instructions. ```cpp void ColorGrabWidget::startGrabbing() { // NOTE: grabMouse() would prevent move events being received // With this method we just need to make sure that mouse press and release // events get consumed before they reach their target widget. // This is undone in the destructor. qApp->setOverrideCursor(Qt::CrossCursor); qApp->installEventFilter(this); OverlayMessage::pushKeyMap( { { tr("Enter or Left Click"), tr("Accept color") }, { tr("Hold Left Click"), tr("Precisely select color") }, { tr("Space or Right Click"), tr("Toggle magnifier") }, { tr("Esc"), tr("Cancel") } }); } ``` -------------------------------- ### Install Flameshot via Flatpak Source: https://flameshot.org/docs/installation/installation-linux Use this command to install Flameshot from Flathub when it becomes available. Currently, it installs from the GitHub release. ```bash flatpak install flathub org.flameshot.Flameshot ``` -------------------------------- ### Initialize QCoreApplication and Configure Flameshot Source: https://flameshot.org/docs/dev/flameshot/main_8cpp_source Sets up the core application and configures Flameshot, likely for non-GUI operations or initial setup. ```cpp new QCoreApplication(argc, argv); configureApp(false); ``` -------------------------------- ### Initialize Configuration Buttons Source: https://flameshot.org/docs/dev/flameshot/generalconf_8cpp_source Sets up the UI for configuration file management, including export, import, and reset buttons. ```cpp void GeneralConf::initConfigButtons() { auto* buttonLayout = new QHBoxLayout(); auto* box = new QGroupBox(tr("Configuration File")); box->setFlat(true); box->setLayout(buttonLayout); m_layout->addWidget(box); m_exportButton = new QPushButton(tr("Export")); buttonLayout->addWidget(m_exportButton); connect(m_exportButton, &QPushButton::clicked, this, &GeneralConf::exportFileConfiguration); m_importButton = new QPushButton(tr("Import")); buttonLayout->addWidget(m_importButton); connect(m_importButton, &QPushButton::clicked, this, &GeneralConf::importConfiguration); m_resetButton = new QPushButton(tr("Reset")); buttonLayout->addWidget(m_resetButton); connect(m_resetButton, &QPushButton::clicked, this, &GeneralConf::resetConfiguration); } ``` -------------------------------- ### Install Flameshot using Chocolatey Source: https://flameshot.org/docs/installation/installation-windows Install Flameshot using the Chocolatey package manager. This command installs Flameshot from the Chocolatey repository. ```bash choco install flameshot ``` -------------------------------- ### Main Application Entry Point Source: https://flameshot.org/docs/dev/flameshot/main_8cpp_source The main function initializes the application, sets up single-instance locking, configures translations, and starts the GUI or prepares for CLI argument processing. It handles both GUI launch and D-Bus registration on Linux. ```cpp int main(int argc, char* argv[]) { #ifdef Q_OS_LINUX wayland_hacks(); #endif // required for the button serialization // TODO: change to QVector in v1.0 qRegisterMetaTypeStreamOperators>("QList"); QCoreApplication::setApplicationVersion(APP_VERSION); QCoreApplication::setApplicationName(QStringLiteral("flameshot")); QCoreApplication::setOrganizationName(QStringLiteral("flameshot")); // no arguments, just launch Flameshot if (argc == 1) { #ifndef USE_EXTERNAL_SINGLEAPPLICATION SingleApplication app(argc, argv); #else QtSingleApplication app(argc, argv); #endif configureApp(true); auto c = Flameshot::instance(); FlameshotDaemon::start(); #if !(defined(Q_OS_MACOS) || defined(Q_OS_WIN)) new FlameshotDBusAdapter(c); QDBusConnection dbus = QDBusConnection::sessionBus(); if (!dbus.isConnected()) { AbstractLogger::error() << QObject::tr("Unable to connect via DBus"); } dbus.registerObject(QStringLiteral("/"), c); dbus.registerService(QStringLiteral("org.flameshot.Flameshot")); #endif return qApp->exec(); } #if !defined(Q_OS_WIN) /*--------------| * CLI parsing | * ------------*/ ``` -------------------------------- ### Install Flameshot using Winget Source: https://flameshot.org/docs/installation/installation-windows Use Winget to install the stable version of Flameshot. This is a command-line utility for installing applications on Windows. ```bash winget install flameshot ``` -------------------------------- ### Initialize Help Message Source: https://flameshot.org/docs/dev/flameshot/capturewidget_8cpp_source Compiles and initializes the help message displayed to the user, including key bindings and tool descriptions. ```cpp void CaptureWidget::initHelpMessage() { QList> keyMap; keyMap << QPair(tr("Mouse"), tr("Select screenshot area")); using CT = CaptureTool; for (auto toolType : { CT::TYPE_ACCEPT, CT::TYPE_SAVE, CT::TYPE_COPY }) { if (!m_tools.contains(toolType)) { continue; } auto* tool = m_tools[toolType]; QString shortcut = ConfigHandler().shortcut(QVariant::fromValue(toolType).toString()); shortcut.replace("Return", "Enter"); if (!shortcut.isEmpty()) { keyMap << QPair(shortcut, tool->description()); } } keyMap << QPair(tr("Mouse Wheel"), tr("Change tool size")); keyMap << QPair(tr("Right Click"), tr("Show color picker")); keyMap << QPair(ConfigHandler().shortcut("TYPE_TOGGLE_PANEL"), tr("Open side panel")); keyMap << QPair(tr("Esc"), tr("Exit")); m_helpMessage = OverlayMessage::compileFromKeyMap(keyMap); } ``` -------------------------------- ### startupLaunch Source: https://flameshot.org/docs/dev/flameshot/classConfigHandler Checks if the application is configured to launch on startup. ```APIDOC ## startupLaunch ### Signature ```cpp bool ConfigHandler::startupLaunch () ``` ``` -------------------------------- ### Start LoadSpinner Animation Source: https://flameshot.org/docs/dev/flameshot/classLoadSpinner Starts the loading animation of the spinner. ```cpp void LoadSpinner::start () ``` -------------------------------- ### Initialize Main Editor Widgets Source: https://flameshot.org/docs/dev/flameshot/visualseditor_8cpp_source Sets up the tab widget, UI color editor, color picker editor, and button selection group. It also initializes the opacity slider and connects the 'Select All' button to the button list view. ```cpp void VisualsEditor::initWidgets() { m_tabWidget = new QTabWidget(); m_layout->addWidget(m_tabWidget); m_colorEditor = new UIcolorEditor(); m_colorEditorTab = new QWidget(); auto* colorEditorLayout = new QVBoxLayout(m_colorEditorTab); m_colorEditorTab->setLayout(colorEditorLayout); colorEditorLayout->addWidget(m_colorEditor); m_tabWidget->addTab(m_colorEditorTab, tr("UI Color Editor")); m_colorpickerEditor = new ColorPickerEditor(); m_colorpickerEditorTab = new QWidget(); auto* colorpickerEditorLayout = new QVBoxLayout(m_colorpickerEditorTab); colorpickerEditorLayout->addWidget(m_colorpickerEditor); m_tabWidget->addTab(m_colorpickerEditorTab, tr("Colorpicker Editor")); initOpacitySlider(); auto* boxButtons = new QGroupBox(); boxButtons->setTitle(tr("Button Selection")); auto* listLayout = new QVBoxLayout(boxButtons); m_buttonList = new ButtonListView(); m_layout->addWidget(boxButtons); listLayout->addWidget(m_buttonList); auto* setAllButtons = new QPushButton(tr("Select All")); connect(setAllButtons, &QPushButton::clicked, m_buttonList, &ButtonListView::selectAll); listLayout->addWidget(setAllButtons); } ``` -------------------------------- ### Define Version and Help Options Source: https://flameshot.org/docs/dev/flameshot/commandlineparser_8cpp_source Defines the command line options for displaying version and help information. These are typically short-cased ('v', 'h') and long-cased ('version', 'help'). ```cpp auto versionOption = CommandOption({ "v", "version" }, QStringLiteral("Displays version information")); auto helpOption = CommandOption({ "h", "help" }, QStringLiteral("Displays this help")); ``` -------------------------------- ### Starting a New Drawing Object Tool Source: https://flameshot.org/docs/dev/flameshot/capturewidget_8cpp_source Initiates drawing a new object tool, provided the active tool type is not NONE or MOVE_SELECTION. It commits the current tool if necessary, creates a copy of the new tool, connects signals for color and size changes, and starts the drawing process. ```cpp bool CaptureWidget::startDrawObjectTool(const QPoint& pos) { if (activeButtonToolType() != CaptureTool::NONE && activeButtonToolType() != CaptureTool::TYPE_MOVESELECTION) { if (commitCurrentTool()) { return false; } m_activeTool = m_activeButton->tool()->copy(this); connect(this, &CaptureWidget::colorChanged, m_activeTool, &CaptureTool::onColorChanged); connect(this, &CaptureWidget::toolSizeChanged, m_activeTool, &CaptureTool::onSizeChanged); connect(m_activeTool, &CaptureTool::requestAction, this, &CaptureWidget::handleToolSignal); m_context.mousePos = m_displayGrid ? snapToGrid(pos) : pos; m_activeTool->drawStart(m_context); // TODO this is the wrong place to do this if (m_activeTool->type() == CaptureTool::TYPE_CIRCLECOUNT) { m_activeTool->setCount(m_context.circleCount++); } return true; } return false; } ``` -------------------------------- ### Initialize Context Menu Actions Source: https://flameshot.org/docs/dev/flameshot/trayicon_8cpp_source Sets up the context menu for the tray icon, including actions for taking a screenshot, opening the launcher, configuration, about dialog, checking for updates, and quitting the application. Includes platform-specific delays for macOS. ```cpp void TrayIcon::initMenu() { m_menu = new QMenu(); auto* captureAction = new QAction(tr("&Take Screenshot"), this); connect(captureAction, &QAction::triggered, this, [this]() { #if defined(Q_OS_MACOS) auto currentMacOsVersion = QOperatingSystemVersion::current(); if (currentMacOsVersion >= currentMacOsVersion.MacOSBigSur) { startGuiCapture(); } else { // It seems it is not relevant for MacOS BigSur (Wait 400 ms to hide // the QMenu) QTimer::singleShot(400, this, [this]() { startGuiCapture(); }); } #else // Wait 400 ms to hide the QMenu QTimer::singleShot(400, this, [this]() { startGuiCapture(); }); #endif }); auto* launcherAction = new QAction(tr("&Open Launcher"), this); connect(launcherAction, &QAction::triggered, Flameshot::instance(), &Flameshot::launcher); auto* configAction = new QAction(tr("&Configuration"), this); connect(configAction, &QAction::triggered, Flameshot::instance(), &Flameshot::config); auto* infoAction = new QAction(tr("&About"), this); connect( infoAction, &QAction::triggered, Flameshot::instance(), &Flameshot::info); #if !defined(DISABLE_UPDATE_CHECKER) m_appUpdates = new QAction(tr("Check for updates"), this); connect(m_appUpdates, &QAction::triggered, FlameshotDaemon::instance(), &FlameshotDaemon::checkForUpdates); connect(FlameshotDaemon::instance(), &FlameshotDaemon::newVersionAvailable, this, [this](const QVersionNumber& version) { QString newVersion = tr("New version %1 is available").arg(version.toString()); m_appUpdates->setText(newVersion); }); #endif QAction* quitAction = new QAction(tr("&Quit"), this); connect(quitAction, &QAction::triggered, qApp, &QCoreApplication::quit); // recent screenshots QAction* recentAction = new QAction(tr("&Latest Uploads"), this); connect(recentAction, &QAction::triggered, Flameshot::instance(), &Flameshot::history); auto* openSavePathAction = new QAction(tr("&Open Save Path"), this); ``` -------------------------------- ### Install Flameshot on NixOS Source: https://flameshot.org/docs/installation/installation-linux Use nix-env to install Flameshot on NixOS. ```bash nix-env --install --attr nixos.flameshot ``` -------------------------------- ### Config Window UI Setup and Signal-Slot Connections Source: https://flameshot.org/docs/dev/flameshot/configwindow_8cpp_source Sets up the layout for the configuration window, including adding widgets and layouts. It also establishes connections for error reporting and resolution, and for triggering the configuration resolver. ```cpp if (layout != nullptr) { layout->insertWidget(0, label); layout->insertLayout(1, btnLayout); } else { widget->layout()->addWidget(label); widget->layout()->addWidget(btnResolve); } // Sigslots connect(ConfigHandler::getInstance(), &ConfigHandler::error, widget, [=]() { widget->setEnabled(false); label->show(); btnResolve->show(); }); connect(ConfigHandler::getInstance(), &ConfigHandler::errorResolved, widget, [=]() { widget->setEnabled(true); label->hide(); btnResolve->hide(); }); connect(btnResolve, &QPushButton::clicked, this, [this]() { ConfigResolver().exec(); }); } ``` -------------------------------- ### Install Flameshot on Fedora Source: https://flameshot.org/docs/installation/installation-linux Use dnf to install Flameshot on Fedora. ```bash dnf install flameshot ``` -------------------------------- ### Initialize Autostart Source: https://flameshot.org/docs/dev/flameshot/generalconf_8cpp_source Sets up a checkbox to enable or disable launching the Flameshot daemon at system startup. ```cpp void GeneralConf::initAutostart() { m_autostart = new QCheckBox(tr("Launch in background at startup"), this); m_autostart->setToolTip(tr( "Launch Flameshot daemon (background process) when computer is booted")); m_scrollAreaLayout->addWidget(m_autostart); connect( m_autostart, &QCheckBox::clicked, this, &GeneralConf::autostartChanged); } ``` -------------------------------- ### DesktopInfo Constructor Source: https://flameshot.org/docs/dev/flameshot/classDesktopInfo Initializes a new instance of the DesktopInfo class. ```APIDOC ## DesktopInfo() ### Description Constructs a DesktopInfo object. ### Method DesktopInfo ### Parameters None ### Response None ``` -------------------------------- ### Install Flameshot with Homebrew Source: https://flameshot.org/docs/installation/installation-osx Use this command to install Flameshot if you are using Homebrew as your package manager. Note that you may need to manually grant permissions after installation due to macOS security features. ```bash brew install --cask flameshot ``` -------------------------------- ### Create and Navigate to Source Directory Source: https://flameshot.org/docs/installation/source-code Creates a temporary directory for downloading and compiling Flameshot, then navigates into it. ```bash # create the folder mkdir --parents ~/tmp/flameshot_source/ # go inside the new foldr cd ~/tmp/flameshot_source/ ``` -------------------------------- ### Initialize Imgur Client ID Configuration Source: https://flameshot.org/docs/dev/flameshot/generalconf_8cpp_source Sets up the UI for configuring the Imgur application client ID. ```cpp void GeneralConf::initUploadClientSecret() { auto* box = new QGroupBox(tr("Imgur Application Client ID")); box->setFlat(true); m_layout->addWidget(box); auto* vboxLayout = new QVBoxLayout(); box->setLayout(vboxLayout); m_uploadClientKey = new QLineEdit(this); QString foreground = this->palette().windowText().color().name(); m_uploadClientKey->setStyleSheet( QStringLiteral("color: %1").arg(foreground)); m_uploadClientKey->setText(ConfigHandler().uploadClientSecret()); connect(m_uploadClientKey, &QLineEdit::editingFinished, this, &GeneralConf::uploadClientKeyEdited); vboxLayout->addWidget(m_uploadClientKey); } ``` -------------------------------- ### Install Fedora Compilation Dependencies Source: https://flameshot.org/docs/installation/source-code Installs the necessary packages for compiling Flameshot on Fedora. ```bash dnf install gcc-c++ cmake qt6-qtbase-devel qt6-qtsvg-devel qt6-qttools qt6-linguist qt6-qttools-devel kf6-kguiaddons-devel ``` -------------------------------- ### Initialize Command Line Parser Source: https://flameshot.org/docs/dev/flameshot/commandlineparser_8cpp_source Constructor for CommandLineParser. Initializes the description with the application name. ```cpp CommandLineParser::CommandLineParser() : m_description(qApp->applicationName()) {} ``` -------------------------------- ### ImgurUploader Constructor Source: https://flameshot.org/docs/dev/flameshot/imguruploader_8cpp_source Initializes the QNetworkAccessManager and connects its finished signal to the handleReply slot. ```cpp ImgurUploader::ImgurUploader(const QPixmap& capture, QWidget* parent) : ImgUploaderBase(capture, parent) { m_NetworkAM = new QNetworkAccessManager(this); connect(m_NetworkAM, &QNetworkAccessManager::finished, this, &ImgurUploader::handleReply); } ``` -------------------------------- ### Initialize Shortcuts Widget Source: https://flameshot.org/docs/dev/flameshot/shortcutswidget_8cpp_source Sets up the main window attributes, icon, title, and initial layout for the ShortcutsWidget. It also centers the widget on the current screen and connects to configuration changes to update the shortcut table. ```cpp #include "shortcutswidget.h" #include "capturetool.h" #include "setshortcutwidget.h" #include "src/core/qguiappcurrentscreen.h" #include "src/utils/globalvalues.h" #include "toolfactory.h" #include #include #include #include #include #include #include #include #if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)) #include #include #include #endif ShortcutsWidget::ShortcutsWidget(QWidget* parent) : QWidget(parent) { setAttribute(Qt::WA_DeleteOnClose); setWindowIcon(QIcon(GlobalValues::iconPath())); setWindowTitle(tr("Hot Keys")); #if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)) QRect position = frameGeometry(); QScreen* screen = QGuiAppCurrentScreen().currentScreen(); position.moveCenter(screen->availableGeometry().center()); move(position.topLeft()); #endif m_layout = new QVBoxLayout(this); m_layout->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter); initInfoTable(); connect(ConfigHandler::getInstance(), &ConfigHandler::fileChanged, this, &ShortcutsWidget::populateInfoTable); show(); } ``` -------------------------------- ### Install Flameshot on Debian/Ubuntu Source: https://flameshot.org/docs/installation/installation-linux Use apt to install Flameshot on Debian 10+ and Ubuntu 18.04+. ```bash apt install flameshot ``` -------------------------------- ### Install Arch Compilation Dependencies Source: https://flameshot.org/docs/installation/source-code Installs the required packages for compiling Flameshot on Arch Linux. ```bash pacman -S cmake base-devel git qt6-base qt6-tools kguiaddons ``` -------------------------------- ### InfoWindow Constructor Source: https://flameshot.org/docs/dev/flameshot/infowindow_8cpp_source Initializes the InfoWindow, sets attributes, loads UI elements, and positions the window on the current screen. Requires Qt 5.10.0 or later for screen positioning. ```cpp #include "infowindow.h" #include "./ui_infowindow.h" #include "src/core/flameshotdaemon.h" #include "src/core/qguiappcurrentscreen.h" #include "src/utils/globalvalues.h" #include #include InfoWindow::InfoWindow(QWidget* parent) : QWidget(parent) , ui(new Ui::InfoWindow) { ui->setupUi(this); setAttribute(Qt::WA_DeleteOnClose); ui->IconSVG->setPixmap(QPixmap(GlobalValues::iconPath())); ui->VersionDetails->setText(GlobalValues::versionInfo()); ui->OperatingSystemDetails->setText(generateKernelString()); #if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)) QRect position = frameGeometry(); QScreen* screen = QGuiAppCurrentScreen().currentScreen(); position.moveCenter(screen->availableGeometry().center()); move(position.topLeft()); #endif show(); } InfoWindow::~InfoWindow() { delete ui; } ``` -------------------------------- ### Show Configuration Window Source: https://flameshot.org/docs/dev/flameshot/flameshot_8cpp_source Initializes and shows the configuration window if it hasn't been created yet. Ensures the window is activated and raised on macOS. ```cpp if (m_configWindow == nullptr) { m_configWindow = new ConfigWindow(); m_configWindow->show(); #if defined(Q_OS_MACOS) m_configWindow->activateWindow(); m_configWindow->raise(); #endif } ``` -------------------------------- ### Install Flameshot with MacPorts Source: https://flameshot.org/docs/installation/installation-osx Use this command to install Flameshot if you are using MacPorts as your package manager. ```bash sudo port selfupdate && sudo port install flameshot ``` -------------------------------- ### ConfigHandler::setShowStartupLaunchMessage Source: https://flameshot.org/docs/dev/flameshot/classConfigHandler Sets the state for showing the startup launch message. ```APIDOC ## setShowStartupLaunchMessage ### Description Sets the state for showing the startup launch message. ### Method Setter ### Parameters - **showStartupLaunchMessage** (bool) - Description not available ``` -------------------------------- ### DesktopInfo Constructor Source: https://flameshot.org/docs/dev/flameshot/classDesktopInfo Initializes a new instance of the DesktopInfo class. ```cpp DesktopInfo::DesktopInfo () ``` -------------------------------- ### Install Sway/Wayland Dependencies on Arch Source: https://flameshot.org/docs/installation/source-code Installs packages required for Wayland support on Sway, including xdg-desktop-portal and grim. ```bash pacman -S xdg-desktop-portal xdg-desktop-portal-wlr grim ``` -------------------------------- ### Initialize Undo Limit Configuration Source: https://flameshot.org/docs/dev/flameshot/generalconf_8cpp_source Sets up the UI for configuring the undo limit. ```cpp void GeneralConf::initUndoLimit() { auto* box = new QGroupBox(tr("Undo limit")); box->setFlat(true); m_layout->addWidget(box); auto* vboxLayout = new QVBoxLayout(); box->setLayout(vboxLayout); m_undoLimit = new QSpinBox(this); m_undoLimit->setMinimum(1); m_undoLimit->setMaximum(999); QString foreground = this->palette().windowText().color().name(); m_undoLimit->setStyleSheet(QStringLiteral("color: %1").arg(foreground)); connect(m_undoLimit, static_cast(&QSpinBox::valueChanged), this, &GeneralConf::undoLimit); vboxLayout->addWidget(m_undoLimit); } ``` -------------------------------- ### Install Debian/Ubuntu Compilation Dependencies Source: https://flameshot.org/docs/installation/source-code Installs the required packages for compiling Flameshot on Debian-based systems like Ubuntu. ```bash apt install g++ cmake build-essential qt6-base-dev qt6-tools-dev-tools qt6-svg-dev qt6-tools-dev ``` -------------------------------- ### Generate Makefile for /usr Installation Source: https://flameshot.org/docs/installation/source-code Generates a Makefile for installation into the /usr directory instead of the default /usr/local, by setting the CMAKE_INSTALL_PREFIX. ```bash cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr ``` -------------------------------- ### Initialize Help Message Source: https://flameshot.org/docs/dev/flameshot/capturewidget_8cpp_source Initializes the help message if configured to show help. It creates an `OverlayMessage` instance and pushes it onto the overlay stack. ```cpp if (m_config.showHelp()) { initHelpMessage(); OverlayMessage::push(m_helpMessage); } ``` -------------------------------- ### Start Daemon Source: https://flameshot.org/docs/dev/flameshot/classFlameshotDaemon Starts the Flameshot daemon process. This function is typically called internally when the daemon instance is first requested. ```cpp static void FlameshotDaemon::start () ``` -------------------------------- ### Install Flameshot via Snap Source: https://flameshot.org/docs/installation/installation-linux Placeholder command for installing Flameshot using snap. Note: Flameshot is not currently available on snap. ```bash snap install flameshot ``` -------------------------------- ### WaylandUtils Constructor Source: https://flameshot.org/docs/dev/flameshot/classWaylandUtils Initializes a new instance of the WaylandUtils class. No specific setup is required beyond class instantiation. ```cpp WaylandUtils::WaylandUtils () ``` -------------------------------- ### setStartupLaunch Source: https://flameshot.org/docs/dev/flameshot/classConfigHandler Configures whether the application should launch on startup. ```APIDOC ## setStartupLaunch ### Signature ```cpp void ConfigHandler::setStartupLaunch (const bool start) ``` ### Parameters * `start` (const bool) - True to enable startup launch, false otherwise. ``` -------------------------------- ### Install Flameshot on Arch Linux Source: https://flameshot.org/docs/installation/installation-linux Use pacman to install Flameshot on Arch Linux. For the latest development version, consider the AUR package. ```bash pacman --sync flameshot ``` -------------------------------- ### CaptureLauncher Constructor Source: https://flameshot.org/docs/dev/flameshot/classCaptureLauncher Initializes a new instance of the CaptureLauncher class. Accepts an optional parent QDialog. ```cpp explicit CaptureLauncher::CaptureLauncher ( QDialog * parent=nullptr ) ``` -------------------------------- ### AppLauncher Constructor Source: https://flameshot.org/docs/dev/flameshot/classAppLauncher Initializes a new instance of the AppLauncher class. It accepts an optional QObject parent. ```cpp explicit AppLauncher::AppLauncher ( QObject * parent=nullptr ) ``` -------------------------------- ### PencilTool Draw Start Initialization Source: https://flameshot.org/docs/dev/flameshot/penciltool_8cpp_source Initializes drawing parameters when the pencil tool interaction starts, including color, size, and the first point. ```cpp void PencilTool::drawStart(const CaptureContext& context) { m_color = context.color; onSizeChanged(context.toolSize); m_points.append(context.mousePos); m_pathArea.setTopLeft(context.mousePos); m_pathArea.setBottomRight(context.mousePos); } ``` -------------------------------- ### Install Specific Flameshot Version via Flatpak Source: https://flameshot.org/docs/installation/installation-linux Install a specific version of Flameshot, such as v0.9.0, directly from its GitHub release URL using Flatpak. ```bash flatpak install https://github.com/flameshot-org/flameshot/releases/download/v0.9.0/org.flameshot.Flameshot-0.9.0.x86_64.flatpak ``` -------------------------------- ### Install Flameshot to Custom Directory Source: https://flameshot.org/docs/installation/source-code Installs Flameshot to a custom directory (e.g., ~/myBuilds/test) by specifying the BASEDIR variable during the CMake configuration and build process. ```bash cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr BASEDIR=~/myBuilds/test && make install ``` -------------------------------- ### AppLauncher Constructor Source: https://flameshot.org/docs/dev/flameshot/classAppLauncher Initializes a new instance of the AppLauncher class. It takes an optional QObject parent. ```APIDOC ## AppLauncher Constructor ### Description Initializes a new instance of the AppLauncher class. ### Parameters - **parent** (QObject *) - Optional - The parent object. ``` -------------------------------- ### Animate Widget Appearance Source: https://flameshot.org/docs/dev/flameshot/notificationwidget_8cpp_source Configures and starts the animation to show the notification widget by expanding its height. Also starts the timer to trigger hiding the widget. ```cpp void NotificationWidget::animatedShow() { m_showAnimation->setStartValue(QRect(0, 0, width(), 0)); m_showAnimation->setEndValue(QRect(0, 0, width(), height())); m_showAnimation->start(); m_timer->start(); } ``` -------------------------------- ### ConfigHandler Constructor and File Watching Source: https://flameshot.org/docs/dev/flameshot/confighandler_8cpp_source Initializes the ConfigHandler by setting up QSettings and a QFileSystemWatcher to monitor configuration file changes. Ensures the configuration file is being watched for modifications. ```cpp ConfigHandler::ConfigHandler() : m_settings(QSettings::IniFormat, QSettings::UserScope, qApp->organizationName(), qApp->applicationName()) { static bool firstInitialization = true; if (firstInitialization) { // check for error every time the file changes m_configWatcher.reset(new QFileSystemWatcher()); ensureFileWatched(); QObject::connect(m_configWatcher.data(), &QFileSystemWatcher::fileChanged, ``` -------------------------------- ### showOpenWithMenu Source: https://flameshot.org/docs/dev/flameshot/openwithprogram_8h Displays a menu to the user allowing them to select a program to open the given QPixmap capture with. ```APIDOC ## showOpenWithMenu ### Description Displays a menu to the user allowing them to select a program to open the given QPixmap capture with. ### Signature ```cpp void showOpenWithMenu( const QPixmap & capture ) ``` ### Parameters #### Path Parameters - **capture** (const QPixmap &) - The pixmap to be opened. ``` -------------------------------- ### Get Base Name of a Key Source: https://flameshot.org/docs/dev/flameshot/confighandler_8cpp_source Extracts the base name from a given key using QFileInfo. This is typically used to get the filename without its extension. ```cpp QString ConfigHandler::baseName(const QString& key) const { return QFileInfo(key).baseName(); } ``` -------------------------------- ### Make Widget a Child and Install Event Filter Source: https://flameshot.org/docs/dev/flameshot/capturewidget_8cpp_source Sets the parent of a given QWidget to the CaptureWidget and installs an event filter on it. This is used for managing child widgets and their events. ```cpp void CaptureWidget::makeChild(QWidget* w) { w->setParent(this); w->installEventFilter(m_eventFilter); } ``` -------------------------------- ### Initialize Show Startup Launch Message Source: https://flameshot.org/docs/dev/flameshot/generalconf_8cpp_source Configures a checkbox to control the display of a welcome message when Flameshot launches. ```cpp void GeneralConf::initShowStartupLaunchMessage() { m_showStartupLaunchMessage = new QCheckBox(tr("Show welcome message on launch"), this); ConfigHandler config; m_showStartupLaunchMessage->setToolTip( tr("Show the welcome message box in the middle of the screen while " "taking a screenshot")); m_scrollAreaLayout->addWidget(m_showStartupLaunchMessage); connect(m_showStartupLaunchMessage, &QCheckBox::clicked, [](bool checked) { ConfigHandler().setShowStartupLaunchMessage(checked); }); } ``` -------------------------------- ### Handle Mouse Press for Drag Start Source: https://flameshot.org/docs/dev/flameshot/imagelabel_8cpp_source Records the starting position of a drag operation when the left mouse button is pressed. Sets the cursor to indicate a closed hand. ```cpp // drag handlers void ImageLabel::mousePressEvent(QMouseEvent* event) { if (event->button() == Qt::LeftButton) { m_dragStartPosition = event->pos(); setCursor(Qt::ClosedHandCursor); } } ``` -------------------------------- ### CommandOption Constructor (multiple names) Source: https://flameshot.org/docs/dev/flameshot/classCommandOption Initializes a CommandOption with a list of names, description, optional value name, and default value. ```cpp CommandOption::CommandOption ( QStringList names, QString description, QString valueName=QString(), QString defaultValue=QString() ) ``` -------------------------------- ### DesktopFileParser Constructor Source: https://flameshot.org/docs/dev/flameshot/desktopfileparse_8cpp_source Initializes locale-specific names and descriptions for parsing. Sets a default icon theme. ```cpp #include "desktopfileparse.h" #include #include #include #include #include DesktopFileParser::DesktopFileParser() { QString locale = QLocale().name(); QString localeShort = QLocale().name().left(2); m_localeName = QStringLiteral("Name[%1]").arg(locale); m_localeDescription = QStringLiteral("Comment[%1]").arg(locale); m_localeNameShort = QStringLiteral("Name[%1]").arg(localeShort); m_localeDescriptionShort = QStringLiteral("Comment[%1]").arg(localeShort); m_defaultIcon = QIcon::fromTheme(QStringLiteral("application-x-executable")); } ``` -------------------------------- ### Start Color Grabbing in SidePanelWidget Source: https://flameshot.org/docs/dev/flameshot/sidepanelwidget_8cpp_source Initiates the color grabbing process by creating a ColorGrabWidget, connecting its signals, and starting the grabbing action. This method is used when the user wants to pick a color from the screen. ```cpp void SidePanelWidget::startColorGrab() { m_revertColor = m_color; m_colorGrabber = new ColorGrabWidget(m_pixmap); connect(m_colorGrabber, &ColorGrabWidget::colorUpdated, this, &SidePanelWidget::onTemporaryColorUpdated); connect(m_colorGrabber, &ColorGrabWidget::colorGrabbed, this, &SidePanelWidget::onColorGrabFinished); connect(m_colorGrabber, &ColorGrabWidget::grabAborted, this, &SidePanelWidget::onColorGrabAborted); emit togglePanel(); m_colorGrabber->startGrabbing(); } ```