Category Archives: Uncategorized

Qt Popup/Overlay Window

QApplication::activeModalWidget()
A modal widget is a special top-level widget which is a subclass of QDialog that specifies the modal parameter of the constructor as true. A modal widget must be closed before the user can continue with other parts of the program.

QApplication::activePopupWidget()
A popup widget is a special top-level widget that sets the Qt::WType_Popup widget flag, e.g. the QMenu widget. When the application opens a popup widget, all events are sent to the popup. Normal widgets and modal widgets cannot be accessed before the popup widget is closed.


Questions

Custom popup widget
How would I go about making a overlay widget

Code

void QCompleter::setPopup(QAbstractItemView *popup)
{
    Q_D(QCompleter);
    Q_ASSERT(popup != nullptr);
    if (d->popup) {
        QObject::disconnect(d->popup->selectionModel(), nullptr, this, nullptr);
        QObject::disconnect(d->popup, nullptr, this, nullptr);
    }
    if (d->popup != popup)
        delete d->popup;
    if (popup->model() != d->proxy)
        popup->setModel(d->proxy);
     popup->hide();

    Qt::FocusPolicy origPolicy = Qt::NoFocus;
    if (d->widget)
        origPolicy = d->widget->focusPolicy();

    // Mark the widget window as a popup, so that if the last non-popup window is closed by the
    // user, the application should not be prevented from exiting. It needs to be set explicitly via
    // setWindowFlag(), because passing the flag via setParent(parent, windowFlags) does not call
    // QWidgetPrivate::adjustQuitOnCloseAttribute(), and causes an application not to exit if the
    // popup ends up being the last window.
    popup->setParent(nullptr);
    popup->setWindowFlag(Qt::Popup);
    popup->setFocusPolicy(Qt::NoFocus);
    if (d->widget)
        d->widget->setFocusPolicy(origPolicy);

    popup->setFocusProxy(d->widget);
    popup->installEventFilter(this);
    popup->setItemDelegate(new QCompleterItemDelegate(popup));
#if QT_CONFIG(listview)
    if (QListView *listView = qobject_cast<QListView *>(popup)) {
        listView->setModelColumn(d->column);
    }
#endif

    QObject::connect(popup, SIGNAL(clicked(QModelIndex)),
                     this, SLOT(_q_complete(QModelIndex)));
    QObject::connect(this, SIGNAL(activated(QModelIndex)),
                     popup, SLOT(hide()));

    QObject::connect(popup->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
                     this, SLOT(_q_completionSelected(QItemSelection)));
    d->popup = popup;
}

void QCompleterPrivate::showPopup(const QRect& rect)
{
    const QRect screen = QWidgetPrivate::availableScreenGeometry(widget);
    Qt::LayoutDirection dir = widget->layoutDirection();
    QPoint pos;
    int rh, w;
    int h = (popup->sizeHintForRow(0) * qMin(maxVisibleItems, popup->model()->rowCount()) + 3) + 3;
    QScrollBar *hsb = popup->horizontalScrollBar();
    if (hsb && hsb->isVisible())
        h += popup->horizontalScrollBar()->sizeHint().height();

    if (rect.isValid()) {
        rh = rect.height();
        w = rect.width();
        pos = widget->mapToGlobal(dir == Qt::RightToLeft ? rect.bottomRight() : rect.bottomLeft());
    } else {
        rh = widget->height();
        pos = widget->mapToGlobal(QPoint(0, widget->height() - 2));
        w = widget->width();
    }

    if (w > screen.width())
        w = screen.width();
    if ((pos.x() + w) > (screen.x() + screen.width()))
        pos.setX(screen.x() + screen.width() - w);
    if (pos.x() < screen.x())
        pos.setX(screen.x());

    int top = pos.y() - rh - screen.top() + 2;
    int bottom = screen.bottom() - pos.y();
    h = qMax(h, popup->minimumHeight());
    if (h > bottom) {
        h = qMin(qMax(top, bottom), h);

        if (top > bottom)
            pos.setY(pos.y() - h - rh + 2);
    }

    popup->setGeometry(pos.x(), pos.y(), w, h);

    if (!popup->isVisible())
        popup->show();
}

