Na tej stronie

Utils::ProgressIndicatorPainter Class

class Utils::ProgressIndicatorPainter

Klasa `ProgressIndicatorPainter` stanowi moduł rysujący dla klasy ` ProgressIndicator `. Więcej...

Header: #include <ProgressIndicatorPainter>

Funkcje publiczne

ProgressIndicatorPainter(Utils::ProgressIndicatorSize size)
Utils::ProgressIndicatorSize indicatorSize() const
void setIndicatorSize(Utils::ProgressIndicatorSize size)
void setUpdateCallback(const Utils::ProgressIndicatorPainter::UpdateCallback &cb)
QSize size() const
void startAnimation()
void stopAnimation()

Szczegółowy opis

Można jej użyć do rysowania okrągłego, nieustannie animowanego wskaźnika postępu bezpośrednio na elemencie ` QPaintDevice` — na przykład, jeśli chcesz wyświetlić wskaźnik postępu w miejscu, w którym nie można użyć elementu ` QWidget`.

Dokumentacja funkcji składowych

ProgressIndicatorPainter::ProgressIndicatorPainter(Utils::ProgressIndicatorSize size)

Tworzy obiekt malujący wskaźnik postępu dla wskaźnika size.

Zobacz także setUpdateCallback.

Utils::ProgressIndicatorSize ProgressIndicatorPainter::indicatorSize() const

Zwraca aktualny rozmiar wskaźnika. Aby uzyskać wynikowy rozmiar w pikselach, należy skorzystać z funkcji ` size `.

Zobacz także setIndicatorSize.

void ProgressIndicatorPainter::setIndicatorSize(Utils::ProgressIndicatorSize size)

Zmienia rozmiar wskaźnika postępu na size. Użytkownicy tej klasy muszą dostosować swój kod odpowiedzialny za rysowanie lub układanie elementów do zmiany wynikowego rozmiaru w pikselach.

Zobacz także indicatorSize oraz size.

void ProgressIndicatorPainter::setUpdateCallback(const Utils::ProgressIndicatorPainter::UpdateCallback &cb)

Ustawia procedurę zwrotną cb, która jest wywoływana za każdym razem, gdy wskaźnik postępu wymaga odświeżenia w związku z postępem animacji. Procedura zwrotna jest funkcją typu `void`, która nie przyjmuje żadnych parametrów i zazwyczaj powinna wywołać metodę ` QWidget::update ` w widżecie odpowiedzialnym za faktyczne rysowanie.

QSize ProgressIndicatorPainter::size() const

Zwraca rozmiar wskaźnika postępu w pikselach niezależnych od urządzenia.

Zobacz też: ` setIndicatorSize ` oraz `paint`.

void ProgressIndicatorPainter::startAnimation()

Uruchamia animację wskaźnika postępu.

Zobacz także setUpdateCallback oraz stopAnimation.

void ProgressIndicatorPainter::stopAnimation()

Zatrzymuje animację wskaźnika postępu.

Zobacz także setUpdateCallback oraz startAnimation.

Copyright © The Qt Company Ltd. and other contributors. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.