Movatterモバイル変換


[0]ホーム

URL:


We bake cookies in your browser for a better experience. Using this site means that you consent.Read More

Menu

Qt Documentation

  • Qt 4.8
  • Qt3SupportLight
  • Q3ProgressBar

Q3ProgressBar Class

TheQ3ProgressBar widget provides a horizontal progress bar.More...

Header:#include <Q3ProgressBar>
Inherits:QFrame

Properties

  • 6 properties inherited fromQFrame
  • 58 properties inherited fromQWidget
  • 1 property inherited fromQObject

Public Functions

Q3ProgressBar(QWidget * parent = 0, Qt::WindowFlags f = 0)
Q3ProgressBar(int totalSteps, QWidget * parent = 0, Qt::WindowFlags f = 0)
boolcenterIndicator() const
intmargin() const
boolpercentageVisible() const
intprogress() const
const QString &progressString() const
voidsetCenterIndicator(bool on)
voidsetMargin(int margin)
voidsetPercentageVisible(bool)
inttotalSteps() const

Reimplemented Public Functions

virtual QSizeminimumSizeHint() const
virtual voidsetVisible(bool visible)
virtual QSizesizeHint() const
  • 14 public functions inherited fromQFrame
  • 220 public functions inherited fromQWidget
  • 29 public functions inherited fromQObject
  • 12 public functions inherited fromQPaintDevice

Public Slots

voidreset()
virtual voidsetProgress(int progress)
voidsetProgress(int progress, int totalSteps)
virtual voidsetTotalSteps(int totalSteps)
  • 19 public slots inherited fromQWidget
  • 1 public slot inherited fromQObject

Protected Functions

virtual boolsetIndicator(QString & indicator, int progress, int totalSteps)

Reimplemented Protected Functions

virtual voidchangeEvent(QEvent * ev)
virtual voidpaintEvent(QPaintEvent *)
  • 3 protected functions inherited fromQFrame
  • 37 protected functions inherited fromQWidget
  • 8 protected functions inherited fromQObject
  • 1 protected function inherited fromQPaintDevice

Additional Inherited Members

  • 1 signal inherited fromQWidget
  • 1 signal inherited fromQObject
  • 4 static public members inherited fromQWidget
  • 7 static public members inherited fromQObject
  • 1 protected slot inherited fromQWidget

Detailed Description

TheQ3ProgressBar widget provides a horizontal progress bar.

A progress bar is used to give the user an indication of the progress of an operation and to reassure them that the application is still running.

The progress bar uses the concept ofsteps; you give it the total number of steps and the number of steps completed so far and it will display the percentage of steps that have been completed. You can specify the total number of steps in the constructor or later withsetTotalSteps(). The current number of steps is set withsetProgress(). The progress bar can be rewound to the beginning withreset().

If the total is given as 0 the progress bar shows a busy indicator instead of a percentage of steps. This is useful, for example, when usingQFtp orQHttp to download items when they are unable to determine the size of the item being downloaded.

Screenshot in Motif styleScreenshot in Windows style

See alsoQProgressDialog andQProgressDialog.

Property Documentation

centerIndicator :bool

This property holds whether the indicator string should be centered.

Access functions:

boolcenterIndicator() const
voidsetCenterIndicator(bool on)

percentageVisible :bool

This property holds whether the current progress value is displayed.

The default is true.

Access functions:

boolpercentageVisible() const
voidsetPercentageVisible(bool)

See alsocenterIndicator.

progress :int

This property holds the current amount of progress.

This property is -1 if progress counting has not started.

Access functions:

intprogress() const
virtual voidsetProgress(int progress)
voidsetProgress(int progress, int totalSteps)

progressString : constQString

This property holds the amount of progress as a string.

This property is an empty string if progress counting has not started.

Access functions:

const QString &progressString() const

totalSteps :int

This property holds the total number of steps.

If totalSteps is 0, the progress bar will display a busy indicator.

Access functions:

inttotalSteps() const
virtual voidsetTotalSteps(int totalSteps)

Member Function Documentation

Q3ProgressBar::Q3ProgressBar(QWidget * parent = 0,Qt::WindowFlags f = 0)

Constructs a progress bar.

The total number of steps is set to 100 by default.

Theparent, and widget flags,f, are passed on to theQFrame::QFrame() constructor.

See alsosetTotalSteps().

Q3ProgressBar::Q3ProgressBar(int totalSteps,QWidget * parent = 0,Qt::WindowFlags f = 0)

Constructs a progress bar.

ThetotalSteps is the total number of steps that need to be completed for the operation which this progress bar represents. For example, if the operation is to examine 50 files, this value would be 50. Before examining the first file, callsetProgress(0); callsetProgress(50) after examining the last file.

Theparent, and widget flags,f, are passed to theQFrame::QFrame() constructor.

See alsosetTotalSteps() andsetProgress().

[virtual protected]void Q3ProgressBar::changeEvent(QEvent * ev)

Reimplemented fromQWidget::changeEvent().

int Q3ProgressBar::margin() const

Returns the width of the margin around the contents of the widget.

This function usesQWidget::getContentsMargins() to get the margin.

This function was introduced in Qt 4.2.

See alsosetMargin() andQWidget::getContentsMargins().

[virtual]QSize Q3ProgressBar::minimumSizeHint() const

Reimplemented fromQWidget::minimumSizeHint().

[virtual protected]void Q3ProgressBar::paintEvent(QPaintEvent *)

Reimplemented fromQWidget::paintEvent().

[slot]void Q3ProgressBar::reset()

Reset the progress bar. The progress bar "rewinds" and shows no progress.

[virtual protected]bool Q3ProgressBar::setIndicator(QString & indicator,int progress,int totalSteps)

This method is called to generate the text displayed in the center (or in some styles, to the left) of the progress bar.

Theprogress may be negative, indicating that the progress bar is in the "reset" state before any progress is set.

The default implementation is the percentage of completion or blank in the reset state. The percentage is calculated based on theprogress andtotalSteps. You can set theindicator text if you wish.

To allow efficient repainting of the progress bar, this method should return false if the string is unchanged from the last call to this function.

void Q3ProgressBar::setMargin(int margin)

Sets the width of the margin around the contents of the widget tomargin.

This function usesQWidget::setContentsMargins() to set the margin.

This function was introduced in Qt 4.2.

See alsomargin() andQWidget::setContentsMargins().

[virtual]void Q3ProgressBar::setVisible(bool visible)

Reimplemented fromQWidget::setVisible().

[virtual]QSize Q3ProgressBar::sizeHint() const

Reimplemented fromQWidget::sizeHint().

© 2016 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of theGNU 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.


[8]ページ先頭

©2009-2025 Movatter.jp