[PYQT]QSS使用,附自己的模板(算是扒OSX UI)

题记

最近在做Python GUI开发,一直觉得自己的界面LOW爆了,所以想找一些好的资源,但真心没有太好的,最终只找到一个QSS编辑器,一个API,一个OSX的Sketch资源文件。就有了这个QSS文件,本人没有UI经验,调整了一套,算是对自己一个交待吧。



一个QSS编辑器:https://github.com/hustlei/QssStylesheetEditor

QssStylesheetEditor支持预览,控件很全。

一个API:https://doc.qt.io/qt-5/stylesheet-examples.html 官方例子。能用的都有了。

源文件的位置在码云:https://gitee.com/aocshallo/mac-qss.git


  1 QWidget{
  2     color: #222;
  3     background-color: #C8F5F5F5;
  4 }
  5
  6 QFrame, QLabel, QToolTip {
  7     border: 1px solid #8D8D91;
  8     border-radius: 5px;
  9     padding: 1px;
 10     background:#FFFFFF;
 11 }
 12  QLabel {
 13     border: 0px solid #8D8D91;
 14     padding: 2px;
 15     background:transparent;
 16 }
 17
 18 QMainWindow::separator{
 19     border: 1px solid #8D8D91;
 20     border-style: outset;
 21     width: 4px;
 22     height: 4px;
 23 }
 24
 25 QLineEdit {
 26     background:#FFFFFF;
 27     selection-background-color: #4197FF;
 28     border: 1px solid #8D8D91;
 29     padding: 2px;
 30     min-height: 20px;
 31     border-radius:5px;
 32 }
 33 /*
 34     border也可以加入渐变
 35     border-top-color:qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 rgba(255, 255, 255, 255), stop:1 rgba(206, 210, 255, 255));
 36     border-left-color:qlineargradient(x1:0, y1:0, x2:1, y2:0, stop:0 rgba(255, 255, 255, 255), stop:1 rgba(206, 210, 255, 255));
 37     border-right-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(206, 210, 255, 255), stop:1 rgba(255, 255, 255, 255));
 38     border-bottom-color: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 rgba(206, 210, 255, 255), stop:1 rgba(255, 255, 255, 255));
 39
 40 */
 41 QLineEdit:hover{
 42     border:2px solid #B4B4D0F5;
 43     border-radius:5px;
 44     }
 45
 46 QLineEdit:focus{
 47     border:2px solid #7EA3D9;
 48 }
 49
 50 QLineEdit:read-only {
 51     border: 1px solid #DCDCDC;
 52     color: lightgray;
 53 }
 54 QLineEdit:disabled {
 55     border: 1px solid #DCDCDC;
 56     color: lightgray;
 57 }
 58
 59 QComboBox{
 60     background:#FFFFFF;
 61     selection-background-color: #4197FF;
 62     border: 1px solid #8D8D91;
 63     padding: 0 1px;
 64     min-height: 20px;
 65     border-radius:5px;
 66     padding:2px;
 67 }
 68 QComboBox:editable{
 69     border-style: solid;
 70     border-radius:5px;
 71     padding:2px;
 72 }
 73 QComboBox:hover{
 74     border-color: #4197FF;
 75     border:2px solid #7EA3D9;
 76     border-radius:5px;
 77 }
 78 QComboBox:focus{
 79     border-color: #7EA3D9;
 80     border:1px solid #7EA3D9;
 81     border-radius:5px;
 82 }
 83 QComboBox:on { /* shift the text when the popup opens */
 84     padding-top: 2px;
 85     padding-left: 2px;
 86     border-radius:5px;
 87 }
 88 QComboBox::down-arrow {
 89     image:url(drop_down.png);
 90 }
 91
 92 QComboBox::drop-down { /* shift the text when the popup opens */
 93     background:#4197FF;
 94     width:15px;
 95     padding-right:2px;
 96     border-top-right-radius: 3px;
 97     border-bottom-right-radius: 3px;
 98 }
 99 QComboBox QAbstractItemView {
100     background:#FFFFFF;
101     border: 1px solid #8D8D91;
102     border-radius:3px;
103     selection-background-color: #4197FF;
104 }
105 QComboBox QAbstractItemView::item{
106     height:50px;
107 }
108
109 QPushButton {
110     border: 1px solid #8D8D91;
111     border-radius: 5px;
112     background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1,
113         stop: 0 #FEFEFE, stop: 0.05 #FBFBFB,stop: 0.4 #FBFBFB,
114         stop: 0.9 #F5F5F5, stop: 1 #F5F5F5);
115     padding: 2px;
116     min-height: 20px;
117     min-width:60px;
118 }
119 QPushButton:default {
120     background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1,
121         stop: 0 #68B1FA, stop: 0.05 #3C9AFC,stop: 0.4 #3C9AFC,
122         stop: 0.9 #0A81FF, stop: 1 #0A81FF);
123 }
124
125 QPushButton:hover{
126     border: 2px solid #B4B4D0F5;
127     background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1,
128         stop: 0 #68B1FA, stop: 0.05 #3C9AFC,stop: 0.4 #3C9AFC,
129         stop: 0.9 #0A81FF, stop: 1 #0A81FF);
130 }
131 QPushButton:pressed{
132     background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1,
133         stop: 0 #68B1FA, stop: 0.05 #0A81FF,stop: 0.4 #0A81FF,
134         stop: 0.9 #3C9AFC, stop: 1 #3C9AFC);
135
136 }
137 QPushButton:disabled{
138     border:1px solid #CDCDCD;
139     color:#C7C7C7;
140     background:#EFEFEF;
141 }
142
143 QToolButton {
144     border: 1px solid #8D8D91;
145     border-radius: 2px;
146     background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1,
147         stop: 0 #FEFEFE, stop: 0.05 #FBFBFB,stop: 0.4 #FBFBFB,
148         stop: 0.9 #F5F5F5, stop: 1 #F5F5F5);
149     min-width:15px;
150     min-height:20px;
151 }
152 QToolButton:hover{
153     border: 2px solid #B4B4D0F5;
154 }
155 QToolButton:pressed{
156     border: 2px solid #7EA3D9;
157 }
158 QToolButton::menu-arrow {
159     image:url("drop_down.png");
160
161 }
162 QToolButton::menu-button {
163     border-top-right-radius:2px;
164     border-bottom-right-radius:2px;
165     background:#4197FF;
166     width:20px;
167     margin-left:2px;
168 }
169 QToolButton[popupMode="1"] { /* only for MenuButtonPopup */
170     padding-right: 20px; /* make way for the popup button */
171     background:#FFFFFF;
172 }
173
174 QCheckBox {
175     padding:2px;
176 }
177
178 QCheckBox::indicator {
179     width: 13px;
180     height: 13px;
181 }
182
183 QCheckBox::indicator:unchecked {
184     image: url(checkbox_unchecked.png);
185 }
186
187 QCheckBox::indicator:unchecked:hover {
188     image: url(checkbox_unchecked_hover.png);
189 }
190
191 QCheckBox::indicator:unchecked:pressed {
192     image: url(checkbox_unchecked_pressed.png);
193 }
194
195 QCheckBox::indicator:checked {
196     image: url(checkbox_checked.png);
197 }
198
199 QCheckBox::indicator:checked:hover {
200     image: url(checkbox_checked_hover.png);
201 }
202
203 QCheckBox::indicator:checked:pressed {
204     image: url(checkbox_checked_pressed.png);
205 }
206
207 QCheckBox::indicator:indeterminate:hover {
208     image: url(checkbox_indeterminate_hover.png);
209 }
210
211 QCheckBox::indicator:indeterminate {
212     image: url(checkbox_indeterminate.png);
213 }
214
215 QCheckBox:disabled{
216     padding:2px;
217     color:#C7C7C7
218 }
219
220 QCheckBox::indicator:disabled {
221     width: 13px;
222     height: 13px;
223     border:1px solid #CDCDCD;
224     border-radius:5px;
225 }
226
227 QRadioButton::indicator {
228     width: 13px;
229     height: 13px;
230 }
231
232 QRadioButton::indicator::unchecked {
233     image: url(radiobutton_unchecked.png);
234 }
235
236 QRadioButton::indicator:unchecked:hover {
237     image: url(radiobutton_unchecked_hover.png);
238 }
239
240 QRadioButton::indicator:unchecked:pressed {
241     image: url(radiobutton_unchecked_pressed.png);
242 }
243
244 QRadioButton::indicator::checked {
245     image: url(radiobutton_checked.png);
246 }
247
248 QRadioButton::indicator:checked:hover {
249     image: url(radiobutton_checked_hover.png);
250 }
251
252 QRadioButton::indicator:checked:pressed {
253     image: url(radiobutton_checked_pressed.png);
254 }
255 QRadioButton:disabled{
256     padding:2px;
257     color:#C7C7C7
258 }
259
260
261
262 QSlider::groove:horizontal {
263     border: 0px solid #999999;
264     height: 10px; /* the groove expands to the size of the slider by default. by giving it a height, it has a fixed size */
265     background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #C7C7C7, stop:1 #EFEFEF);
266     border-radius:5px;
267      margin-left:5px;
268      margin-right:5px;
269      margin-top:10px;
270      margin-bottom:10px;
271 }
272
273 QSlider::handle:horizontal {
274     image:url(qsliderbar.png);
275     margin: -10px -1px; /* handle is placed by default on the contents rect of the groove. Expand outside the groove */
276
277 }
278
279 QSlider::groove:vertical {
280     border: 0px solid #999999;
281     height: 10px; /* the groove expands to the size of the slider by default. by giving it a height, it has a fixed size */
282     background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #C7C7C7, stop:1 #EFEFEF);
283     border-radius:5px;
284      margin-left:5px;
285      margin-right:5px;
286      margin-top:10px;
287      margin-bottom:10px;
288 }
289
290 QSlider::handle:vertical {
291     image:url(qsliderbar.png);
292     margin: -1px -10px; /* handle is placed by default on the contents rect of the groove. Expand outside the groove */
293
294 }
295
296 QSlider::add-page:vertical {
297     background: white;
298 }
299
300 QSlider::sub-page:vertical {
301     background: pink;
302 }
303
304 QProgressBar {
305     border: 2px solid #DCDCDC;
306     background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1,
307         stop: 0 #FEFEFE, stop: 0.05 #F5F5F5,stop: 0.95 #F5F5F5);
308     border-radius: 5px;
309     text-align: center;
310     font-weight:bold;
311     color:#550000;
312 }
313 QProgressBar::chunk {
314     background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1,
315         stop: 0 #68B1FA, stop: 0.05 #0A81FF,stop: 0.4 #0A81FF,
316         stop: 0.9 #3C9AFC, stop: 1 #3C9AFC);
317 }
318
319
320
321 QSpinBox,QDoubleSpinBox {
322     padding-right: 15px; /* make room for the arrows */
323     border:1px solid #8D8D91;
324     border-radius:5px;
325     min-height:20px;
326     padding:2px;
327     background:#FFFFFF;
328 }
329
330 QSpinBox::up-button,QDoubleSpinBox::up-button {
331     subcontrol-origin: border;
332     subcontrol-position: top right; /* position at the top right corner */
333
334     width: 15px; /* 16 + 2*1px border-width = 15px padding + 3px parent border */
335     border-image: url(spinup.png) 1;
336     border-width: 1px;
337     padding-right:1px;
338 }
339
340 QSpinBox::up-button:hover,QDoubleSpinBox::up-button:hover {
341     border-image: url(spinup_hover.png) 1;
342 }
343
344 QSpinBox::up-button:pressed,QDoubleSpinBox::up-button:pressed {
345     border-image: url(spinup_pressed.png) 1;
346 }
347 /*
348 QSpinBox::up-arrow {
349     image: url(up_arrow.png);
350     width: 7px;
351     height: 7px;
352 }
353 ¿Éµ¥¶ÀÉèÖÃarrow
354 */
355 QSpinBox::up-arrow:disabled, QSpinBox::up-arrow:off ,
356 QDoubleSpinBox::up-arrow:disabled, QDoubleSpinBox::up-arrow:off
357 { /* off state when value is max */
358    image: url(:/images/up_arrow_disabled.png);
359 }
360
361 QSpinBox::down-button,QDoubleSpinBox::down-button {
362     subcontrol-origin: border;
363     subcontrol-position: bottom right; /* position at bottom right corner */
364
365     width: 15px;
366     border-image: url(spindown.png) 1;
367     border-width: 1px;
368     padding-right:1px;
369 }
370
371 QSpinBox::down-button:hover,QDoubleSpinBox::down-button:hover{
372     border-image: url(spindown_hover.png) 1;
373 }
374
375 QSpinBox::down-button:pressed,QDoubleSpinBox::down-button:pressed {
376     border-image: url(spindown_pressed.png) 1;
377 }
378
379
380 QScrollBar:horizontal {
381     border: 1px solid grey;
382     background: #ffffff;
383     height: 20px;
384     margin: 0px 20px 0 20px;
385 }
386 QScrollBar::handle:horizontal{
387     background: #68B1FA;
388     min-width: 20px;
389 }
390 QScrollBar::add-line:horizontal {
391     border: 1px solid grey;
392     background: #B4B4D0F5;
393     width: 20px;
394     subcontrol-position: right;
395     subcontrol-origin: margin;
396 }
397
398 QScrollBar::sub-line:horizontal {
399     border: 1px solid grey;
400     background: #B4B4D0F5;
401     width: 20px;
402     subcontrol-position: left;
403     subcontrol-origin: margin;
404 }
405
406  QScrollBar:vertical {
407      border: 1px solid grey;
408      background: #ffffff;
409      width: 20px;
410      margin: 20px 0 20px 0;
411  }
412  QScrollBar::handle:vertical {
413      background:#68B1FA;
414      min-height: 20px;
415  }
416  QScrollBar::add-line:vertical {
417      border: 1px solid grey;
418      background: #B4B4D0F5;
419      height: 20px;
420      subcontrol-position: bottom;
421      subcontrol-origin: margin;
422  }
423
424  QScrollBar::sub-line:vertical {
425      border: 1px solid grey;
426      background: #B4B4D0F5;
427      height: 20px;
428      subcontrol-position: top;
429      subcontrol-origin: margin;
430  }
431
432
433
434
435
436
437 QDateEdit,QTimeEdit,QDateTimeEdit {
438     padding-right: 15px; /* make room for the arrows */
439     border:1px solid #8D8D91;
440     border-radius:5px;
441     min-height:20px;
442     padding:2px;
443     background:#FFFFFF;
444 }
445
446 QDateTimeEdit::drop-down { /* shift the text when the popup opens */
447     image:url(drop_down.png);
448     background:#4197FF;
449     width:15px;
450     padding-right:2px;
451     border-top-right-radius: 3px;
452     border-bottom-right-radius: 3px;
453 }
454
455 QDateEdit::up-button,QTimeEdit::up-button,QDateTimeEdit::up-button  {
456     subcontrol-origin: border;
457     subcontrol-position: top right; /* position at the top right corner */
458
459     width: 15px; /* 16 + 2*1px border-width = 15px padding + 3px parent border */
460     border-image: url(spinup.png) 1;
461     border-width: 1px;
462     padding-right:1px;
463 }
464
465 QDateEdit::up-button:hover,QTimeEdit::up-button:hover,
466 QDateTimeEdit::up-button:hover {
467     border-image: url(spinup_hover.png) 1;
468 }
469
470 QDateEdit::up-button:pressed,QTimeEdit::up-button:pressed,
471 QDateTimeEdit::up-button:pressed  {
472     border-image: url(spinup_pressed.png) 1;
473 }
474 /*
475 QSpinBox::up-arrow {
476     image: url(up_arrow.png);
477     width: 7px;
478     height: 7px;
479 }
480 ¿Éµ¥¶ÀÉèÖÃarrow
481 */
482 QDateEdit::up-arrow:disabled, QDateEdit::up-arrow:off ,
483 QTimeEdit::up-arrow:disabled, QTimeEdit::up-arrow:off ,
484 QDateTimeEdit::up-arrow:disabled, QDateTimeEdit::up-arrow:off
485 { /* off state when value is max */
486    image: url(:/images/up_arrow_disabled.png);
487 }
488
489 QDateEdit::down-button,QTimeEdit::down-button,
490 QDateTimeEdit::down-button {
491     subcontrol-origin: border;
492     subcontrol-position: bottom right; /* position at bottom right corner */
493
494     width: 15px;
495     border-image: url(spindown.png) 1;
496     border-width: 1px;
497     padding-right:1px;
498 }
499
500 QDateEdit::down-button:hover,QTimeEdit::down-button:hover,
501 QDateTimeEdit::down-button:hover{
502     border-image: url(spindown_hover.png) 1;
503 }
504
505 QDateEdit::down-button:pressed,QTimeEdit::down-button:pressed,
506 QDateTimeEdit::down-button:pressed {
507     border-image: url(spindown_pressed.png) 1;
508 }
509
510 QDateTimeEdit QAbstractItemView{
511     background:#FFFFFF;
512 }
513
514 QTextEdit, QListView {
515     background-color: white;
516     background-attachment: fixed;
517     border:1px solid #8D8D91;
518     border-radius:5px;
519     padding:2px;
520 }
521
522 QDockWidget {
523     border: 1px solid lightgray;
524     titlebar-close-icon: url(close.png);
525     titlebar-normal-icon: url(undock.png);
526 }
527
528 QDockWidget::title {
529     text-align: left; /* align the text to the left */
530     background: lightgray;
531     padding-left: 5px;
532 }
533
534 QDockWidget::close-button, QDockWidget::float-button {
535     border: 1px solid transparent;
536     background: darkgray;
537     padding: 0px;
538 }
539
540 QDockWidget::close-button:hover, QDockWidget::float-button:hover {
541     background: gray;
542 }
543
544 QDockWidget::close-button:pressed, QDockWidget::float-button:pressed {
545     padding: 1px -1px -1px 1px;
546 }
547 QGroupBox {
548     background-color: #FFFFFF;
549     border: 1px solid gray;
550     border-radius: 5px;
551     margin-top: 1ex; /* leave space at the top for the title */
552     padding-top:15px;
553 }
554
555 QGroupBox::title {
556     subcontrol-origin: margin;
557     subcontrol-position: top center; /* position at the top center */
558     border:1px solid #8D8D91;
559     border-radius:3px;
560     min-width:150px;
561     min-height:30px;
562     margin-bottom:10px;
563     background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
564                                       stop: 0.2 #F5F5F5, stop: 0.8 #FEFEFE);
565 }
566
567 QStatusBar {
568     background: #C8F5F5F5;
569 }
570
571 QStatusBar::item {
572     border: 1px solid #8D8D91;
573     border-radius: 2px;
574     padding:2px;
575 }
576
577
578
579 QTabWidget::pane { /* The tab widget frame */
580     border-radius:5px;
581 }
582
583 QTabWidget::tab-bar {
584     left: 5px; /* move to the right by 5px */
585 }
586
587 /* Style the tab using the tab sub-control. Note that
588     it reads QTabBar _not_ QTabWidget */
589 QTabBar::tab {
590     background: #FFFFFF;
591     border: 1px solid #C7C7C7;
592     border-bottom:1px solid #8D8D91; /* same as the pane color */
593     border-top-left-radius: 5px;
594     border-top-right-radius: 5px;
595     min-width: 25ex;
596     min-height:5ex;
597     padding: 2px;
598 }
599
600 QTabBar::tab:selected, QTabBar::tab:hover {
601     background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
602                                 stop: 0 #68B1FA, stop: 0.4 #3C9AFC,
603                                 stop: 0.5 #0A81FF, stop: 1.0 #68B1FA);
604     border:1px solid #0A81FF;
605 }
606
607 QTabBar::tab:selected {
608     border:1px solid #0A81FF;
609     border-bottom:1px solid #8D8D91; /* same as pane color */
610 }
611
612 QTabBar::tab:!selected {
613     margin-top: 2px; /* make non-selected tabs look smaller */
614 }
615
616 /* make use of negative margins for overlapping tabs */
617 QTabBar::tab:selected {
618     /* expand/overlap to the left and right by 4px */
619     margin-left: -4px;
620     margin-right: -4px;
621 }
622
623 QTabBar::tab:first:selected {
624     margin-left: 0; /* the first selected tab has nothing to overlap with on the left */
625 }
626
627 QTabBar::tab:last:selected {
628     margin-right: 0; /* the last selected tab has nothing to overlap with on the right */
629 }
630
631 QTabBar::tab:only-one {
632     margin: 0; /* if there is only one tab, we don‘t want overlapping margins */
633 }

效果一般,愿意尝试的可以试试。

原文地址:https://www.cnblogs.com/aocshallo1/p/12588683.html

时间: 2024-08-11 03:14:38

[PYQT]QSS使用,附自己的模板(算是扒OSX UI)的相关文章

苹果开发者应当在应用程序中包含隐私策略(附隐私策略模板)

前几日苹果在其开发者中心重申开发者应当在应用程序中包含隐私策略.为了确保用户理解应用如何使用他们的数据,开发者在以下两种情况中必须在iTunes的Privacy Policy URL字段提供一个链接: 1.开发者所在国家法律要求提供. 2.满足以下前提之一: 使用用户或者设备数据 提供账户注册程 访问用户现有的账号 使用HomeKit或者HealthKit框架 集成Apple Pay 包含键盘扩展 包含自动更新订阅和免费订阅 应用属于儿童类别 附隐私政策模板: 隐私政策  Poposoft尊重并

Pyqt QSS简单的Ui美化

什么是QSS QSS 是Qt StyleSheet 的简称,意思就是qt的样式表格,StyleSheet 可以像CSS已经的写样式.使页面美化跟代码层分开,利于维护. QSS的语法 同css一样,他也是由一个selector与一个declaration形成,selector指定了是对哪一个控件发生后果,而declaration才是真实的发生作用的语句.如: QPushButton { background-color: red } QPushButton指定了是对所有的QPushButton或是

