spinbox.html

<!doctype html>
<html lang="en">
 <head>
  <meta charset="GBK">
  <meta name="Generator" content="EditPlus">
  <meta name="Author" content="oneslide">
  <meta name="Keywords" content="load">
  <meta name="Description" content="load animation">
  <title>旋转的加载动画</title>
  <style>
  body,html{
       background-color:rgba(20,30,45,0.8);
       display:-webkit-box;/**盒子的展示方式,盒子为块的样式展示。也就是说,一个元素所影响的定位会仅限于自己的尺寸。如果没有,元素所占的一行背景将加深。**/

	   -webkit-box-align:center;/**上下居中**/
	   -webkit-box-pack:center;  /**    左右居中**/
	     width:100%;
	     height: 100%;
	
		
  }
  #container{
         margin:0 auto;  /*让盒子左右居中*/
	    
  }
  .load{
      border:2px solid white;
      border-top:2px solid black;
	  -webkit-animation:spin 1s  linear infinite;
      width:75px;
	  height:75px;
	  border-radius:50%;
  }
   @-webkit-keyframes spin{
        to{
        -webkit-transform:rotate(360deg);
        }
  }
  </style>

 </head>
 <body>
          <div id="container">
		        <div class="load"></div>
		  </div>
 </body>
</html>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
import FreeCAD import FreeCADGui from PySide import QtGui, QtCore Gui.activateWorkbench("PartWorkbench") FreeCAD.newDocument() class SphereDialog(QtGui.QDialog): def __init__(self): super().__init__() self.setWindowTitle("Create Sphere") self.create_widgets() def create_widgets(self): layout = QtGui.QVBoxLayout() # Radius widget radius_label = QtGui.QLabel("Radius:") self.radius_spinbox = QtGui.QDoubleSpinBox() self.radius_spinbox.setMinimum(0.1) self.radius_spinbox.setMaximum(1000.0) self.radius_spinbox.setValue(10.0) layout.addWidget(radius_label) layout.addWidget(self.radius_spinbox) # Opacity widget opacity_label = QtGui.QLabel("Opacity:") self.opacity_slider = QtGui.QSlider(QtCore.Qt.Horizontal) self.opacity_slider.setMinimum(0) self.opacity_slider.setMaximum(100) self.opacity_slider.setValue(50) layout.addWidget(opacity_label) layout.addWidget(self.opacity_slider) # Create button create_button = QtGui.QPushButton("Create") create_button.clicked.connect(self.create_sphere) layout.addWidget(create_button) self.setLayout(layout) def create_sphere(self): # Get sphere parameters radius = self.radius_spinbox.value() opacity = float(self.opacity_slider.value() / 100) # Create sphere sphere = FreeCAD.ActiveDocument.addObject("Part::Sphere", "Sphere") sphere.Radius = radius sphere.ViewObject.Transparency = int(round(opacity * 100)) # Show in 3D view sphere.ViewObject.Visibility = True FreeCADGui.SendMsgToActiveView("ViewFit") FreeCADGui.Selection.clearSelection() FreeCADGui.Selection.addSelection(sphere) FreeCADGui.SendMsgToActiveView("ViewFit") # Close dialog self.close() dialog = SphereDialog() dialog.show()代码中执行没有球体出现,请修改代码
最新发布
05-30

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值