Transparent/Alpha Background

QDialog with transparent background color
How not to lose the alpha channel


QML

Documentation

Qt 5.15 – Qt Quick Controls – Popup Controls

Questions

Popup item loses opaquness
how to set popup background color to transparent
Change popup background to transparent

TonieBox

Tonies

Shop

Toniebox

Wikipedia

Toniebox

YouTube

Toniebox Alternative – Toniebox vs. Tigerbox, Hörbert und Jooki

GitHub

github.com/toniebox-reverse-engineering/toniebox-pcb

Nachbau

Bauanleitungen

Wir bauen eine JukeBox für Kinder als Alternative zur Toniebox…
TonUINO
Phoniebox Bauanleitung, Schritt für Schritt zur einzigartigen Toniebox Alternative
An RFID Music Box Fit For A Child

YouTube

Toniebox Nachbau selbst bauen – Phoniebox / RFID Musikbox für Kinder including @Spotify
DIY Kindermusikbox | #4 – Die fertige Box mit Spotify, RFID etc. (Deutsch / German)

GitHub

github.com/biologist79/Tonuino-ESP32-I2S
github.com/CKUL/TonUINO-ESP32
github.com/tfry-git/ClosedPlayer
github.com/SciLor/TonUINO-Mod

Qt Widgets for Technical Applications

Qwt – Qt Widgets for Technical Applications
QwtPolar – A Qwt/Qt Polar Plot Library
QwtPlot3D – 3D-widgets for programmer
QCustomPlot – Qt Plotting Widget QCustomPlot
Qt Charts

Qt Charts

Qt Charts Examples
AreaChart Example
Multiple Axes Example

Qwt vs. Qt Charts

What are the advantages/disadvantages of QCustomPlot, compared to Qwt?
Best charting library to work with Qt?

Qwt

Qwt – Qt Widgets for Technical Applications Documentation
What’s new in Qwt 6.2
Das Qwt (Hand-)Buch

Python

github.com/PierreRaybaut/PythonQwt, Qt plotting widgets for Python (pure Python reimplementation of Qwt C++ library)
PythonQwt: Qt plotting widgets for Python

Aseptuva – The shield against hospital infections

  • Eashan Saikia
  • Henry Twerenbold
  • Rafael Souza Lima

Aseptuva
Aseptuva, ein RUNWAY-Startup, erhält Unterstützung durch das Venture-Kick-Programm

Ushio Care222
Performance test for virus inactivation efficacy by UV irradiation, PDF

Twerenbold Henry Mario von Entlebuch in Siglistorf Gesellschafter und Vorsitzender der Geschäftsführung mit Kollektivunterschrift zu zweien mit 64 Stammanteilen zu je CHF 100.00
Souza Lima Rafael brasilianischer Staatsangehöriger in Zürich Gesellschafter und Geschäftsführer mit Kollektivunterschrift zu zweien mit 63 Stammanteilen zu je CHF 100.00
Saikia Eashan indischer Staatsangehöriger in Zürich Gesellschafter mit Kollektivunterschrift zu zweien mit 63 Stammanteilen zu je CHF 100.00
Sethi Anil von Russikon in Russikon Gesellschafter ohne Zeichnungsberechtigung mit 10 Stammanteilen zu je CHF 100.00

Mini-PC

  • Chuwi LarkBox
  • Beelink Gemini T34
  • Beelink Z83-V
  • Beelink U57
  • VENOEN
  • ACEPC GK3V

Chuwi LarkBox

  • Intel Celeron J4125

Beelink T34

  • Intel Celeron Apollo Lake J3455

Beelink Gemini T34

  • Intel Celeron N3450

Beelink Z83-V

  • Intel Atom X5-Z8350

Beelink U57

  • Intel Core i5-5257U

VENOEN

VENOEN


ACEPC GK3V