Inital commit. Sorta kinda has a menu bar with option to open a cbz file. It then opens the first image in the default image viewer. Working on getting 'next' button added.

This commit is contained in:
Dan
2020-08-22 21:51:43 -04:00
commit 41458e3285
5 changed files with 212 additions and 0 deletions

20
qt/main.py Normal file
View File

@@ -0,0 +1,20 @@
import sys
import readergui as rg
from PyQt5.QtWidgets import QMainWindow, QApplication
from PyQt5.QtCore import Qt
class Window(QMainWindow):
def __init__(self):
super(Window, self).__init__()
self.ui = rg.Ui_MainWindow()
self.ui.setupUi(self)
self.ui.nextButton.clicked.connect(self.but_test)
def but_test(self):
print("button clicked")
if __name__ == '__main__':
app = QApplication(sys.argv)
window = Window()
window.show()
sys.exit(app.exec())

81
qt/reader.ui Normal file
View File

@@ -0,0 +1,81 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>480</width>
<height>640</height>
</rect>
</property>
<property name="windowTitle">
<string>MainWindow</string>
</property>
<widget class="QWidget" name="centralwidget">
<widget class="QGraphicsView" name="mainImage">
<property name="geometry">
<rect>
<x>10</x>
<y>10</y>
<width>461</width>
<height>511</height>
</rect>
</property>
</widget>
<widget class="QDialogButtonBox" name="testBox">
<property name="geometry">
<rect>
<x>70</x>
<y>140</y>
<width>174</width>
<height>34</height>
</rect>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
<widget class="QWidget" name="">
<property name="geometry">
<rect>
<x>10</x>
<y>550</y>
<width>461</width>
<height>36</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QPushButton" name="backButton">
<property name="text">
<string>Back</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="nextButton">
<property name="text">
<string>Next</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
<widget class="QMenuBar" name="menubar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>480</width>
<height>30</height>
</rect>
</property>
</widget>
<widget class="QStatusBar" name="statusbar"/>
</widget>
<resources/>
<connections/>
</ui>

65
qt/readergui.py Normal file
View File

@@ -0,0 +1,65 @@
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'reader.ui'
#
# Created by: PyQt5 UI code generator 5.15.0
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(480, 640)
self.centralwidget = QtWidgets.QWidget(MainWindow)
self.centralwidget.setObjectName("centralwidget")
self.mainImage = QtWidgets.QGraphicsView(self.centralwidget)
self.mainImage.setGeometry(QtCore.QRect(10, 10, 461, 511))
self.mainImage.setObjectName("mainImage")
self.testBox = QtWidgets.QDialogButtonBox(self.centralwidget)
self.testBox.setGeometry(QtCore.QRect(70, 140, 174, 34))
self.testBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
self.testBox.setObjectName("testBox")
self.widget = QtWidgets.QWidget(self.centralwidget)
self.widget.setGeometry(QtCore.QRect(10, 550, 461, 36))
self.widget.setObjectName("widget")
self.horizontalLayout = QtWidgets.QHBoxLayout(self.widget)
self.horizontalLayout.setContentsMargins(0, 0, 0, 0)
self.horizontalLayout.setObjectName("horizontalLayout")
self.backButton = QtWidgets.QPushButton(self.widget)
self.backButton.setObjectName("backButton")
self.horizontalLayout.addWidget(self.backButton)
self.nextButton = QtWidgets.QPushButton(self.widget)
self.nextButton.setObjectName("nextButton")
self.horizontalLayout.addWidget(self.nextButton)
MainWindow.setCentralWidget(self.centralwidget)
self.menubar = QtWidgets.QMenuBar(MainWindow)
self.menubar.setGeometry(QtCore.QRect(0, 0, 480, 30))
self.menubar.setObjectName("menubar")
MainWindow.setMenuBar(self.menubar)
self.statusbar = QtWidgets.QStatusBar(MainWindow)
self.statusbar.setObjectName("statusbar")
MainWindow.setStatusBar(self.statusbar)
self.retranslateUi(MainWindow)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
def retranslateUi(self, MainWindow):
_translate = QtCore.QCoreApplication.translate
MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
self.backButton.setText(_translate("MainWindow", "Back"))
self.nextButton.setText(_translate("MainWindow", "Next"))
if __name__ == "__main__":
import sys
app = QtWidgets.QApplication(sys.argv)
MainWindow = QtWidgets.QMainWindow()
ui = Ui_MainWindow()
ui.setupUi(MainWindow)
MainWindow.show()
sys.exit(app.exec_())