Skip to content

Instantly share code, notes, and snippets.

View Riateche's full-sized avatar

Pavel Strakhov Riateche

  • Moscow Institute of Physics and Technology
  • Moscow
View GitHub Profile
@Riateche
Riateche / sync_publish.sh
Last active October 17, 2020 15:37
Wait after publish on crates.io
#!/bin/bash
# Usage: sync_publish /path/to/crate -f
#
# Publish a crate and wait for it to become available.
set -e
set -o pipefail
TMP_DIR=/tmp/test1
$ cd /tmp/
$ cargo new x1
warning: compiling this new crate may not work due to invalid workspace configuration
failed to read `/tmp/cpp_to_rust/cpp_to_rust_generator/Cargo.toml`
Created library `x1` project
$ cd x1
$ cargo update
error: failed to read `/tmp/qt_generator/qt_generator/Cargo.toml`
[package]
name = "test2"
version = "0.1.0"
authors = ["ri"]
[dependencies]
sdl2 = "0.11"
sdl2_image = "0.4"
#include "qxtspanslider.h"
/****************************************************************************
** Copyright (c) 2006 - 2011, the LibQxt project.
** See the Qxt AUTHORS file for a list of authors and copyright holders.
** All rights reserved.
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
@Riateche
Riateche / 1.pro
Last active December 12, 2020 18:36
#-------------------------------------------------
#
# Project created by QtCreator 2013-09-26T13:32:37
#
#-------------------------------------------------
QT += core gui network testlib
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
#include "MainWindow.h"
#include "ui_MainWindow.h"
#include <QDebug>
#include <QFile>
#include <QRubberBand>
#include <QSizeGrip>
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
#include "CalendarFilterModel.h"
#include <QTableView>
#include <QDebug>
#include <QStyledItemDelegate>
QObject* find_child_by_class(QObject* parent, const QString& class_name) {
foreach(QObject* object, parent->findChildren<QObject*>()) {
if (object->metaObject()->className() == class_name) {
return object;
}
import sip
sip.setapi('QString', 2)
sip.setapi('QVariant', 2)
from PyQt4 import QtCore, QtGui
class TableModel(QtCore.QAbstractTableModel):
"""
A simple 5x4 table model to demonstrate the delegates
#include "window.h"
#include <QKeyEvent>
#include <QtCore/QRegExp>
#include <QtGui/QMessageBox>
#include <QGraphicsTextItem>
#include <QFont>
#include <QTransform>
#include <QTimeLine>
#include <QGraphicsItemAnimation>
#include <QDebug>