Advertisement
Guest User

Untitled

a guest
Jan 17th, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.89 KB | None | 0 0
  1. #!/usr/bin/python3
  2. # -*- coding: utf-8 -*-
  3.  
  4. import sys
  5. from PyQt5.QtWidgets import QApplication, QWidget, QPushButton, QMainWindow, QTextEdit, QAction
  6. from PyQt5.QtGui import QIcon
  7. from base import Scanbase
  8. from simple_base import TwainBase
  9. from twain import *
  10. '''quin importa?'''
  11.  
  12. class ScanGui(QMainWindow, QWidget, Scanbase, TwainBase):
  13.  
  14. def __init__(self):
  15. super().__init__()
  16.  
  17. self.initUi()
  18.  
  19. def initUi(self):
  20.  
  21. textEdit = QTextEdit()
  22. self.setCentralWidget(textEdit)
  23. exitAction = QAction(QIcon('./images/exit.png'), 'Exit', self)
  24. exitAction.setShortcut('Ctrl+Q')
  25. exitAction.setStatusTip('Exit application')
  26. exitAction.triggered.connect(self.close)
  27.  
  28. self.statusBar()
  29.  
  30. menubar = self.menuBar()
  31. fileMenu = menubar.addMenu('&File')
  32. fileMenu.addAction(exitAction)
  33.  
  34. toolbar = self.addToolBar('Exit')
  35. toolbar.addAction(exitAction)
  36. toolbar.addAction(QAction(QIcon('./images/copy.png'), 'Exit', self))
  37. toolbar.addAction(QAction(QIcon('./images/back.png'), 'Exit', self))
  38. toolbar.addAction(QAction(QIcon('./images/plus.png'), 'Exit', self))
  39. toolbar.addAction(QAction(QIcon('./images/printer.png'), 'Exit', self))
  40. toolbar.addAction(QAction(QIcon('./images/question.png'), 'Exit', self))
  41.  
  42.  
  43. btn = QPushButton('Open Scanner', self)
  44. btn.clicked.connect(self.openScan)
  45. btn.resize(btn.sizeHint())
  46.  
  47. btn_scan = QPushButton('Scan', self)
  48. btn_scan.resize(btn.sizeHint())
  49. btn_scan.move(80, 0)
  50.  
  51. self.setWindowTitle('Scan')
  52. self.setWindowIcon(QIcon('./images/scan.png'))
  53.  
  54. self.show()
  55.  
  56. if __name__ == '__main__':
  57.  
  58. app = QApplication(sys.argv)
  59. ex = ScanGui()
  60.  
  61. '''window = QWidget()
  62. window.resize(250, 150)
  63. window.move(300, 300)
  64. window.setWindowTitle('Scan')
  65. window.show()'''
  66.  
  67. sys.exit(app.exec_())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement