#!/usr/bin/env python# -*- coding:utf-8 -*-import sys
from PyQt5 import uic
from PyQt5.QtWidgets import QMainWindow, QApplication, QWidgetAction, QAction, QToolButton
FORM_CLASS, _ = uic.loadUiType('./ui/main.ui')
class MainForm(QMainWindow, FORM_CLASS):
def __init__(self, parent=None):
super().__init__(parent)
self.setupUi(self)
self.toolbar = self.addToolBar(u'툴바')
self._ac1 = QAction(u'액숀1', self)
self._ac1.triggered.connect(self._action_01)
self._ac2 = QAction(u'액숀2', self)
self._ac2.triggered.connect(self._action_02)
self._tb1 = QToolButton(self)
self._tb1.addAction(self._ac1)
self._tb1.addAction(self._ac2)
self._tb1.setPopupMode(QToolButton.InstantPopup)
self._tb1.setDefaultAction(self._ac1)
self.toolbar.addWidget(self._tb1)
def _action_01(self):
self._tb1.setDefaultAction(self._ac1)
def _action_02(self):
self._tb1.setDefaultAction(self._ac2)
if __name__ == '__main__':
app = QApplication(sys.argv)
w = MainForm()
w.show()
sys.exit(app.exec())
2018년 10월 25일 목요일
[PyQt5] QToolButton example
피드 구독하기:
댓글 (Atom)
docker redmine 설치
docker-composer.yml version: '3.1' services: redmine: image: redmine restart: always container_na...
-
용량이 큰 파일 업로드 시 net::ERR_CONNECTION_RESET 오류 발생할 경우. http_server = tornado.httpserver.HTTPServer(app, max_buffer_size=10485760000) upload_for...
-
# !-*- coding:utf-8 -*- import os import sys from PyQt5 import uic from PyQt5.QtCore import Qt from PyQt5.QtWidgets import QDialog , QAppl...
-
for _row in cur: if isinstance(elem, cx_Oracle.LOB) or isinstance(elem, cx_Oracle.CLOB) or isinstance( elem, cx_Oracle.BLO...
댓글 없음:
댓글 쓰기