Example #1
0
    signal.signal(signal.SIGINT, signal.SIG_DFL)
    from PyQt5.QtWidgets import QApplication
    from featureTableWidget import FeatureEntry

    app = QApplication(sys.argv)

    # app.setStyle("windows")
    # app.setStyle("motif")
    # app.setStyle("cde")
    # app.setStyle("plastique")
    # app.setStyle("macintosh")
    # app.setStyle("cleanlooks")

    ex = FeatureDlg()
    ex.createFeatureTable(
        [("Color", [FeatureEntry("Banananananaana", minimum_scale=.3)]),
         ("Edge", [FeatureEntry("Mango"),
                   FeatureEntry("Cherry")])],
        [0.3, 0.7, 1, 1.6, 3.5, 5.0, 10.0],
        [False, False, False, False, True, True, True], 3.5)
    ex.setWindowTitle("FeatureTest")
    ex.setImageToPreView(None)

    def handle_accepted():
        print("ACCEPTED")
        print(ex.selectionMatrix)

    ex.accepted.connect(handle_accepted)
    ex.exec_()
    print("DONE")
    # app.exec_()
Example #2
0
            checked, partiallyChecked, unchecked)


if __name__ == "__main__":
    #make the program quit on Ctrl+C
    import signal
    signal.signal(signal.SIGINT, signal.SIG_DFL)
    from PyQt4.QtGui import QApplication
    from featureTableWidget import FeatureEntry

    app = QApplication(sys.argv)

    #app.setStyle("windows")
    #app.setStyle("motif")
    #app.setStyle("cde")
    #app.setStyle("plastique")
    #app.setStyle("macintosh")
    #app.setStyle("cleanlooks")

    ex = FeatureDlg()
    ex.createFeatureTable(
        [("Color", [FeatureEntry("Banananananaana")]),
         ("Edge", [FeatureEntry("Mango"),
                   FeatureEntry("Cherry")])],
        [0.3, 0.7, 1, 1.6, 3.5, 5.0, 10.0])
    ex.setWindowTitle("FeatureTest")
    ex.setImageToPreView(None)
    ex.exec_()

    app.exec_()
Example #3
0
    from PyQt4.QtGui import QApplication
    from featureTableWidget import FeatureEntry

    app = QApplication(sys.argv)

    #    app.setStyle("windows")
    #    app.setStyle("motif")
    #    app.setStyle("cde")
    #    app.setStyle("plastique")
    #    app.setStyle("macintosh")
    #    app.setStyle("cleanlooks")

    ex1 = FeatureDlg()
    ex1.createFeatureTable(
        {
            "Color": [FeatureEntry("Banana")],
            "Edge": [FeatureEntry("Mango"),
                     FeatureEntry("Cherry")]
        }, [0.3, 0.7, 1, 1.6, 3.5, 5.0, 10.0])
    ex1.setWindowTitle("ex1")
    ex1.setImageToPreView(
        (numpy.random.rand(200, 200) * 256).astype(numpy.uint8))
    ex1.setIconsToTableWidget("icons/CheckboxFull.png",
                              "icons/CheckboxPartially.png",
                              "icons/CheckboxEmpty.png")
    #    print "table ", ex1.featureTableWidget.sizeHint()
    #    print "horiHeader", ex1.featureTableWidget.horizontalHeader().sizeHint()
    #    print "verticalHeader", ex1.featureTableWidget.verticalHeader().sizeHint().height()
    #    print "HHeader columnWidth ", ex1.featureTableWidget.columnWidth(6)
    #    print "tableHHeader ", ex1.featureTableWidget.horizontalHeaderItem(1).sizeHint()
    #    print "tableAndViewLayout ", ex1.tableAndViewLayout.sizeHint()