Last active
January 5, 2016 10:09
-
-
Save coldnew/47ca9a14eb24df14950b to your computer and use it in GitHub Desktop.
Qt example for tarentella
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <QApplication> | |
| #include <QStringList> | |
| #include <QListWidget> | |
| #include <QRadioButton> | |
| int main(int argc, char *argv[]) | |
| { | |
| QApplication app(argc, argv); | |
| QListWidget *listWidget = new QListWidget(); | |
| listWidget->addItem("A"); | |
| listWidget->addItem("B"); | |
| QListWidgetItem *it; | |
| it = new QListWidgetItem(listWidget); | |
| listWidget->setItemWidget(it, new QRadioButton("Item 1")); | |
| it = new QListWidgetItem(listWidget); | |
| listWidget->setItemWidget(it, new QRadioButton("Item 2")); | |
| listWidget->show(); | |
| return app.exec(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| from PyQt5.QtWidgets import * | |
| class UI(QListWidget): | |
| def __init__(self, parent=None): | |
| super(UI, self).__init__(parent) | |
| self.addItem("A") | |
| self.addItem("B") | |
| it = QListWidgetItem(self); | |
| self.setItemWidget(it, QRadioButton("Item 1")) | |
| it = QListWidgetItem(self); | |
| self.setItemWidget(it, QRadioButton("Item 2")) | |
| if __name__ == '__main__': | |
| import sys | |
| app = QApplication(sys.argv) | |
| screen = UI() | |
| screen.show() | |
| sys.exit(app.exec_()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

