// In this function, we can get the height and width of the current widgetvoid Widget::resizeEvent(QResizeEvent *){ // Use a bitmap as a mask. A bitmap only has two kind of colors: white(value is 0) // or black(other values). When we use it to
概述 今天我们来实现一个iOS平台上的进度条(progress bar or progress view).这种进度条比APPLE自带的更加漂亮,更加有“B格”.它拥有渐变的颜色,而且这种颜色是动态移动的,这里称之为WGradientProgress. 先来看看我们的目标长什么样子: WGradientProgress的使用方法很简单,主要有展示接口以及隐藏接口,目前显示的位置有两种选择: WProgressPosDown //progress is on the down bor
该程序使用应用程序单窗口,主窗口继承于QMainWindow:主窗口有5个QToolButton部件(窗口底部的四个以及窗口中央的一个),单击窗口底部的QToolButton部件可以使窗口中央的那个QToolButton有动画效果:具体效果请自己尝试. 1.生成部件以及定位部件 在主窗口的构造函数中生成部件对象,然后在窗口大小改变事件中定位部件位置,如下代码所示: //生成ToolButton m_pBtn1 = new QToolButton(this); //窗口大小改变事件 vo
原文网址:使用CAGradientLayer的动画精度条View Modern software design is getting flatter and thinner all the time. Another trend that follows suit is the thin, one pixel progress bar that you see at the top of websites and apps. You’ve seen in it on Medium blogs,