Code Monkey home page Code Monkey logo

qtwaitingspinner's Introduction

QtWaitingSpinner

QtWaitingSpinner is a highly configurable, custom Qt widget for showing "waiting" or "loading" spinner icons in Qt applications, e.g. the spinners below are all QtWaitingSpinner widgets differing only in their configuration:

waiting spinner

###Configuration

The following properties can all be controlled directly through their corresponding setters:

  • Colour of the widget
  • "Roundness" of the lines
  • Speed (rotations per second)
  • Number of lines to be drawn
  • Line length
  • Line width
  • Radius of the spinner's "dead space" or inner circle
  • The percentage fade of the "trail"
  • The minimum opacity of the "trail"

###Usage

Despite being highly configurable, QtWaitingSpinner is extremely easy to use and, to make things even easier, the "QtWaitingSpinnerTest" application can assist you in determining the exact shape, size and colour you'd like your spinner to have.

For example, the embedded spinner in the QtWaitingSpinnerTest screenshot below can be created as follows:

  QtWaitingSpinner* spinner = new QtWaitingSpinner(this);

  spinner->setRoundness(70.0);
  spinner->setMinimumTrailOpacity(15.0);
  spinner->setTrailFadePercentage(70.0);
  spinner->setNumberOfLines(12);
  spinner->setLineLength(10);
  spinner->setLineWidth(5);
  spinner->setInnerRadius(10);
  spinner->setRevolutionsPerSecond(1);
  spinner->setColor(QColor(81, 4, 71));

  spinner->start(); // gets the show on the road!

test dialog

As an alternative example, the code below will create a spinner that (1) blocks all user input to the main application for as long as the spinner is active, (2) automatically centres itself on its parent widget every time "start" is called and (3) makes use of the default shape, size and colour settings.

	QtWaitingSpinner* spinner = new QtWaitingSpinner(this, Qt::ApplicationModal, true);
	spinner->start(); // starts spinning

Please use use this link for feedback, requests or issues.

Enjoy!

###Thanks

QtWaitingSpinner was inspired by the spin.js project.

qtwaitingspinner's People

Contributors

snowwlex avatar williamhallatt avatar

Watchers

 avatar  avatar  avatar

Forkers

zb872676223

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.