wiRedPanda
Home
About
Download
Try out
API Docs
wiRedPanda
Logic Circuit Simulator
Loading...
Searching...
No Matches
ICPreviewPopup.h
Go to the documentation of this file.
1
// Copyright 2015 - 2026, GIBIS-UNIFESP and the wiRedPanda contributors
2
// SPDX-License-Identifier: GPL-3.0-or-later
3
7
8
#pragma once
9
10
#include <QLabel>
11
#include <QPointer>
12
#include <QTimer>
13
#include <QWidget>
14
15
class
IC
;
16
26
class
ICPreviewPopup
:
public
QWidget
27
{
28
Q_OBJECT
29
30
public
:
32
static
constexpr
int
MaxWidth
= 500;
33
static
constexpr
int
MaxHeight
= 350;
34
38
static
constexpr
int
MaxElementCount
= 500;
39
41
explicit
ICPreviewPopup
(QWidget *parent =
nullptr
);
42
46
void
showForIC
(
IC
*ic,
const
QPoint &screenPos);
47
50
void
scheduleHide
();
51
53
void
cancelHide
();
54
58
void
updatePendingPos
(
const
QPoint &screenPos);
59
61
IC
*
pendingIC
()
const
;
62
66
bool
isShowActiveFor
(
const
IC
*ic)
const
;
67
71
static
QPoint
clampedPopupPos
(
const
QPoint &cursorPos,
const
QSize &popupSize,
const
QRect &availableGeometry);
72
73
protected
:
75
void
enterEvent
(QEnterEvent *event)
override
;
76
78
void
leaveEvent
(QEvent *event)
override
;
79
80
private
:
81
void
executeShow();
82
83
QLabel *m_titleLabel;
84
QLabel *m_imageLabel;
85
QTimer m_hideTimer;
86
QTimer m_showTimer;
87
QPointer<IC> m_pendingIC;
88
QPoint m_pendingPos;
89
};
ICPreviewPopup::leaveEvent
void leaveEvent(QEvent *event) override
Definition
ICPreviewPopup.cpp:196
ICPreviewPopup::pendingIC
IC * pendingIC() const
Returns the IC currently pending display (may be null).
Definition
ICPreviewPopup.cpp:180
ICPreviewPopup::ICPreviewPopup
ICPreviewPopup(QWidget *parent=nullptr)
Constructs the popup as a frameless, non-activating child of parent.
Definition
ICPreviewPopup.cpp:16
ICPreviewPopup::scheduleHide
void scheduleHide()
Definition
ICPreviewPopup.cpp:161
ICPreviewPopup::isShowActiveFor
bool isShowActiveFor(const IC *ic) const
Definition
ICPreviewPopup.cpp:185
ICPreviewPopup::clampedPopupPos
static QPoint clampedPopupPos(const QPoint &cursorPos, const QSize &popupSize, const QRect &availableGeometry)
Definition
ICPreviewPopup.cpp:149
ICPreviewPopup::MaxWidth
static constexpr int MaxWidth
Maximum preview dimensions in pixels.
Definition
ICPreviewPopup.h:32
ICPreviewPopup::MaxHeight
static constexpr int MaxHeight
Definition
ICPreviewPopup.h:33
ICPreviewPopup::cancelHide
void cancelHide()
Cancels a pending show/hide.
Definition
ICPreviewPopup.cpp:167
ICPreviewPopup::showForIC
void showForIC(IC *ic, const QPoint &screenPos)
Definition
ICPreviewPopup.cpp:78
ICPreviewPopup::MaxElementCount
static constexpr int MaxElementCount
Definition
ICPreviewPopup.h:38
ICPreviewPopup::updatePendingPos
void updatePendingPos(const QPoint &screenPos)
Definition
ICPreviewPopup.cpp:173
ICPreviewPopup::enterEvent
void enterEvent(QEnterEvent *event) override
Definition
ICPreviewPopup.cpp:190
IC
Graphic element representing an Integrated Circuit (sub-circuit) box.
Definition
IC.h:31
App
Element
ICPreviewPopup.h
Generated by
1.16.1