Cockatrice 2026-09-01-Development-3.1.0-beta.10
A virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
CardCompleterStyler Class Reference

Applies styled row painting and a card-image preview to a card completer. More...

#include <card_completer_styler.h>

Inheritance diagram for CardCompleterStyler:
[legend]
Collaboration diagram for CardCompleterStyler:
[legend]

Static Public Member Functions

static void apply (QCompleter *completer)
 Styles completer and follows its current selection.

Protected Member Functions

bool eventFilter (QObject *obj, QEvent *ev) override

Private Slots

void updatePreview (const QModelIndex &index)
void updatePreviewFromHover (const QPoint &pos)
void onCompletionReset ()

Private Member Functions

 CardCompleterStyler (QCompleter *completer, QObject *parent=nullptr)
 ~CardCompleterStyler () override
void showPreview ()
void hidePreview ()
void stopPreviewFade ()
void reposition ()
void updateOrientation ()
void ensureClosestSelected ()
bool handlePopupKeyPress (QKeyEvent *event)
bool isPopupAboveWidget () const

Private Attributes

QCompleter * completer
ReversedCompleterModelreversedModel
CardInfoPictureEnlargedWidgetpreview
QModelIndex previewedIndex
bool above

Detailed Description

Applies styled row painting and a card-image preview to a card completer.

The completer popup rows are painted by CardCompleterDelegate and the image of the currently selected (or hovered) row is shown beside the popup.

Constructor & Destructor Documentation

◆ CardCompleterStyler()

CardCompleterStyler::CardCompleterStyler ( QCompleter * completer,
QObject * parent = nullptr )
explicitprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ~CardCompleterStyler()

CardCompleterStyler::~CardCompleterStyler ( )
overrideprivate

Member Function Documentation

◆ apply()

void CardCompleterStyler::apply ( QCompleter * completer)
static

Styles completer and follows its current selection.

The styler is parented to the completer so it lives exactly as long as the completer itself.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ensureClosestSelected()

void CardCompleterStyler::ensureClosestSelected ( )
private
Here is the caller graph for this function:

◆ eventFilter()

bool CardCompleterStyler::eventFilter ( QObject * obj,
QEvent * ev )
overrideprotected
Here is the call graph for this function:

◆ handlePopupKeyPress()

bool CardCompleterStyler::handlePopupKeyPress ( QKeyEvent * event)
private
Here is the caller graph for this function:

◆ hidePreview()

void CardCompleterStyler::hidePreview ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isPopupAboveWidget()

bool CardCompleterStyler::isPopupAboveWidget ( ) const
private
Here is the caller graph for this function:

◆ onCompletionReset

void CardCompleterStyler::onCompletionReset ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ reposition()

void CardCompleterStyler::reposition ( )
private
Here is the caller graph for this function:

◆ showPreview()

void CardCompleterStyler::showPreview ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ stopPreviewFade()

void CardCompleterStyler::stopPreviewFade ( )
private
Here is the caller graph for this function:

◆ updateOrientation()

void CardCompleterStyler::updateOrientation ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ updatePreview

void CardCompleterStyler::updatePreview ( const QModelIndex & index)
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ updatePreviewFromHover

void CardCompleterStyler::updatePreviewFromHover ( const QPoint & pos)
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ above

bool CardCompleterStyler::above
private

◆ completer

QCompleter* CardCompleterStyler::completer
private

◆ preview

CardInfoPictureEnlargedWidget* CardCompleterStyler::preview
private

◆ previewedIndex

QModelIndex CardCompleterStyler::previewedIndex
private

◆ reversedModel

ReversedCompleterModel* CardCompleterStyler::reversedModel
private

The documentation for this class was generated from the following files: