023 QObject signal operation API
Resources: Python-GUI-PyQ5 general overview.xmind;QObject.xmind
1, destroyed(obj): this signal is sent when the object is destroyed (widget. Signal. Connect: connect signal and slot)
from PyQt5.Qt import *
class Window(QWidget):
def __init__(self):
super().__init__()
self.setW ...
Added by seby on Sat, 22 Feb 2020 19:33:32 +0200
Lesson 12 - calculator core analysis algorithm (I)
1. Suffix expression
Example:
2. Calculator core algorithm
Solutions
1. Separate infix expression from number and operator
2. Convert infix expression to suffix expression
3. Calculate the final result by suffix expression
3. Separation algorithm idea
Initial num variable is empty, scan stringIf a number or decima ...
Added by wardo on Sat, 15 Feb 2020 22:07:31 +0200
Qt Database - Display data in TableView
Qt Assistant Keyword: Presenting Data in a Table View
Qt Version 5.14.0
The three classes QSqlQueryModel, QSqlTableModel and QSqlRelationalTableModel can be used as data sources for Qt View related display classes, such as QTableView, QListView and QTreeView.The most common should be the QTableView, because the resulting dataset of an SQL state ...
Added by LostOne on Sat, 01 Feb 2020 19:34:42 +0200
PyQt5 quick start basic chapter 5-messagebox usage
Preface
In this section, we will introduce how to use messagebox, which can be used in message prompt box, warning box, inquiry box, error, about and other conversation boxes.
1, Basic knowledge
1. Introduction to MessageBox
Message box is a message session box, which can prompt the user with key messages and obtain the user's selection, so as ...
Added by Singularity on Sat, 01 Feb 2020 17:35:46 +0200
[QT] QT realizes the function of dragging and copying files
QT realizes the function of dragging and copying files
Catalog
1. Add header file
2. Add. h file code
3. Add. cpp file code
Copy files and folders
Set mouse hover style
4. effect
1. Add header file
#include <QDragEnterEvent>
#include <QUrl>
#include <QMimeData>
#include &l ...
Added by legio on Mon, 20 Jan 2020 20:06:13 +0200
PyQt (Python+Qt) Learning Notes: Two standard models in the model/view architecture, QStandardItemModel and QFileSystemModel
Ape Python blog catalog
Column: Developing GUI Python applications using PyQt
Ape Python Blog Address
1. Standard Model in PyQt
PyQt and Qt provide two standard models, QStandardItemModel and QFileSystemModel.QStandardItemModel is a multipurpose model that can be used to represent various data struc ...
Added by RobOgden on Sun, 19 Jan 2020 04:00:42 +0200
QT event handling
Mouse events
Mouse events include mouse movement, mouse button press, release, click, and double-click.
Include header file when using < qmouseevent >
The mouse movement event response is realized by redefining mouseMoveEvent(QMouseEvent *e) function
e->x();e->y(); // Get the relative position of the mouse
The m ...
Added by notsleepy on Mon, 23 Dec 2019 17:04:01 +0200
PyQt5 note 7 -- multiple class sharing signals
PyQt5 note 7 – multiple classes sharing signals
1. Signal transmission
Custom signal in main window class and binding slot function in constructor
Pass the object of the main window when instantiating the dialog class
Customize the signal in the dialog box and bind the slot function in the constructor to the signal ...
Added by snowgirl on Wed, 11 Dec 2019 23:29:35 +0200
[pyqt5 QT designer] dialog series
Standard input dialog series:
Main module
from PyQt5.QtWidgets import QInputDialog
The effect is as follows:
Full code:
from PyQt5.QtWidgets import (QApplication, QWidget, QPushButton, QLabel, QInputDialog, QTextBrowser,QGridLayout)
import sys
from PyQt5.QtGui import QIcon
class Example(QWidget):
def __init__(self):
super()._ ...
Added by universelittle on Mon, 02 Dec 2019 22:58:14 +0200
QT program start animation
Sketch
Many of the software we use everyday has startup animation, for example, Visual Studio and PyCharm have a process of loading various components before opening the software. Their startup animation tells you that the program is opening and loading components, rather than letting you think the program is not started.
...
Added by Pha on Sun, 01 Dec 2019 01:32:16 +0200