实验2:函数重载、函数模板、简单类的定义和实现

实验目的 1. 掌握c++中函数的声明.定义.调用和参数传递方式 2. 掌握c++中带有默认形参值的函数声明和定义方法 3. 理解函数重载,掌握c++中函数重载的实现方式 4. 理解函数模板,掌握c++中函数模板的简单使用 5. 理解面向对象的抽象和封装,掌握c++中类的定义.实现和使用方法 实验准备 1. 函数的声明.定义.调用.参数传递方法 2. 带有默认形参值的函数 3. 函数重载 4. 函数模板(9.1.1节 + 9.3节) 其中,9.3节,理解3个常用的排序算法和两个常用的查找算法 5

Struts2的模板和主题theme及自定义theme

Struts2的模板和主题theme及自定义theme 标签: struts2 2016-03-29 11:22 190人阅读 评论(0) 收藏 举报  分类: javaweb(8)  Struts2提供了三种主题,ajax, simple, css_xhtml,xhtml,它默认的是xhtml主题,开发时我们一般都选simple.因为Struts2所有的UI标签都是基于主题和模板的,主题和模板是Struts2所有UI标签的核心.模板是一个UI标签的外在表示形式,例如:当我们使用<s:selec

tornado模板源码小析

最近对flask的热情有点下降,对tornado有点高涨. 之前在知乎上回答过一个问题,如何理解 Tornado ?,我的回答如下: 1.高性能的网络库,这可以和gevent,twisted,libevent等做对. 提供了异步io支持,超时事件处理,在此基础上提供了tcpserver,httpclient,尤其是curlhttpclient, 在现有http客户端中肯定排第一.可以用来做爬虫,游戏服务器,据我所知业界已有使用tornado作为游戏服务器 2.web框架,这可以和django,f

