qradiobutton

PyQt5简介及demo

ⅰ亾dé卋堺 提交于 2020-11-11 04:26:34
PyQt5说明   pyqt5 是一套 Python 绑定 Digia QT5 应用的框架。它可用于 Python 2 和 3。本教程使用 Python 3。Qt 库是最强大的 GUI 库之一。pyqt5 的官方网站 http://www.riverbankcomputing.co.uk/news 。   pyqt5 做为 Python 的一个模块,它有 620 多个类和 6000 个函数和方法。这是一个跨平台的工具包,它可以运行在所有主要的操作系统,包括 UNIX,Windows,Mac OS。pyqt5 是双重许可。开发者可以在 GPL 和商业许可之间进行选择。   pyqt5 的类别分为几个模块,包括以下: QtCore:包含了核心的非 GUI 功能。此模块用于处理时间、文件和目录、各种数据类型、流、URL、MIME 类型、线程或进程。 QtGui:包含类窗口系统集成、事件处理、二维图形、基本成像、字体和文本。 QtWidgets:包含创造经典桌面风格的用户界面提供了一套UI元素的类。 QtMultimedia:包含的类来处理多媒体内容和 API 来访问相机和收音机的功能。 QtBluetooth:包含类的扫描设备和连接并与他们互动。描述模块包含了网络编程的类。这些类便于 TCP 和 IP 和 UDP 客户端和服务器的编码,使网络编程更容易和更便携。 QtNetwork

Qt开源作品9-扁平化样式flatui

為{幸葍}努か 提交于 2020-08-11 18:08:43
一、前言 对于现在做前端开发人员来说,FlatUI肯定不陌生,最近几年扁平化的设计越来越流行,大概由于现在PC端和移动端的设备的分辨率越来越高,扁平化反而看起来更让人愉悦,而通过渐变色产生的质感色彩反而没有扁平化来得亲切。 Flat UI是基于Bootstrap之上进行二次开发的扁平化前端框架,他提供了动感、时尚的风格色调搭配,简洁、炫丽的功能组件,同时还提供了更为平滑的js交互动画,可以称得上前端扁平化设计框架的优秀代表之一。 既然是扁平化设计框架的优秀代表,当然需要在自己项目中应用应用,本人最早使用VB开发,而后转为C#开发,最后转为Qt开发,都是因为公司项目需要,根据需要不断学习新的编程框架,语言都是相通的,举一反三,以前用C#写的vista时钟控件和vista日历控件,稍微改改就转移成了Qt写的对应控件,非常方便,只要掌握了思想,熟练了一门语言和框架之后,其他的学起来特别快。 Qt中的qss机制,和css极为相似,感觉就是脱胎于css,用qss来实现Qt界面样式不是一般的方便,而是相当的爽,在看到FlatUI这样的精美的扁平化设计样式后,难以抑制手痒痒,就想用qss实现类似的风格。 二、代码思路 QString FlatUI::setPushButtonQss(QPushButton *btn, int radius, int padding, const QString

PYQT5学习(12)Qtabwidget 选项卡及其窗口,Qstackedwidget和Qtabwidget的效果类似,以及系统托盘QsystemtrayIcon

随声附和 提交于 2020-04-27 05:38:12
参考博文:https://blog.csdn.net/jia666666/article/details/81669092 QTabWidget控件提供一个选项卡和一个页面区域,默认显示第一个选项卡的页面 通过点击各选项卡可以查看相应的界面,如果在一个窗口中显示输入字很多,则可 以对这些字段进行拆分,分别放置在不同界面的选项卡中 流程:1,创建一个QtabWidget 2.为选项卡对话框中的每个页面创建一个QWidget,但不要为它们制定父窗口小部件 3,将子窗口的小部件插入到页面窗口小部件中,使用布局为其定位 4,调用addTab()或insertTab()将页面小部件放入选项卡小部件,为每个选项 卡提供一个带有可选键盘快捷键的合适标签 import sys from PyQt5.QtWidgets import QWidget,QApplication,QGridLayout,QRadioButton,QVBoxLayout,QTabWidget,QFormLayout,QLabel,QLineEdit class Tab(QTabWidget): def __init__(self): super().__init__() self.tab1=QWidget() self.tab2=QWidget() self.tab3=QWidget() self.addTab(self

Qt - iterating through QRadioButtons

女生的网名这么多〃 提交于 2020-01-04 04:12:10
问题 I have a group project for school that I am working on. A member of my group has created a window that has ~75 radio buttons. I want to force all of them to be "clear" or "unchecked" on a button press. Does anyone know a good way to go about doing this? I have been looking into QObjectList but I can't simply do QObjectList *children = new QObjectList(ui->groupBox->children()); and loop them using a for loop as QObjectList does not appear to have a next method.. I have also tried to do

How to randomize the order of radio buttons in pyqt

拈花ヽ惹草 提交于 2019-12-25 07:41:59
问题 im making a quiz and i want the radiobuttons to be in different positions. ive got it working to a extent as it would be in random order in the first question however it would then stay in that order for the rest of the quiz. I want it to randomize every time. class MultipleChoice(QtGui.QWidget): showTopicsSignal = pyqtSignal() def __init__(self,parent=None): super(MultipleChoice, self).__init__(parent) self.initUI() def initUI(self): self.Questions=[] self.Questionum = QLabel() self

QT5 Radio button signal not compatible with function, even though it should be

萝らか妹 提交于 2019-12-20 02:58:06
问题 According to the QT5 docs, the QRadioButton inherits the 4 signals from QAbstractButton, which includes the clicked signal. The template for it is clicked(bool checked = false) so I'm confused why this code returns a long error message, part of which is error: static assertion failed: Signal and slot arguments are not compatible . Code (Simplified, may contain mistakes that are not part of the original): #include <QApplication> #include <QMainWindow> #include <QRadioButton> #include <iostream

Unable to click on QRadioButton after linking it with QtCore.QEventLoop()

夙愿已清 提交于 2019-12-13 22:14:56
问题 Few days back i had situation where i had to check/uncheck QRadioButton in for loop. Here is the link Waiting in for loop until QRadioButton get checked everytime? After implementing QEventLoop on this, it worked fine until today. Now i have seen my QRadioButton(pass) button allow me to click on it but not the second QRadioButton(fail). Fail QRadioButton neither gets hang nor disable but its just i am not able to click on it. My QEventLoop code is : #QLoopEvent self.loop = QtCore.QEventLoop()

Qt Designer UI (python) to JSON

家住魔仙堡 提交于 2019-12-12 03:47:15
问题 I recently started using qt to build a python GUI. I have two problems I can't quite find the solutions to. the code below is a sample of what I need to build. 1: Check which radio button from a list of radio buttons in a vertical layout has been clicked. In the GUI it only selects one radio button out of all others available in the layout. How do I perceive which has been clicked? 2:I would like to add the clicked value to a JSON object but I believe that is a simple if statement of if this