FinceptTerminal is a modern finance application offering advanced market analytics, investment research, and economic data tools, designed for interactive exploration and data-driven decision-making in a user-friendly environment.
C++ ai-agentsalgorithmic-tradingbloomberg-terminalcppfinancefinancial-marketsfintechgood-first-issueinvestmentinvestment-researchmachine-learningopensourcepythonqtquantitative-financestock-markettrading
#pragma once
// MonitorPickerDialog — visual monitor map shown when the user requests a
// new window on a multi-monitor system. The dialog draws each connected
// QScreen as a scaled rectangle (preserving the virtual-desktop layout) and
// lets the user click the monitor where the new window should appear.
//
// Use MonitorPickerDialog::pick() instead of constructing directly — it
// short-circuits the dialog when only one monitor is connected.
#include <QDialog>
#include <QEvent>
class QLabel;
class QScreen;
class QWidget;
namespace fincept {
class MonitorPickerDialog : public QDialog {
Q_OBJECT
public:
explicit MonitorPickerDialog(QWidget* parent, QScreen* current);
QScreen* picked_screen() const { return picked_; }
/// Returns the chosen screen, or nullptr if the user cancelled. If only
/// a single monitor is connected the dialog is skipped and that monitor
/// is returned directly. `current` is visually highlighted as "the
/// monitor the request came from" (purely a cue — does not pre-select).
static QScreen* pick(QWidget* parent, QScreen* current);
protected:
void changeEvent(QEvent* event) override;
private:
void retranslateUi();
QScreen* picked_ = nullptr;
QLabel* title_label_ = nullptr;
QLabel* hint_label_ = nullptr;
QWidget* map_widget_ = nullptr;
};
} // namespace fincept