pyqt说明

我是个PHP程序员,不过有时候觉得需要写些小软件,对于我这种不太熟悉桌面软件开发的人来说,界面问题最让我头痛.听说Qt很强大,而且是跨平台,所以决定学习它用来弥补我写桌面软件的不足. Qt一般是通过C++来调用,如果要让Python支持Qt,需要下载PyQt这个库,十几M大小,安装后就可以让Python支持部分Qt功能. 在完整版Qt的Demo中,一般都是程序与界面分开,界面代码被写在.ui后缀的XML文件中,而程序只需要调用UI文件和写处理事件就行,实现代码与界面分离.而且ui文件可以用Qt

天天团购系统--部分模板语法

模板都放在templates目录下,默认是 templates /default目录是大部份模板,后台模板就相应在 templates /admin, templates/html下是一些模块代码需要生成的html模板, 例如 填写收货地址页面的,点击添加地址后,弹出来的一个填写地址的层.header.footer.detail(内容页),deals(往期团购)等, 然 而主页中的团购列表模板却是在html/igos/meituan/index.html,一开始还真没找到,多次调试才发现. 部分

在RichFaces中使用Facelets模板

在RichFaces中使用Facelets模板 目录 Facelets简介 Facelets标签 创建相应文件 Facelets简介 Facelets是用来构建JSF应用程序的默认视图技术.它为表现层提供了一个强有力的模板化系统.这里将简单介绍一下如何在RichFaces中使用Facelets模板标签.开发环境是基于Maven的,至于如何在Maven中构建RichFaces项目,详情可以参考这里. Facelets标签 下面表格中列举的是模板技术要使用到的标签: 标签 说明 ui:include

Edmonds_Karp 算法入门详解(转)

转载自:http://blog.csdn.net/hsqlsd/article/details/7862903 有n个点,有m条有向边,有一个点很特殊,只出不进,叫做源点,通常规定为1号点.另一个点也很特殊,只进不出,叫做汇点,通常规定为n号点.每条有向边上有两个量,容量和流量,从i到j的容量通常用c[I,j]表示,流量则通常是f[I,j].通常可以把这些边想象成道路,流量就是这条道路的车流量,容量就是道路可承受的最大的车流量.很显然的,流量<=容量.而对于每个不是源点和汇点的点来说,可以类比的