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
import sys | |
from PyQt4.QtGui import * | |
from PyQt4.QtCore import * | |
def process(text): | |
# Emulate processing | |
return [c for c in text] | |
class Widget(QWidget): |
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
import sys | |
from PyQt4.QtCore import * | |
from PyQt4.QtGui import * | |
class TableWidget(QTableWidget): | |
def __init__(self, *args, **kwargs): | |
QTableWidget.__init__(self, *args, **kwargs) |
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 "frame.h" | |
#include <QPainter> | |
frame::frame(QWidget *parent) : QFrame(parent) | |
{ | |
} | |
void frame::paintEvent(QPaintEvent *p) |
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
import sys | |
from PyQt5.QtWidgets import * | |
from PyQt5.QtCore import * | |
from PyQt5.QtGui import * | |
import cv2 | |
class ShowVid(QObject): | |
signal = pyqtSignal(QImage) | |
def __init__(self): |
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
#------------------------------------------------- | |
# | |
# Project created by QtCreator 2017-09-17T11:02:01 | |
# | |
#------------------------------------------------- | |
QT += core gui | |
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets sql |
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
import sys | |
from PyQt5 import QtCore, QtSql, QtWidgets, QtGui | |
class SqlTableModel(QtSql.QSqlTableModel): | |
ExecuteRole = QtCore.Qt.UserRole + 1 | |
def __init__(self, parent=None, db = QtSql.QSqlDatabase()): | |
QtSql.QSqlTableModel.__init__(self, parent, db) | |
self.d = {} |
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
import sys | |
from PyQt5.QtCore import * | |
from PyQt5.QtGui import * | |
from PyQt5.QtWidgets import * | |
class FadeWidget(QWidget): | |
def __init__(self, parent = None): | |
QWidget.__init__(self, parent) | |
self._heightMask = self.height() |
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
from random import random, randint | |
from PyQt5.QtCore import QAbstractListModel, Qt, QModelIndex, QVariant, QCoreApplication, QPointF, QUrl, QByteArray, \ | |
QTimer | |
from PyQt5.QtGui import QColor, QGuiApplication | |
from PyQt5.QtQml import QQmlApplicationEngine | |
class MarkerItem(object): | |
def __init__(self, position, color=QColor("red")): |
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
from PyQt5 import QtCore, QtGui, QtWidgets | |
class Ui_MainWindow(object): | |
def setupUi(self, MainWindow): | |
self.keyworddict = {} | |
self.count = {} | |
MainWindow.setObjectName("MainWindow") | |
MainWindow.resize(698, 581) | |
MainWindow.setMinimumSize(QtCore.QSize(698, 581)) | |
MainWindow.setMaximumSize(QtCore.QSize(698, 581)) |
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
from math import * | |
def f(x: float) -> float: | |
return exp(x) - sin(x) | |
def secant(x0: float, x1: float, f, epsilon: float, delta: float, iter_max: int) -> float: | |
fx0 = f(x0) | |
fx1 = f(x1) | |
print("{0} {1:.20f} {2:.20f}".format(0, x0, fx0)) | |
if iter_max == 0: |