mirror of
https://github.com/RolandWH/SIPPCompare.git
synced 2025-04-20 00:11:48 +01:00
Compare commits
No commits in common. "68ac9924836c5cad29ee74ab13a423b40ae63cb0" and "36a36f5437441b3416cec10c84a8181b89716ac0" have entirely different histories.
68ac992483
...
36a36f5437
@ -6,20 +6,20 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>498</width>
|
||||
<height>303</height>
|
||||
<width>480</width>
|
||||
<height>305</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>498</width>
|
||||
<height>303</height>
|
||||
<width>480</width>
|
||||
<height>305</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>498</width>
|
||||
<height>303</height>
|
||||
<width>480</width>
|
||||
<height>305</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@ -28,10 +28,10 @@
|
||||
<widget class="QWidget" name="gridLayoutWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>20</x>
|
||||
<y>20</y>
|
||||
<x>10</x>
|
||||
<y>10</y>
|
||||
<width>461</width>
|
||||
<height>243</height>
|
||||
<height>251</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
@ -53,28 +53,80 @@
|
||||
<property name="verticalSpacing">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<item row="8" column="0" colspan="2">
|
||||
<widget class="QLabel" name="share_deal_reduce_amount_lab">
|
||||
<property name="text">
|
||||
<string>Share dealing discount amount</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="2">
|
||||
<widget class="QDoubleSpinBox" name="share_deal_reduce_amount_box">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="buttonSymbols">
|
||||
<enum>QAbstractSpinBox::ButtonSymbols::NoButtons</enum>
|
||||
</property>
|
||||
<property name="correctionMode">
|
||||
<enum>QAbstractSpinBox::CorrectionMode::CorrectToNearestValue</enum>
|
||||
</property>
|
||||
<property name="prefix">
|
||||
<string>£</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="2">
|
||||
<widget class="QDoubleSpinBox" name="share_plat_max_fee_box">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="buttonSymbols">
|
||||
<enum>QAbstractSpinBox::ButtonSymbols::NoButtons</enum>
|
||||
</property>
|
||||
<property name="correctionMode">
|
||||
<enum>QAbstractSpinBox::CorrectionMode::CorrectToNearestValue</enum>
|
||||
</property>
|
||||
<property name="prefix">
|
||||
<string>£</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<widget class="QCheckBox" name="plat_name_check">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="3">
|
||||
<widget class="QCheckBox" name="share_deal_fee_check">
|
||||
<item row="0" column="0" colspan="2">
|
||||
<widget class="QLabel" name="plat_name_lab">
|
||||
<property name="text">
|
||||
<string>Platform name</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QLineEdit" name="plat_name_box"/>
|
||||
</item>
|
||||
<item row="3" column="3">
|
||||
<widget class="QCheckBox" name="share_plat_fee_check">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="2">
|
||||
<widget class="FastEditQDoubleSpinBox" name="share_plat_max_fee_box">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<widget class="QDoubleSpinBox" name="share_deal_fee_box">
|
||||
<property name="buttonSymbols">
|
||||
<enum>QAbstractSpinBox::ButtonSymbols::NoButtons</enum>
|
||||
</property>
|
||||
@ -86,18 +138,8 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="3">
|
||||
<widget class="QCheckBox" name="fund_deal_fee_check">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="2">
|
||||
<widget class="FastEditQDoubleSpinBox" name="share_deal_fee_box">
|
||||
<item row="1" column="2">
|
||||
<widget class="QDoubleSpinBox" name="fund_deal_fee_box">
|
||||
<property name="buttonSymbols">
|
||||
<enum>QAbstractSpinBox::ButtonSymbols::NoButtons</enum>
|
||||
</property>
|
||||
@ -109,98 +151,22 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="0" colspan="2">
|
||||
<widget class="QLabel" name="share_deal_reduce_trades_lab">
|
||||
<property name="text">
|
||||
<string>Share dealing discount # of trades</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="3">
|
||||
<widget class="QCheckBox" name="share_deal_reduce_amount_check"/>
|
||||
</item>
|
||||
<item row="5" column="0" colspan="2">
|
||||
<widget class="QLabel" name="share_plat_max_fee_lab">
|
||||
<property name="text">
|
||||
<string>Share platform monthly fee cap</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<widget class="FastEditQDoubleSpinBox" name="fund_deal_fee_box">
|
||||
<property name="buttonSymbols">
|
||||
<enum>QAbstractSpinBox::ButtonSymbols::NoButtons</enum>
|
||||
</property>
|
||||
<property name="correctionMode">
|
||||
<enum>QAbstractSpinBox::CorrectionMode::CorrectToNearestValue</enum>
|
||||
</property>
|
||||
<property name="prefix">
|
||||
<string>£</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0" colspan="2">
|
||||
<widget class="QLabel" name="share_deal_fee_lab">
|
||||
<property name="text">
|
||||
<string>Share dealing fee*</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="2">
|
||||
<widget class="FastEditQSpinBox" name="share_deal_reduce_trades_box">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="buttonSymbols">
|
||||
<enum>QAbstractSpinBox::ButtonSymbols::NoButtons</enum>
|
||||
</property>
|
||||
<property name="correctionMode">
|
||||
<enum>QAbstractSpinBox::CorrectionMode::CorrectToNearestValue</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="3">
|
||||
<widget class="QCheckBox" name="share_deal_reduce_trades_check"/>
|
||||
</item>
|
||||
<item row="4" column="3">
|
||||
<widget class="QCheckBox" name="share_plat_fee_check">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="2">
|
||||
<item row="1" column="0" colspan="2">
|
||||
<widget class="QLabel" name="fund_deal_fee_lab">
|
||||
<property name="text">
|
||||
<string>Fund dealing fee*</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="3">
|
||||
<widget class="QCheckBox" name="share_plat_max_fee_check"/>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QLineEdit" name="plat_name_box"/>
|
||||
</item>
|
||||
<item row="9" column="0" colspan="2">
|
||||
<widget class="QLabel" name="share_deal_reduce_amount_lab">
|
||||
<property name="text">
|
||||
<string>Share dealing discount amount</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0" colspan="2">
|
||||
<widget class="QLabel" name="share_plat_fee_lab">
|
||||
<widget class="QLabel" name="share_plat_max_fee_lab">
|
||||
<property name="text">
|
||||
<string>Share platform fee*</string>
|
||||
<string>Share platform fee cap/mth</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="2">
|
||||
<widget class="FastEditQDoubleSpinBox" name="share_plat_fee_box">
|
||||
<item row="3" column="2">
|
||||
<widget class="QDoubleSpinBox" name="share_plat_fee_box">
|
||||
<property name="buttonSymbols">
|
||||
<enum>QAbstractSpinBox::ButtonSymbols::NoButtons</enum>
|
||||
</property>
|
||||
@ -212,15 +178,22 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="2">
|
||||
<widget class="QLabel" name="plat_name_lab">
|
||||
<item row="7" column="3">
|
||||
<widget class="QCheckBox" name="share_deal_reduce_trades_check">
|
||||
<property name="text">
|
||||
<string>Platform name</string>
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="2">
|
||||
<widget class="FastEditQDoubleSpinBox" name="share_deal_reduce_amount_box">
|
||||
<item row="5" column="0" colspan="2">
|
||||
<widget class="QLabel" name="share_deal_fee_lab">
|
||||
<property name="text">
|
||||
<string>Share dealing fee*</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="2">
|
||||
<widget class="QSpinBox" name="share_deal_reduce_trades_box">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
@ -230,8 +203,59 @@
|
||||
<property name="correctionMode">
|
||||
<enum>QAbstractSpinBox::CorrectionMode::CorrectToNearestValue</enum>
|
||||
</property>
|
||||
<property name="prefix">
|
||||
<string>£</string>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0" colspan="2">
|
||||
<widget class="QLabel" name="share_deal_reduce_trades_lab">
|
||||
<property name="text">
|
||||
<string>Share dealing discount # of trades</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="3">
|
||||
<widget class="QCheckBox" name="share_deal_reduce_amount_check">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="3">
|
||||
<widget class="QCheckBox" name="share_deal_fee_check">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="2">
|
||||
<widget class="QLabel" name="share_plat_fee_lab">
|
||||
<property name="text">
|
||||
<string>Share platform fee*</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="3">
|
||||
<widget class="QCheckBox" name="fund_deal_fee_check">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="3">
|
||||
<widget class="QCheckBox" name="share_plat_max_fee_check">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -243,7 +267,7 @@
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>350</x>
|
||||
<x>330</x>
|
||||
<y>270</y>
|
||||
<width>141</width>
|
||||
<height>24</height>
|
||||
@ -253,11 +277,11 @@
|
||||
<string>Save</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="req_field_lab">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>280</y>
|
||||
<x>20</x>
|
||||
<y>270</y>
|
||||
<width>191</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
@ -266,35 +290,7 @@
|
||||
<string>* Indicates required field</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="active_lab">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>437</x>
|
||||
<y>10</y>
|
||||
<width>61</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Active?</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignmentFlag::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>FastEditQDoubleSpinBox</class>
|
||||
<extends>QDoubleSpinBox</extends>
|
||||
<header>widgets/fastedit_spinbox</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>FastEditQSpinBox</class>
|
||||
<extends>QSpinBox</extends>
|
||||
<header>widgets/fastedit_spinbox</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<tabstops>
|
||||
<tabstop>plat_name_box</tabstop>
|
||||
<tabstop>fund_deal_fee_box</tabstop>
|
||||
|
@ -40,7 +40,7 @@ class SIPPCompare(QMainWindow):
|
||||
self.actionEdit_Platforms.triggered.connect(self.show_platform_edit)
|
||||
# Update percentage mix label when slider moved
|
||||
self.mix_slider.valueChanged.connect(self.update_slider_lab)
|
||||
self.value_input.valueChanged.connect(self.check_valid)
|
||||
#self.value_input.valueChanged.connect(self.check_valid)
|
||||
self.share_trades_combo.currentTextChanged.connect(self.check_valid)
|
||||
self.fund_trades_combo.currentTextChanged.connect(self.check_valid)
|
||||
|
||||
@ -56,8 +56,7 @@ class SIPPCompare(QMainWindow):
|
||||
|
||||
def check_valid(self):
|
||||
if self.share_trades_combo.currentText() != "" \
|
||||
and self.fund_trades_combo.currentText() != "" \
|
||||
and self.value_input.value() != 0:
|
||||
and self.fund_trades_combo.currentText() != "":
|
||||
self.calc_but.setEnabled(True)
|
||||
else:
|
||||
self.calc_but.setEnabled(False)
|
||||
|
@ -1,6 +1,6 @@
|
||||
from PyQt6.QtCore import QRegularExpression, QEvent, QObject, QTimer
|
||||
from PyQt6.QtGui import QRegularExpressionValidator
|
||||
from PyQt6.QtWidgets import QWidget, QDoubleSpinBox
|
||||
from PyQt6.QtWidgets import QWidget
|
||||
from PyQt6 import uic
|
||||
|
||||
import main_window
|
||||
@ -79,6 +79,17 @@ class PlatformEdit(QWidget):
|
||||
# NOTE: Signal defined in UI file to close window when save button clicked
|
||||
self.save_but.clicked.connect(self.init_variables)
|
||||
|
||||
# Install event filter on input boxes in order to select all text on focus
|
||||
# TODO: Seems like my eventFilter() override is capturing all events - need to stop this
|
||||
"""
|
||||
self.fund_deal_fee_box.installEventFilter(self)
|
||||
self.share_plat_fee_box.installEventFilter(self)
|
||||
self.share_plat_max_fee_box.installEventFilter(self)
|
||||
self.share_deal_fee_box.installEventFilter(self)
|
||||
self.share_deal_reduce_trades_box.installEventFilter(self)
|
||||
self.share_deal_reduce_amount_box.installEventFilter(self)
|
||||
"""
|
||||
|
||||
# Set validators
|
||||
# Regex accepts any characters that match [a-Z], [0-9] or _
|
||||
self.plat_name_box.setValidator(
|
||||
@ -109,12 +120,11 @@ class PlatformEdit(QWidget):
|
||||
self.main_win.show()
|
||||
|
||||
# When focus is given to an input box, select all text in it (easier to edit)
|
||||
def focusInEvent(self, event):
|
||||
print("yay")
|
||||
if event.gotFocus():
|
||||
def eventFilter(self, obj: QObject, event: QEvent):
|
||||
if event.type() == QEvent.Type.FocusIn:
|
||||
# Alternative condition for % suffix - currently unused
|
||||
#if obj.value() == 0 or obj == self.share_plat_fee_box:
|
||||
QTimer.singleShot(0, sender.selectAll)
|
||||
QTimer.singleShot(0, obj.selectAll)
|
||||
return False
|
||||
|
||||
# This method does multiple things in order to validate the user's inputs:
|
||||
|
@ -1,13 +0,0 @@
|
||||
from PyQt6.QtCore import QTimer
|
||||
from PyQt6.QtWidgets import QSpinBox, QDoubleSpinBox
|
||||
|
||||
|
||||
class FastEditQDoubleSpinBox(QDoubleSpinBox):
|
||||
def focusInEvent(self, e):
|
||||
QTimer.singleShot(0, self.selectAll)
|
||||
super(FastEditQDoubleSpinBox, self).focusInEvent(e)
|
||||
|
||||
class FastEditQSpinBox(QSpinBox):
|
||||
def focusInEvent(self, e):
|
||||
QTimer.singleShot(0, self.selectAll)
|
||||
super(FastEditQSpinBox, self).focusInEvent(e)
|
Loading…
x
Reference in New Issue
Block a user