Browse Source

Add point counter to canvas information.

master
Taylor Bockman 5 years ago
parent
commit
2067be605e
  1. 67
      clusterview2.ui
  2. 4
      clusterview2/ui/mode_handlers.py
  3. 25
      clusterview2_ui.py

67
clusterview2.ui

@ -127,6 +127,9 @@
<height>16777215</height>
</size>
</property>
<property name="value">
<number>4</number>
</property>
</widget>
</item>
<item row="3" column="0">
@ -171,26 +174,37 @@
<string>Canvas Information</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="3">
<widget class="QLabel" name="mouse_position_label">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Mouse Position:</string>
</property>
<property name="minimumSize">
</widget>
</item>
<item row="0" column="2">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>100</width>
<height>0</height>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string/>
<string>Number of Points:</string>
</property>
</widget>
</item>
<item row="1" column="0">
<item row="3" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
@ -203,15 +217,27 @@
</property>
</spacer>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label">
<item row="0" column="3">
<widget class="QLabel" name="mouse_position_label">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Mouse Position:</string>
<string/>
</property>
</widget>
</item>
<item row="0" column="2">
<spacer name="horizontalSpacer">
<item row="1" column="2">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
@ -226,6 +252,13 @@
</property>
</spacer>
</item>
<item row="1" column="3">
<widget class="QLabel" name="number_of_points_label">
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</widget>
</item>

4
clusterview2/ui/mode_handlers.py

@ -73,6 +73,10 @@ def refresh_point_list(ctx):
ctx.point_list_widget.update()
num_of_points = len(list(PointManager.point_set.points))
ctx.number_of_points_label.setText(str(num_of_points))
def _handle_add_point(ctx, event):
"""

25
clusterview2_ui.py

@ -72,6 +72,7 @@ class Ui_MainWindow(object):
self.number_of_clusters.setSizePolicy(sizePolicy)
self.number_of_clusters.setMinimumSize(QtCore.QSize(50, 26))
self.number_of_clusters.setMaximumSize(QtCore.QSize(50, 16777215))
self.number_of_clusters.setProperty("value", 4)
self.number_of_clusters.setObjectName("number_of_clusters")
self.formLayout.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.number_of_clusters)
self.clustering_button = QtWidgets.QPushButton(self.groupBox_3)
@ -88,6 +89,16 @@ class Ui_MainWindow(object):
self.groupBox_2.setObjectName("groupBox_2")
self.gridLayout_2 = QtWidgets.QGridLayout(self.groupBox_2)
self.gridLayout_2.setObjectName("gridLayout_2")
self.label = QtWidgets.QLabel(self.groupBox_2)
self.label.setObjectName("label")
self.gridLayout_2.addWidget(self.label, 0, 0, 1, 1)
spacerItem1 = QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Minimum)
self.gridLayout_2.addItem(spacerItem1, 0, 2, 1, 1)
self.label_3 = QtWidgets.QLabel(self.groupBox_2)
self.label_3.setObjectName("label_3")
self.gridLayout_2.addWidget(self.label_3, 1, 0, 1, 1)
spacerItem2 = QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.gridLayout_2.addItem(spacerItem2, 3, 0, 1, 1)
self.mouse_position_label = QtWidgets.QLabel(self.groupBox_2)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(0)
@ -98,13 +109,12 @@ class Ui_MainWindow(object):
self.mouse_position_label.setText("")
self.mouse_position_label.setObjectName("mouse_position_label")
self.gridLayout_2.addWidget(self.mouse_position_label, 0, 3, 1, 1)
spacerItem1 = QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.gridLayout_2.addItem(spacerItem1, 1, 0, 1, 1)
self.label = QtWidgets.QLabel(self.groupBox_2)
self.label.setObjectName("label")
self.gridLayout_2.addWidget(self.label, 0, 0, 1, 1)
spacerItem2 = QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Minimum)
self.gridLayout_2.addItem(spacerItem2, 0, 2, 1, 1)
spacerItem3 = QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Minimum)
self.gridLayout_2.addItem(spacerItem3, 1, 2, 1, 1)
self.number_of_points_label = QtWidgets.QLabel(self.groupBox_2)
self.number_of_points_label.setText("")
self.number_of_points_label.setObjectName("number_of_points_label")
self.gridLayout_2.addWidget(self.number_of_points_label, 1, 3, 1, 1)
self.verticalLayout.addWidget(self.groupBox_2)
self.horizontalLayout.addLayout(self.verticalLayout)
MainWindow.setCentralWidget(self.centralwidget)
@ -167,6 +177,7 @@ class Ui_MainWindow(object):
self.reset_button.setText(_translate("MainWindow", "Reset"))
self.groupBox_2.setTitle(_translate("MainWindow", "Canvas Information"))
self.label.setText(_translate("MainWindow", "Mouse Position:"))
self.label_3.setText(_translate("MainWindow", "Number of Points:"))
self.menu_file.setTitle(_translate("MainWindow", "File"))
self.menu_help.setTitle(_translate("MainWindow", "Help"))
self.tool_bar.setWindowTitle(_translate("MainWindow", "toolBar"))

Loading…
Cancel
Save