Проблема с отображением данных во втором окне GUI PyQT5

проблема заключается в том, что после смены windows, в моем приложении появилась проблема, при открытии 2ого окна из первого данные получаемые 2ым окном из SQL базы в нем перестали отображаться. При чем если открыть 2ое окно на прямую с данными все ок. Кода много, добавлю только ту часть, которая непосредственно отрабатывает авторизацию в приложении и открытие основного окна (2ого). Окно для авторизации и регистрации: login.py :

 import handler.db_handler
from check_db import *
from PyQt5.QtWidgets import QMessageBox, QLineEdit, QPushButton, QLabel
from PyQt5.QtGui import QIcon, QPixmap

class security (QtWidgets.QWidget):
    def __init__(self):
        super(security, self).__init__()
        self.setWindowIcon(QIcon('images/mainIcon.png'))
        self.setWindowTitle('DjC • RemoteDC')
        self.setStyleSheet("background-color: rgba(238, 238, 238);")
        self.setFixedSize(400, 300)
        self.l_prog_name() #строка44
        self.l_prog_label() #строка49
        self.l_auth() #строка55
        self.l_reg() #строка61
        self.b_ok() #строка67
        self.b_close() #строка91
        self.b_reg() #строка114


    def le_login (self):
        self.le_login = QLineEdit(self)
        self.le_login.setFixedSize(390, 30)
        self.le_login.move(5, 140)
        self.le_login.setAlignment(QtCore.Qt.AlignCenter)
        self.le_login.setFont(QtGui.QFont('Century Gothic', 10))
        self.le_login.setPlaceholderText("Введите логин")


        return self.le_login

    def le_pass (self):
        self.le_pass = QLineEdit(self)
        self.le_pass.setFixedSize(390, 30)
        self.le_pass.move(5, 180)
        self.le_pass.setAlignment(QtCore.Qt.AlignCenter)
        self.le_pass.setPlaceholderText("Введите пароль")
        self.le_pass.setFont(QtGui.QFont('Century Gothic', 10))
        self.le_pass.setEchoMode(QtWidgets.QLineEdit.Password)

        return self.le_pass

    def l_prog_name (self):
        l_prog_name = QLabel(self)
        l_prog_name.setText('<center style=font-size:25pt><font face="Century">Remote DC • v3.00PY</font></center>')
        l_prog_name.move(32, 10)

    def l_prog_label (self):
        l_prog_label = QLabel(self)
        l_prog_label.setText('<center style=font-size:7.2pt>ПО произведено для некоммерческого использования</center>'
                             '<center style=font-size:7.2pt>разработчик: DJC Media</center>')
        l_prog_label.move(70, 60)

    def l_auth (self):
        l_auth = QLabel(self)
        l_auth.setText('Введите свои учетные данные:')
        l_auth.move(85, 110)
        l_auth.setFont(QtGui.QFont('Century Gothic', 12, QtGui.QFont.Normal))

    def l_reg (self):
        l_reg = QLabel(self)
        l_reg.setText('Нет аккаунта? Заполните поля и нажмите:')
        l_reg.move(130, 223)
        l_reg.setFont(QtGui.QFont('Century Gothic', 7, QtGui.QFont.Normal))

    def b_ok (self):
        b_ok = QPushButton(self)
        b_ok.setText("Войти • Enter")
        b_ok.setFont(QtGui.QFont('Century Gothic', 8, QtGui.QFont.Normal))
        b_ok.setGeometry(110, 255, 85, 35)
        b_ok.setToolTip('Нажмите, для проверки данных и авторизации в программе')
        b_ok.setStyleSheet("""
                                            QPushButton:hover { background-color: green;
                                            border-radius: 10px;
                                            border-style: ridge;
                                            border-color: dark;
                                            border-width: 2px; }
                        QPushButton:!hover { background-color: white;
                                            border-style: ridge;
                                            border-width: 2px;
                                            border-radius: 10px;
                                            border-color: dark;   }
                        QPushButton:pressed { background-color: rgb(0, 255, 0);
                                            border-radius: 17px;}
                            """)
        b_ok.clicked.connect(self.auth)
        b_ok.setAutoDefault(True)
        self.b_click = b_ok.click

    def b_close (self):
        b_close = QPushButton(self)
        b_close.setText("Закрыть • Esc")
        b_close.setFont(QtGui.QFont('Century Gothic', 8, QtGui.QFont.Normal))
        b_close.setGeometry(210, 255, 85, 35)
        b_close.setShortcut('Esc')
        b_close.setToolTip('Нажмите, чтобы выйти и приложения')
        b_close.setStyleSheet("""
                                    QPushButton:hover { background-color: rgba(139, 0, 0);
                                                        border-radius: 10px;
                                                        border-style: ridge;
                                                        border-color: dark;
                                                        border-width: 2px; }
                                    QPushButton:!hover { background-color: white;
                                                         border-style: ridge;
                                                         border-width: 2px;
                                                         border-radius: 10px;
                                                         border-color: dark;   }
                                    QPushButton:pressed { background-color: rgb(255, 0, 0);
                                                          border-radius: 17px;}
                                """)
        b_close.clicked.connect(self.close)

    def b_reg (self):
        b_reg = QPushButton(self)
        b_reg.setFixedSize(65, 27)
        b_reg.move(330, 215)
        b_reg.setFont(QtGui.QFont('Calibri', 7))
        b_reg.setText('Создать\n аккаунт')
        b_reg.clicked.connect(self.reg)

        self.base_line_edit = [self.le_login(), self.le_pass()]
        self.check_db = CheckThread()
        self.check_db.mysignal.connect(self.signal_handler)
        self.le_login.returnPressed.connect(self.b_click)
        self.le_pass.returnPressed.connect(self.b_click)

    def showMessageBox(self, title, message):
        msgBox = QMessageBox()
        msgBox.setWindowIcon(QIcon("images/important.png"))
        msgBox.setWindowTitle(title)
        msgBox.setIconPixmap(QPixmap("images/gandalf.png"))
        msgBox.setText(message)
        msgBox.setStyleSheet("font: 12px;"
                             "font-family: Century Gothic;")
        msgBox.setStandardButtons(QMessageBox.Ok)
        msgBox.exec_()

