Skip to content

Instantly share code, notes, and snippets.

View eyllanesc's full-sized avatar
:octocat:
I may be slow to respond.

Edwin Yllanes eyllanesc

:octocat:
I may be slow to respond.
View GitHub Profile
@eyllanesc
eyllanesc / QLABEL2.py
Last active August 8, 2017 20:02
QLabel_alterada
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
class QLabel_alterada(QLabel):
clicked=pyqtSignal()
def __init__(self, parent=None):
QLabel.__init__(self, parent)
print("test")
@eyllanesc
eyllanesc / Plotter.py
Last active August 8, 2017 23:23
Plotter
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import pandas as pd
from PyQt5.QtCore import QRegularExpression, pyqtSignal
from PyQt5.QtGui import QIcon, QRegularExpressionValidator, QValidator
from PyQt5.QtWidgets import QTableWidget, QApplication, QTableWidgetItem, QMenu, QInputDialog, QLineEdit, QMainWindow, \
QDialog, QVBoxLayout, QLabel, QHBoxLayout, QComboBox, QToolButton, QPushButton, QSpacerItem, QSizePolicy, \
QWidget, QFileDialog, QDialogButtonBox
@eyllanesc
eyllanesc / LedWidget.py
Last active August 13, 2017 01:03
Promoted Widgets
from PyQt5.QtCore import QSize, Qt
from PyQt5.QtGui import QPainter, QColor
from PyQt5.QtWidgets import QLabel, QWidget, QVBoxLayout, QApplication
class Led(QWidget):
def __init__(self, colorOn, colorOff, parent=None):
QLabel.__init__(self, parent)
self.colorOn = colorOn
self.colorOff = colorOff
@eyllanesc
eyllanesc / Elements.py
Created August 13, 2017 19:27
You have to enable the ItemIsSelectable flag: self.setFlag(QGraphicsItem.ItemIsSelectable, True)
from PySide.QtCore import *
from PySide.QtGui import *
rad = 5
class WindowClass(QMainWindow):
def __init__(self):
super(WindowClass, self).__init__()
self.view = ViewClass()
@eyllanesc
eyllanesc / index.html
Created August 15, 2017 13:04
OpenLayers Geolocation in PyQt 5.9
<!DOCTYPE html>
<html>
<head>
<title>Accessible Map</title>
<link rel="stylesheet" href="https://openlayers.org/en/v4.2.0/css/ol.css" type="text/css">
<!-- The line below is only needed for old environments like Internet Explorer and Android 4.x -->
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=requestAnimationFrame,Element.prototype.classList,URL"></script>
<script src="https://openlayers.org/en/v4.2.0/build/ol-debug.js"></script>
<script type="text/javascript" src="https://getfirebug.com/firebug-lite.js"></script>
<style>
@eyllanesc
eyllanesc / TestQML.pro
Last active August 19, 2017 02:55
Test
TEMPLATE = app
QT += qml quick
CONFIG += c++11
SOURCES += main.cpp \
boot.cpp
RESOURCES += qml.qrc
@eyllanesc
eyllanesc / Button.qml
Last active August 20, 2017 05:46
TestImage
import QtQuick 2.0
Rectangle {
color: "red"
signal signalCplusplus();
Text{
text: Vendor
}
MouseArea {
@eyllanesc
eyllanesc / inventory.py
Last active August 21, 2017 07:15
inventory
from PyQt4 import QtSql
from PyQt4 import QtCore, QtGui
import sqlite3
import subprocess
import sys
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
def _fromUtf8(s):
@eyllanesc
eyllanesc / main.py
Created August 21, 2017 21:29
Embedding QDialog in QWidget
from PyQt5.QtWidgets import *
from PyQt5.QtCore import *
class MainWindow(QWidget):
def __init__(self):
super(MainWindow, self).__init__()
self.setWindowTitle("My own MainWindow")
self.fileDialog = QFileDialog(self)
QT += core
QT -= gui
QT += network
CONFIG += c++11
TARGET = DropboxDownload
CONFIG += console
CONFIG -= app_bundle