Hello World / plɹoM ollǝH

Programmers Live in Vain

2017-02-01から1ヶ月間の記事一覧

QMessageBoxでチョロっとダイアログ表示

import sys from PySide import QtGui app = QtGui.QApplication(sys.argv) icon = None QtGui.QMessageBox.about(icon, 'About', 'Hello.') QtGui.QMessageBox.question(icon, 'Question', 'Are you dead?', QtGui.QMessageBox.Yes | QtGui.QMessageBox.No)…

Pythonでウインドウハンドル取得してGetClientRectしてみる

WIN32から離れられない貴方へ import sys from PySide import QtGui import ctypes class RECT(ctypes.Structure): _fields_ = [('left', ctypes.c_long), ('top', ctypes.c_long), ('right', ctypes.c_long), ('bottom', ctypes.c_long)] class TestWidget(…

Widgetを等倍で中央寄せさせておきたい!

QScrollAreaのresizeEventを継承してゴニョゴニョしたら割と簡単にできた import sys from PySide import QtCore, QtGui class AlwaysCenterAlign(QtGui.QScrollArea): def __init__(self): super().__init__() self.setAlignment(QtCore.Qt.AlignCenter) se…