qbuttongroup

subclassing QGroupBox so that it can be member of QButtonGroup

谁都会走 提交于 2020-06-01 06:49:32
问题 QButtonGroups can have checkboxes. But you cannot add them to a QButtonGroup because they do not inherit QAbstractButton. It would be really nice for some UIs to be able to have a few QGroupBoxes with exclusive checkboxes. That is, you check one and the other QGroupBoxes are automatically unchecked. In an ideal world, I could do something like this: import sys from PyQt5.QtCore import Qt from PyQt5.QtWidgets import (QGroupBox, QWidget, QApplication, QAbstractButton, QButtonGroup) class

Qt5 - QML: Button does not show up after triggered

家住魔仙堡 提交于 2020-01-25 11:10:37
问题 I am writing a project that is using Qt5-QML . In order to shrink the problem I prepared a small example that replicates the problem. 1) I have an application on a Page1 . That carries a Button as shown in the below print screen below: 2) After the user pushes the button goes on Page2 shown below which carries different Buttons . Let's say Button A it is the user's choice: 3) The final screen represented by Page1 is the correct choice, which is the the button selected The problem I have is

PyQt5 QTableWidget cell select, save and copy

て烟熏妆下的殇ゞ 提交于 2020-01-24 20:14:50
问题 As extension to my previous question I add a copy_button. When user enter input to cells, and user would like select a row, and click on copy_button to copy contents and add an new row below the selected row with same content. The code below supposes to do the job it adds a new row as user wants, expect from its contents is not copying with? I tried to print to see the problem. I add Qtablewidget items to empty list, then the list is printed before for loop, sees it has content added to it.

QButtonGroup not making checkboxes exclusive

我的未来我决定 提交于 2019-12-11 07:03:34
问题 I am attempting to make a set of exclusive checkboxes, using QGroupBox (which, as I understand it, is exclusive by default), but when I run my program, the checkboxes are not exclusive and behave as they normally would. skillP = QCheckBox("Passive") skillCb = QCheckBox("Combat") skillCm = QCheckBox("Command") skillP.setChecked(True) addskillG = QButtonGroup() addskillG.addButton(skillP) addskillG.addButton(skillCm) addskillG.addButton(skillCb) Is there anything I'm doing wrong? 回答1: The