# Проверка правильности ввода данных
    def check_input(funct):
        def wrapper(self):
            for line_edit in self.base_line_edit:
                if len(line_edit.text()) == 0:
                    self.showMessageBox('Внимание!',
                                        '<center><p style=font-size:7.2pt><i>Gandalf said: "You..shall not..pass!"</i></p></center>'
                                        '<center><br/><u style=font-size:10pt><FONT FACE="Arial"><b>Вы не заполнили поля</b></u></center></FONT>')
                    return
            funct(self)
        return wrapper

# Обработчик сигналов
    def signal_handler(self, value):
        QtWidgets.QMessageBox.about(self, 'Оповещение', value)

    @check_input
    def auth(self):
        name = self.le_login.text()
        passw = self.le_pass.text()
        self.check_db.thr_login(name, passw)
        self.hide()

if __name__ == ('__main__'):
    import sys
    app = QtWidgets.QApplication(sys.argv)
    w = security()
    w.show()
    sys.exit(app.exec_())

Далее сигнал передается через check_db.py:

from PyQt5 import QtWidgets, QtCore, QtGui
from handler.db_handler import *

class CheckThread(QtCore.QThread):
    mysignal = QtCore.pyqtSignal(str)

    def thr_login(self, name, passw):
        login(name, passw, self.mysignal)

    def thr_register(self, name, passw):
        register(name, passw, self.mysignal)

И наконец обрабатывается в db_handler.py :

import sqlite3, os
from MainWindow import mainwindow

