def METHOD_NAME(self, dialog_class):
    # Bug: In the Qt backend, resizing a checkbox element with a label on
    # the right resizes the checkbox, even though it cannot be.
    # The final effect is that the label remains attached to the right
    # margin, with a big gap between it and the checkbox. In this case, the
    # label should be made resizable instead.
    # On the other hand, a text element should keep the current behavior
    # and resize.
    from pyface import qt
    with reraise_exceptions(), create_ui(dialog_class()) as ui:
        # all labels
        labels = ui.control.findChildren(qt.QtGui.QLabel)
        # the checkbox and its label should be close to one another; the
        # size of the checkbox should be small
        checkbox_label = labels[0]
        checkbox = ui.control.findChild(qt.QtGui.QCheckBox)
        # horizontal space between checkbox and label should be small
        h_space = checkbox_label.x() - checkbox.x()
        self.assertLess(h_space, 100)
        # and the checkbox size should also be small
        self.assertLess(checkbox.width(), 100)
        # the text item and its label should be close to one another; the
        # size of the text item should be large
        text_label = labels[0]
        text = ui.control.findChild(qt.QtGui.QLineEdit)
        # horizontal space between text and label should be small
        h_space = text_label.x() - text.x()
        self.assertLess(h_space, 100)
        # and the text item size should be large
        self.assertGreater(text.width(), _DIALOG_WIDTH - 200)
        # the size of the window should still be 500
        self.assertEqual(ui.control.width(), _DIALOG_WIDTH)