Skip to content

Instantly share code, notes, and snippets.

View elpuri's full-sized avatar

Juha Turunen elpuri

View GitHub Profile
@elpuri
elpuri / gist:3753756
Created September 20, 2012 03:12
A collapsible nested list example in QML
import QtQuick 1.1
Item {
width: 200
height: 300
ListView {
anchors.fill: parent
model: nestedModel
delegate: categoryDelegate
entity serial_tx is
Port (
clk_50 : in STD_LOGIC;
reset : in std_logic;
tx : out STD_LOGIC;
tx_idle : out std_logic;
din : in STD_LOGIC_VECTOR(7 downto 0);
din_strobe : in STD_LOGIC
@elpuri
elpuri / serial_rx.vhdl
Created August 13, 2011 22:03
VHDL serial rx
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity serial_rx is
port (
clk_50 : in std_logic;
rx : in std_logic;
@elpuri
elpuri / main.qml
Created August 13, 2011 12:04
Minimal camera roll for Harmattan/MeeGo
import QtQuick 1.1
import com.meego 1.0
import QtMobility.gallery 1.1
Item {
id: root
width: screen.width
height: screen.height
GridView {
@elpuri
elpuri / NavigationBar.qml
Created January 26, 2011 01:18
KittyApp v2
import Qt 4.7
Rectangle {
....
Row {
anchors.fill: parent
NavigationButton {
id: kittyButton
import Qt 4.7
Loader {
property bool keepLoaded : true
property url viewSource
anchors.top: parent.top
anchors.bottom: parent.bottom
width: parent.width
opacity: 0
@elpuri
elpuri / Button.qml
Created December 28, 2010 19:36
A button component in QML
import Qt 4.7
BorderImage {
id: buttonbase
signal clicked
property int hitboxExtension : 20
property alias text : label.text
property bool pressed: hitbox.pressed && hitbox.containsMouse
@elpuri
elpuri / main.cpp
Created December 27, 2010 19:52
Enabling hardware accelerated painting on Qt
int main(int argc, char *argv[])
{
QApplication::setGraphicsSystem("openvg"); // Use "opengl" for systems not supporting OpenVG
QApplication a(argc, argv);
@elpuri
elpuri / SymbianFontLoader.h
Created December 27, 2010 18:51
Small utility class for loading custom fonts on Symbian
/*
Juha Turunen ([email protected]), 2010
Use freely in any commercial or non-commercial way. All rights waived.
More Qt/QtQuick/Symbian stuff at: http://www.juhaturunen.com/blog/
Instructions:
- You need to link to a few Symbian DLLs. Add this line to your applications .pro file:
symbian { LIBS += -lcone -lws32 -lbafl -legul }
- Deploy your font files to a place where the Symbian font and bitmap server can read them.
@elpuri
elpuri / hello.qml
Created December 26, 2010 18:52
Minimal Qt app that runs a QML file
import Qt 4.7
Rectangle {
width: 360
height: 640
color: "#000000"
Rectangle {
height: 80