here is a recently tried by me approach, which appears to be coolest thing since sliced bread.

Code speaks louder than words.
Here I go:

use Inline Python => <<'EOS'; from PyQt4 import QtCore, QtGui class Window(QtGui.QWidget): def __init__(self, parent=None): super(Window, self).__init__(parent) grid = QtGui.QGridLayout() grid.addWidget(self.createFirstExclusiveGroup(), 0, 0) grid.addWidget(self.createSecondExclusiveGroup(), 1, 0) grid.addWidget(self.createNonExclusiveGroup(), 0, 1) grid.addWidget(self.createPushButtonGroup(), 1, 1) self.setLayout(grid) self.setWindowTitle("Group Box") self.resize(480, 320) def createFirstExclusiveGroup(self): groupBox = QtGui.QGroupBox("Exclusive Radio Buttons") radio1 = QtGui.QRadioButton("&Radio button 1") radio2 = QtGui.QRadioButton("R&adio button 2") radio3 = QtGui.QRadioButton("Ra&dio button 3") radio1.setChecked(True) vbox = QtGui.QVBoxLayout() vbox.addWidget(radio1) vbox.addWidget(radio2) vbox.addWidget(radio3) vbox.addStretch(1) groupBox.setLayout(vbox) return groupBox def createSecondExclusiveGroup(self): groupBox = QtGui.QGroupBox("E&xclusive Radio Buttons") groupBox.setCheckable(True) groupBox.setChecked(False) radio1 = QtGui.QRadioButton("Rad&io button 1") radio2 = QtGui.QRadioButton("Radi&o button 2") radio3 = QtGui.QRadioButton("Radio &button 3") radio1.setChecked(True) checkBox = QtGui.QCheckBox("Ind&ependent checkbox") checkBox.setChecked(True) vbox = QtGui.QVBoxLayout() vbox.addWidget(radio1) vbox.addWidget(radio2) vbox.addWidget(radio3) vbox.addWidget(checkBox) vbox.addStretch(1) groupBox.setLayout(vbox) return groupBox def createNonExclusiveGroup(self): groupBox = QtGui.QGroupBox("Non-Exclusive Checkboxes") groupBox.setFlat(True) checkBox1 = QtGui.QCheckBox("&Checkbox 1") checkBox2 = QtGui.QCheckBox("C&heckbox 2") checkBox2.setChecked(True) tristateBox = QtGui.QCheckBox("Tri-&state button") tristateBox.setTristate(True) tristateBox.setCheckState(QtCore.Qt.PartiallyChecked) vbox = QtGui.QVBoxLayout() vbox.addWidget(checkBox1) vbox.addWidget(checkBox2) vbox.addWidget(tristateBox) vbox.addStretch(1) groupBox.setLayout(vbox) return groupBox def createPushButtonGroup(self): groupBox = QtGui.QGroupBox("&Push Buttons") groupBox.setCheckable(True) groupBox.setChecked(True) self.pushButton = QtGui.QPushButton("&Normal Button") toggleButton = QtGui.QPushButton("&Toggle Button") toggleButton.setCheckable(True) toggleButton.setChecked(True) flatButton = QtGui.QPushButton("&Flat Button") flatButton.setFlat(True) popupButton = QtGui.QPushButton("Pop&up Button") menu = QtGui.QMenu(self) menu.addAction("&First Item") menu.addAction("&Second Item") menu.addAction("&Third Item") menu.addAction("F&ourth Item") popupButton.setMenu(menu) newAction = menu.addAction("Submenu") subMenu = QtGui.QMenu("Popup Submenu", self) subMenu.addAction("Item 1") subMenu.addAction("Item 2") subMenu.addAction("Item 3") newAction.setMenu(subMenu) vbox = QtGui.QVBoxLayout() vbox.addWidget(self.pushButton) vbox.addWidget(toggleButton) vbox.addWidget(flatButton) vbox.addWidget(popupButton) vbox.addStretch(1) groupBox.setLayout(vbox) self.pushButton.clicked.connect(perl.qwerty); toggleButton.clicked.connect(perl.qwertyT); return groupBox app = QtGui.QApplication([]) def get_app(): return app; def init_clock_window(): clock = Window() clock.show() return clock EOS my $app = get_app(); my $w = init_clock_window(); sub qwerty { print "eyeye!!!\n"; $w->{pushButton}->setText('['.$w->{pushButton}->text().']'); } sub qwertyT { print "foo bar fluffy\n"; } $app->exec_();

runs just fine, wow...
As for today - when there is no usable PerlQT on CPAN - this brings tons of possibilities.

Yep, python is a nice lib... Long live Inline::Python !


In reply to perl + Qt, the easy way by vkon

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.