def login(login, passw, signal):
    if os.access('handler/users.db', os.F_OK) == False:
        from login import security
        security.smb3 = security()
        security.smb3.showMessageBox('Внимание!',
                                    '<center><p style=font-size:7.2pt><i>Gandalf said: "You..shall not..pass!"</i></p></center>'
                                    '<center><u style=font-size:10pt><FONT FACE="Arial"><b>системная ошибка [0x000001]</b></u></center></FONT>'
                                    '<center><u style=font-size:10pt><FONT FACE="Arial"><b>свяжитесь с тех. поддержкой</b></u></center></FONT>')
    else:
        con = sqlite3.connect('handler/users.db')
        cur = con.cursor()

        # Проверяем, есть ли такой пользователь
        cur.execute(f'SELECT * FROM users WHERE name="{login}";')
        value = cur.fetchall()

        if value != [] and value[0][2] == passw:
            mainwindow.second = mainwindow()
            mainwindow.second.show()
        else:
            from login import security
            security.smb = security()
            security.smb.showMessageBox('Внимание!',
                                        '<center><p style=font-size:7.2pt><i>Gandalf said: "You..shall not..pass!"</i></p></center>'
                                        '<center><br/><u style=font-size:10pt><FONT FACE="Arial"><b>Неправильное имя пользователя или пароль</b></u></center></FONT>')

        cur.close()
        con.close()



def register(login, passw, signal):
    if os.access('handler/users.db', os.F_OK) == False:
        from login import security
        security.smb3 = security()
        security.smb3.showMessageBox('Внимание!',
                                    '<center><p style=font-size:7.2pt><i>Gandalf said: "You..shall not..pass!"</i></p></center>'
                                    '<center><u style=font-size:10pt><FONT FACE="Arial"><b>системная ошибка [0x000001]</b></u></center></FONT>'
                                    '<center><u style=font-size:10pt><FONT FACE="Arial"><b>свяжитесь с тех. поддержкой</b></u></center></FONT>')
    else:
        con = sqlite3.connect('handler/users.db')
        cur = con.cursor()

        # Проверяем, есть ли такой пользователь
        cur.execute(f'SELECT * FROM users WHERE name="{login}";')
        value = cur.fetchall()

        if value != [] and value[0][2] == passw:
            from login import security
            security.smb1 = security()
            security.smb1.showMessageBox('Внимание!',
                                         '<center><p style=font-size:7.2pt><i>Gandalf said: "You..shall not..pass!"</i></p></center>'
                                         '<center><br/><u style=font-size:10pt><FONT FACE="Arial"><b>Такой логин уже используется</b></u></center></FONT>')
        elif value == []:
            cur.execute(f"INSERT INTO users (name, password) VALUES ('{login}','{passw}')")
            con.commit()
            from login import security
            security.smb2 = security()
            security.smb2.showMessageBox('Поздравляю!',
                                        '<center><p style=font-size:7.2pt><i>Gandalf won`t tell you: "You..shall not..pass!"</i></p></center>'
                                        '<center><br/><u style=font-size:10pt><FONT FACE="Arial"><b>Вы успешно зарегистрировались!</b></u></center></FONT>')


        cur.close()
        con.close()

если данные, предоставленные пользователям есть в SQL то пользователь успешно авторизуется, окно login.py скрывается .hide() и появляется окно MainWindow:

import datetime
from PyQt5.QtWidgets import (QApplication, QWidget, QLabel, QVBoxLayout, QScrollArea, QGridLayout,
                             QHBoxLayout, QMenuBar, QAction, QMenu, QMessageBox, QLCDNumber, QFormLayout,
                             QGroupBox, QTextBrowser, QTabWidget, QPushButton, QTableView, QLineEdit)
from PyQt5.QtSql import QSqlDatabase, QSqlTableModel
from PyQt5.QtGui import QFont, QIcon, QPixmap
from PyQt5.QtCore import QTime, QTimer, Qt, QSize


class mainwindow(QWidget):
    def __init__(self):
        super(mainwindow, self).__init__()
        self.setWindowIcon(QIcon('images/mainIcon.png'))
        self.setWindowTitle('DjC • RemoteDC')
        self.setStyleSheet("background-color: rgba(238, 238, 238);")
        self.resize(1000, 700)
        self._createActions()
        self._createMenuBar()
        self._tab()
        groupbox1 = self._groupbox1()  # отображение часов + даты
        groupbox2 = self._groupbox2() # отображение пустого бокса
        mainlabel1 = self._labelline1() # отображение названия программы (+ скрытой подсказки)

