Skip to content

Commit

Permalink
Mudanças de layouts e implementação de novas funções nas telas de fea…
Browse files Browse the repository at this point in the history
…dback. (#185)

* Função para mover a Interface

Função para mover a interface  pelo pressionar do mous.

* alteração no import

Alteração no import.

* correção na função

* Update home.py

Correção da inicialização da variável

* pequenas alterações

alterações na tela de cadastro pessoas

* Mudanças

* Revert "pequenas alterações"

This reverts commit 2d45c9f.

* mover telas ainda a completar

* Revert "mover telas ainda a completar"

This reverts commit 26b1921.

* Função para movimentação da tela e maximizar e minimizar com dois cliques

* função redimensionar.

* Redimensionamento da home

* .

* movimentação da telas de feadback.

* correção dos layouts

---------

Co-authored-by: Prof-Rayner <[email protected]>
  • Loading branch information
NickolasXL and Prof-Rayner authored Dec 9, 2024
1 parent b504c51 commit 5805e82
Show file tree
Hide file tree
Showing 11 changed files with 117 additions and 23 deletions.
23 changes: 21 additions & 2 deletions App/view/feadbackConcluido.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,28 @@
from PyQt5.QtWidgets import QDialog
from PyQt5.uic import loadUi
from PyQt5.QtCore import Qt, QPoint

class FeadbackConcluido(QDialog):
def __init__(self):
super().__init__()
loadUi('App/view/ui/feadbackConcluido.ui',self)
loadUi('App/view/ui/feadbackConcluido.ui', self)

#label do aviso do Concluido = #texto
# Variáveis para armazenar o estado da movimentação
self._is_dragging = False
self._start_pos = QPoint()

def mousePressEvent(self, event):
if event.button() == Qt.LeftButton:
self._is_dragging = True
self._start_pos = event.globalPos() - self.frameGeometry().topLeft()
event.accept()

def mouseMoveEvent(self, event):
if self._is_dragging and event.buttons() == Qt.LeftButton:
self.move(event.globalPos() - self._start_pos)
event.accept()

def mouseReleaseEvent(self, event):
if event.button() == Qt.LeftButton:
self._is_dragging = False
event.accept()
45 changes: 33 additions & 12 deletions App/view/feadbackErro.py
Original file line number Diff line number Diff line change
@@ -1,41 +1,62 @@
from PyQt5.QtWidgets import QDialog
from PyQt5.uic import loadUi
from PyQt5.QtCore import Qt
from PyQt5.QtCore import Qt, QPoint

class FeadbackErro(QDialog):
def __init__(self, txt):
super().__init__()
loadUi('App/view/ui/feadbackErro.ui',self)
loadUi('App/view/ui/feadbackErro.ui', self)

self.texto.setText(txt)

# Remove a barra de título e as bordas da janela
self.setWindowFlags(Qt.FramelessWindowHint)

# Variáveis para controle de movimentação
self._is_dragging = False
self._start_pos = QPoint()

# Botões
self.btnConfirmar.clicked.connect(self.reject)
self.btnFechar.clicked.connect(self.reject)

def mudarFoto(self, img):
if img == 'Validado':
self.setStyleSheet("""
#icon {
image: url(App/view/ui/icones/iconConcluido.png)
image: url(App/view/ui/icones/iconConcluido.png);
}
""")
""")
else:
self.setStyleSheet("""
#icon {
image: url(App/view/ui/icones/iconErro.png)
image: url(App/view/ui/icones/iconErro.png);
}
""")



""")

# Adiciona movimentação da janela
def mousePressEvent(self, event):
if event.button() == Qt.LeftButton:
self._is_dragging = True
self._start_pos = event.globalPos() - self.frameGeometry().topLeft()
event.accept()

def mouseMoveEvent(self, event):
if self._is_dragging and event.buttons() == Qt.LeftButton:
self.move(event.globalPos() - self._start_pos)
event.accept()

def mouseReleaseEvent(self, event):
if event.button() == Qt.LeftButton:
self._is_dragging = False
event.accept()


if __name__ == "__main__":
from PyQt5.QtWidgets import QApplication
resp = FeadbackErro('sla')
resp = FeadbackErro('Texto de exemplo')
app = QApplication([])
if resp.exec_():
print('ok')
else:
print('negado')
print('negado')
8 changes: 7 additions & 1 deletion App/view/ui/cadastroCurso.ui
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,20 @@ border-radius: 15px;
</property>
</widget>
</item>
<item>
<item alignment="Qt::AlignHCenter">
<widget class="QFrame" name="frame">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>793</width>
<height>486</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
Expand Down
8 changes: 7 additions & 1 deletion App/view/ui/cadastroPessoas.ui
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,20 @@
</property>
</widget>
</item>
<item>
<item alignment="Qt::AlignHCenter">
<widget class="QFrame" name="frame">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>762</width>
<height>479</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
Expand Down
8 changes: 7 additions & 1 deletion App/view/ui/cadastroSalas.ui
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,20 @@
</property>
</widget>
</item>
<item>
<item alignment="Qt::AlignHCenter">
<widget class="QFrame" name="frame">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>801</width>
<height>340</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
Expand Down
8 changes: 7 additions & 1 deletion App/view/ui/editarCurso.ui
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,20 @@
</property>
</spacer>
</item>
<item>
<item alignment="Qt::AlignHCenter">
<widget class="QFrame" name="frame_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>1056</width>
<height>642</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
Expand Down
8 changes: 7 additions & 1 deletion App/view/ui/editarLogin.ui
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,20 @@
</property>
</widget>
</item>
<item>
<item alignment="Qt::AlignHCenter">
<widget class="QFrame" name="frame_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>833</width>
<height>582</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
Expand Down
8 changes: 7 additions & 1 deletion App/view/ui/editarPessoa.ui
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,20 @@ border-radius: 15px;
</property>
</widget>
</item>
<item>
<item alignment="Qt::AlignHCenter">
<widget class="QFrame" name="frame">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>803</width>
<height>566</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
Expand Down
8 changes: 7 additions & 1 deletion App/view/ui/editarReserva.ui
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,20 @@ border-radius: 15px;
</property>
</widget>
</item>
<item>
<item alignment="Qt::AlignHCenter">
<widget class="QFrame" name="ReservaDeSala">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>1130</width>
<height>622</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
Expand Down
8 changes: 7 additions & 1 deletion App/view/ui/editarSalas.ui
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,20 @@
</property>
</widget>
</item>
<item>
<item alignment="Qt::AlignHCenter">
<widget class="QFrame" name="frame_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>794</width>
<height>314</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
Expand Down
8 changes: 7 additions & 1 deletion App/view/ui/reserva.ui
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,20 @@
</property>
</widget>
</item>
<item>
<item alignment="Qt::AlignHCenter">
<widget class="QFrame" name="ReservaDeSala">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>1106</width>
<height>642</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
Expand Down

0 comments on commit 5805e82

Please sign in to comment.