source: orange/Orange/OrangeCanvas/gui/tests/test_toolbox.py @ 11100:cf6f6744dd9b

Revision 11100:cf6f6744dd9b, 716 bytes checked in by Ales Erjavec <ales.erjavec@…>, 19 months ago (diff)

Added gui widget toolkit.

Line 
1"""
2Tests for ToolBox widget.
3
4"""
5
6from .. import test
7from .. import toolbox
8
9from PyQt4.QtGui import QLabel, QListView, QSpinBox, QIcon
10
11
12class TestToolBox(test.QAppTestCase):
13    def test_tool_box(self):
14        w = toolbox.ToolBox()
15        style = self.app.style()
16        icon = QIcon(style.standardPixmap(style.SP_FileIcon))
17        p1 = QLabel("A Label")
18        p2 = QListView()
19        p3 = QLabel("Another\nlabel")
20        p4 = QSpinBox()
21        w.addItem(p1, "T1", icon)
22        w.addItem(p2, "Tab " * 10, icon, "a tab")
23        w.addItem(p3, "t3")
24        w.addItem(p4, "t4")
25        w.show()
26        w.removeItem(2)
27#        w.insertItem(index, widget, text, icon, toolTip)
28
29        self.app.exec_()
Note: See TracBrowser for help on using the repository browser.