# Вертикальный столбец (под виджеты)
        vbox_lbl1 = QVBoxLayout()
        vbox_lbl2 = QVBoxLayout()
        vbox_lbl1.addWidget(mainlabel1)
        vbox_lbl2.addWidget(groupbox1)
        vbox_lbl2.addWidget(groupbox2)
        hbox_lbl1 = QHBoxLayout()
        hbox_lbl2 = QHBoxLayout()
        hbox_lbl1.addStretch(1)
        hbox_lbl1.addLayout(vbox_lbl1)
        hbox_lbl2.addStretch(1)
        hbox_lbl2.addLayout(vbox_lbl2)
        vbox_ready = QVBoxLayout()
        vbox_ready.addLayout(hbox_lbl2)
        vbox_ready.addStretch(1)
        vbox_ready.addLayout(hbox_lbl1)
        self.setLayout(vbox_ready)


# Название программы (+ скрытая подсказка)
    def _labelline1(self):
        label = QLabel(self)
        label.setText('REMOTE DC v3.00PY'
                      '<p style=font-size:7pt>(для помощи • наведи мышь)</p>')
        label.setFont(QFont('Century', 10, QFont.Bold))
        label.setToolTip('Разработка ПО • DjC\n\n'
                         'Ваши вопросы/претензии/пожелания:\n'
                         '» Обратная связь • [email protected]\n'
                         '» Skype • live:shampenyon\n'
                         '» Telegram • @DjonyCooper')

        return label

# Основное окно с вкладками
    def _tab(self):
        tabWidget = QTabWidget(self)
        tabWidget.setMinimumSize(835, 600)
        tabWidget.move(5, 30)
        tabWidget.setTabPosition(QTabWidget.West)
        tabWidget.setFont(QFont("Times New Roman", 10, QFont.Normal))
        tabWidget.addTab(self.scroll(), "Aвтоподключение")
        tabWidget.addTab(Tab_2(), "Программы")
        tabWidget.addTab(Tab_3(), "Прочее")
        tabWidget.show()


# Контекстное меню
    def _createMenuBar(self):
        menuBar = QMenuBar(self)
        menuBar.setGeometry(0, 0, 200, 25)
        menuBar.setFont(QFont("Century Gothic", 10, QFont.Normal))
        fileMenu = QMenu("Меню", self)
        menuBar.addMenu(fileMenu)
        fileMenu.addAction(self.openAction)
        fileMenu.addAction(self.updateAction)
        fileMenu.addAction(self.exitAction)
        editMenu = menuBar.addMenu("Правка")
        editMenu.addAction(self.newAction)
        editMenu.addAction(self.saveAction)
        editMenu.addAction(self.delAction)
        helpMenu = menuBar.addMenu(QIcon("images/help.png"), "Помощь")
        helpMenu.addAction(self.helpContentAction)
        helpMenu.addAction(self.aboutAction)

# Разделы контекстного меню
    def _createActions(self):
        self.newAction = QAction(QIcon("images/new.png"), "Новый", self)
        self.newAction.triggered.connect(self._newconnect)
        self.updateAction = QAction(QIcon("images/update.png"), "Обновить", self)
        self.updateAction.triggered.connect(self._updateconnect)
        self.openAction = QAction("Открыть...", self)
        self.exitAction = QAction(QIcon("images/close.png"),"Выйти", self)
        self.exitAction.triggered.connect(self._close)
        self.saveAction = QAction(QIcon("images/save.png"), "Сохранить", self)
        self.copyAction = QAction("Копировать", self)
        self.delAction = QAction(QIcon("images/delete.png"), "Удалить", self)
        self.helpContentAction = QAction(QIcon("images/content.png"), "Справка о ПО", self)
        self.aboutAction = QAction(QIcon("images/help.png"), "Помощь", self)
        self.aboutAction.triggered.connect(self._help)

        self.newAction.setShortcut("Ctrl+N")
        self.updateAction.setShortcut("F5")
        self.openAction.setShortcut("Ctrl+O")
        self.exitAction.setShortcut("Esc")
        self.saveAction.setShortcut("Ctrl+S")
        self.delAction.setShortcut("Ctrl+D")
        self.aboutAction.setShortcut("F12")

# Открытие окна помощи (F12)
    def _help(self):
        from help import _help
        self._help = _help()
        self._help.show()

    def _newconnect(self):
        from newconnect import newconnect
        self._newconnect = newconnect()
        self._newconnect.show()

    def _updateconnect(self):
        self.update()

# !Функция закрытия приложения
    def _close(self):
        msgBox = QMessageBox()
        msgBox.setWindowIcon(QIcon("images/question.png"))
        msgBox.setWindowTitle("Выйти")
        msgBox.setIconPixmap(QPixmap("images/gandalf.png"))
        msgBox.setText("Вы уверены, что хотите выйти?")
        msgBox.setStyleSheet("font: 12px;"
                         "font-family: Century Gothic;")
        msgBox.setStandardButtons(QMessageBox.Yes | QMessageBox.No)
        _msgBoxClose = msgBox.exec_()
        if _msgBoxClose == QMessageBox.Yes:
             self.close()


# Бокс для часов и даты
    def _groupbox1(self):
        groupBox = QGroupBox("Сегодня:", self)
        groupBox.setFixedSize(140, 100)
        groupBox.setObjectName("datetimeGroupBox")
        groupBox.setStyleSheet("QGroupBox#datetimeGroupBox {background-color: rgba(255, 255, 255);"
                                                        "border-style: groove;"
                                                        "border-width: 2px;"
                                                        "border-radius: 25px;"
                                                        "border-color: dark;"
                                                        "font: 14px;"
                                                        "font-family: Century Gothic;}")
        time1 = DigitalClock()
        time1.setFixedSize(110, 30)
        time1.setObjectName("TimeinGroupBox")
        time1.setStyleSheet("background-color: rgba(238, 238, 238);"
                         "border-style: groove;"
                         "border-width: 2px;"
                         "border-radius: 12px;"
                         "border-color: dark;"
                         "font: bold 14px;"
                         "font-family: Century;"
                         "padding: 6px;");
        date1 = self._datetoday()
        date1.setFixedSize(110, 30)
        date1.setAlignment(Qt.AlignCenter)
        date1.setStyleSheet("background-color: rgba(238, 238, 238);"
                         "border-style: groove;"
                         "border-width: 2px;"
                         "border-radius: 12px;"
                         "font-family: Century Gothic;"
                         "font: 13px;"
                         "border-color: dark;")
        hbox_datetime = QVBoxLayout()
        hbox_datetime.addWidget(date1)
        hbox_datetime.addWidget(time1)

        vbox_ready = QVBoxLayout()
        vbox_ready.addLayout(hbox_datetime)
        groupBox.setLayout(vbox_ready)
        return groupBox

# Пустой бокс:
    def _groupbox2(self):
        groupBox2 = QGroupBox(self)
        groupBox2.setMinimumSize (140, 400)
        groupBox2.setObjectName("reportGroupBox")
        groupBox2.setStyleSheet("QGroupBox#reportGroupBox {background-color: rgba(255, 255, 255);"
                               "border-style: groove;"
                               "border-width: 2px;"
                               "border-radius: 25px;"
                               "border-color: dark;"
                               "font: 14px;"
                               "font-family: Century;}")

        return groupBox2


# Виджет даты
    def _datetoday(self):
        DATE = QTextBrowser(self)
        datetoday = datetime.datetime.now()
        DATE.setText('%s/%s/%s' % (datetoday.day, datetoday.month, datetoday.year))
        DATE.setStyleSheet("margin-left:300px;"
                           "margin-right:0px;"
                           "text-indent:0px;")
        return DATE

    def scroll(self):
        scroll = QScrollArea(self)
        scroll.setWidget(Tab_1())

        return scroll

# Виджет часов
class DigitalClock(QLCDNumber):
    def __init__(self, parent=None):
        super(DigitalClock, self).__init__()
        self.Clock()

    def Clock(self):
        self.setSegmentStyle(QLCDNumber.Filled)
        self.setStyleSheet("background-color: rgba(0, 120, 215);"
                           "color: dark;"
                           "border-style: outset;")
        timer = QTimer(self)
        timer.timeout.connect(self.showTime)
        timer.start(1000)
        self.showTime()

    def showTime(self):
        time = QTime.currentTime()
        text = time.toString('hh:mm')
        if (time.second() % 2) == 0:
            text = text[:2] + ' ' + text[3:]

        self.display(text)



class Tab_1(QWidget):
    def __init__(self):
        super(Tab_1, self).__init__()

# Вертикальный столбец (под виджеты)
        grid = QGridLayout(self)
        grid.addWidget(self._groupbox8())
        grid.addWidget(self._groupbox4())
        grid.addWidget(self._groupbox5())
        grid.addWidget(self._groupbox6())
        self.setLayout(grid)

    def _groupbox4(self):
        groupbox4 = QGroupBox("Люберцы", self)
        groupbox4.setObjectName("lybGroupBox")
        groupbox4.setStyleSheet("QGroupBox#reportGroupBox {background-color: rgba(255, 255, 255);"
                                "border-style: groove;"
                                "border-width: 2px;"
                                "border-radius: 25px;"
                                "border-color: dark;"
                                "font: 14px;"
                                "font-family: Century;}")
        self.Model = QSqlTableModel()
        self.Model.setEditStrategy(QSqlTableModel.OnFieldChange)
        self.Model.setTable("ter")
        self.Model.select()
        self.Model.setHeaderData(1, Qt.Horizontal, "IP")
        self.Model.setHeaderData(2, Qt.Horizontal, "Hostname")
        self.Model.setHeaderData(3, Qt.Horizontal, "Примечание")
        self.Model.setFilter(("Location = '%s'" % ("Люберцы")))
        self.table = QTableView()
        self.table.setModel(self.Model)
        self.table.hideColumn(0)
        self.table.hideColumn(4)
        self.table.setMinimumSize(750, 200)
        self.table.setColumnWidth(1, 100)
        self.table.setColumnWidth(2, 100)
        self.table.setColumnWidth(3, 515)

        hbox = QVBoxLayout()
        hbox.addWidget(self.table, alignment=Qt.AlignCenter)

        vbox_ready = QHBoxLayout()
        vbox_ready.addLayout(hbox)
        groupbox4.setLayout(vbox_ready)

        return groupbox4

    def _groupbox5(self):
        groupbox5 = QGroupBox("Машково", self)
        groupbox5.setObjectName("mashGroupBox")
        groupbox5.setStyleSheet("QGroupBox#reportGroupBox {background-color: rgba(255, 255, 255);"
                                "border-style: groove;"
                                "border-width: 2px;"
                                "border-radius: 25px;"
                                "border-color: dark;"
                                "font: 14px;"
                                "font-family: Century;}")
        self.Model = QSqlTableModel()
        self.Model.setEditStrategy(QSqlTableModel.OnFieldChange)
        self.Model.setTable("ter")
        self.Model.select()
        self.Model.setHeaderData(1, Qt.Horizontal, "IP")
        self.Model.setHeaderData(2, Qt.Horizontal, "Hostname")
        self.Model.setHeaderData(3, Qt.Horizontal, "Примечание")
        self.Model.setFilter(("Location = '%s'" % ("Машково")))
        self.table = QTableView()
        self.table.setModel(self.Model)
        self.table.hideColumn(0)
        self.table.hideColumn(4)
        self.table.setMinimumSize(750, 200)
        self.table.setColumnWidth(1, 100)
        self.table.setColumnWidth(2, 100)
        self.table.setColumnWidth(3, 515)

        hbox = QVBoxLayout()
        hbox.addWidget(self.table, alignment=Qt.AlignCenter)

        vbox_ready = QHBoxLayout()
        vbox_ready.addLayout(hbox)
        groupbox5.setLayout(vbox_ready)

        return groupbox5

    def _groupbox6(self):
        groupbox6 = QGroupBox("Кетчерская", self)
        groupbox6.setObjectName("ketchGroupBox")
        groupbox6.setStyleSheet("QGroupBox#reportGroupBox {background-color: rgba(255, 255, 255);"
                                "border-style: groove;"
                                "border-width: 2px;"
                                "border-radius: 25px;"
                                "border-color: dark;"
                                "font: 14px;"
                                "font-family: Century;}")
        self.Model = QSqlTableModel()
        self.Model.setEditStrategy(QSqlTableModel.OnFieldChange)
        self.Model.setTable("ter")
        self.Model.select()
        self.Model.setHeaderData(1, Qt.Horizontal, "IP")
        self.Model.setHeaderData(2, Qt.Horizontal, "Hostname")
        self.Model.setHeaderData(3, Qt.Horizontal, "Примечание")
        self.Model.setFilter(("Location = '%s'" % ("Кетчерская")))
        self.table = QTableView()
        self.table.setModel(self.Model)
        self.table.hideColumn(0)
        self.table.hideColumn(4)
        self.table.setMinimumSize(750, 200)
        self.table.setColumnWidth(1, 100)
        self.table.setColumnWidth(2, 100)
        self.table.setColumnWidth(3, 515)

        hbox = QVBoxLayout()
        hbox.addWidget(self.table, alignment=Qt.AlignCenter)

        vbox_ready = QHBoxLayout()
        vbox_ready.addLayout(hbox)
        groupbox6.setLayout(vbox_ready)

        return groupbox6


    def _groupbox8(self):
        groupbox8 = QGroupBox(self)
        groupbox8.setObjectName("searchGroupBox")
        groupbox8.setStyleSheet("border: none")
        hbox = QVBoxLayout()
        hbox.addWidget(self.btnSearch(), alignment=Qt.AlignRight)
        hbox.addWidget(self.searchLine())
        vbox_ready = QHBoxLayout()
        vbox_ready.addLayout(hbox)
        groupbox8.setLayout(vbox_ready)

        return groupbox8

    def searchLine(self):
        self.searchLine = QLineEdit(self)
        self.searchLine.setMinimumSize(750, 20)
        self.searchLine.hide()
        self.searchLine.move(18, 14)
        self.searchLine.setClearButtonEnabled(True)
        serchLineX = self.searchLine.addAction(QIcon("images/closeSearch.png"), QLineEdit.TrailingPosition)
        serchLineX.triggered.connect(self.closesearchLine)

    def btnSearch(self):
        self.btnSearch = QPushButton(self)
        self.btnSearch.setIcon(QIcon('images/search.png'))
        self.btnSearch.setStyleSheet('border: 0px; padding: 0px;')
        self.btnSearch.setIconSize(QSize(20, 20))
        self.btnSearch.setToolTip('Нажмите, для осуществления\n'
                                  'поиска')
        self.btnSearch.clicked.connect(self.showsearchLine)

        return self.btnSearch

    def showsearchLine(self):
        self.btnSearch.hide()
        self.searchLine.show()

    def closesearchLine(self):
        self.searchLine.hide()
        self.btnSearch.show()


class Tab_2(QWidget):
    def __init__(self):
        super().__init__()

class Tab_3(QWidget):
    def __init__(self):
        super().__init__()



if __name__ == ('__main__'):
    import sys
    app = QApplication(sys.argv)
    db = QSqlDatabase.addDatabase("QSQLITE")
    db.setDatabaseName("config/ter.db")
    db.open()
    db.close()
    w = mainwindow()
    w.show()
    sys.exit(app.exec_())

Ответы (0 шт):