UI in QT is not outputting anything, not even console outputs

I have a basic QT Creator application with a main page called MyBroker, and a button that switches it to the Signin Page. The main page outputs and functions correctly, but the Signin Page does not. The UI itself functions fine but nothing is outputted, including log statements. I have tried revisiting everything ChatGPT and I could think of but nothing seems to work.

I did not include the ui file but all the members between the ui and source/header files check out, and the signup_ui.h is created. Also the projects builds and deploys.
I also have mongocxx drivers installed but that should not affect anything with the basic issue.

MyBroker.cpp

#include "mybroker.h"
#include "ui_mybroker.h"
#include "ui_login.h"
#include "ui_signup.h"
#include "mongohandler.h"
#include <iostream>



MyBroker::MyBroker(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MyBroker),
      Signupui(nullptr),
      Loginui(nullptr),
      currentWidget(nullptr)

{
    ui->setupUi(this);

    connect(ui->loginButton,&QPushButton::clicked,this, [=](){
        SwitchUI("Login");
    });
    connect(ui->signUpButton,&QPushButton::clicked,this, [=](){
        SwitchUI("Signup");
    });
}

MyBroker::~MyBroker()
{
    delete ui;
    if (Signupui) {
        delete Signupui;
    }
    if (Loginui) {
        delete Loginui;
    }
    delete currentWidget;
}

void MyBroker::SwitchUI(const QString &newUI) {
    std::cout << "Switch" << std::endl;
    if (currentWidget) {
        delete currentWidget;
        currentWidget = nullptr;
    }

    currentWidget = new QWidget(this);
    if (newUI == "Signup") {
        Signupui = new Ui::Signup;
        Signupui->setupUi(currentWidget);
    }
    else if (newUI == "Login") {
        Loginui = new Ui::Login;
        Loginui->setupUi(currentWidget);
    }
    setCentralWidget(currentWidget);





}


bool MyBroker::eventFilter(QObject *obj, QEvent *event) {
    
    QLineEdit *lineEdit = qobject_cast<QLineEdit*>(obj);
    if (lineEdit) {
        if (event->type() == QEvent::FocusIn) {
            lineEdit->clear(); // Clear text when the field gains focus
        } else if (event->type() == QEvent::FocusOut) {
            if (lineEdit->text().isEmpty()) {
                lineEdit->clear(); // Clear the placeholder text if the field is empty
            }
        }
    }
    return QMainWindow::eventFilter(obj, event);
}

signup.cpp

#include "signup.h"
#include "ui_signup.h"
#include "mongohandler.h"
#include <iostream>
#include <bsoncxx/json.hpp>
#include <mongocxx/client.hpp>
#include <mongocxx/instance.hpp>

Signup::Signup(QWidget *parent)
    : MyBroker(parent),
    ui(new Ui::Signup)
{
    ui->setupUi(this);

    if (ui->SignupButton) {
        std::cout << "SignupButton exists" << std::endl;
    }

    connect(ui->SignupButton, &QPushButton::clicked, this, &Signup::checkInfo);
}

Signup::~Signup()
{
    delete ui;
}

QString Signup::getText(const QString type) const {
    QLineEdit *lineEdit = findChild<QLineEdit*>(type);
    if (lineEdit) {
        return lineEdit->text();
    }
    return QString();
}

bool Signup::checkInfo() {
    std::cout << "Signup button clicked" << std::endl;

    MongoDBHandler handler = connectMongo();
    QString password = getText("signupPassword");
    QString confirmPassword = getText("confirmPassword");
    QString email = getText("signupEmail");
    QString username = getText("signupUsername");
    QString firstName = getText("firstName");
    QString lastName = getText("lastName");

    QStringList info = {password, confirmPassword, email, username, firstName, lastName};
    bool error = false;

    for (const QString &field : info) {
        if (field.isEmpty()) {
            error = true;
            errorHandle("emptyField");
        }
    }

    if (password != confirmPassword) {
        errorHandle("mismatchPassword");
        error = true;
    }

    if (handler.Exists("email", email.toStdString())) {
        errorHandle("emailExists");
        error = true;
    }

    if (handler.Exists("username", username.toStdString())) {
        errorHandle("usernameExists");
        error = true;
    }

    if (error) {
        return false;
    } else {
        errorHandle("none");
        // Assuming you want to switch to login UI after successful signup
        // Emit a signal or call a method to switch UI
        return true;
    }
}

void Signup::errorHandle(QString error) {
    if (error == "emptyField") {
        ui->errorText->setText("Please fill in all fields.");
    } else if (error == "usernameExists") {
        ui->errorText->setText("Username already exists.");
    } else if (error == "emailExists") {
        ui->errorText->setText("Email is already used.");
    } else if (error == "mismatchPassword") {
        ui->errorText->setText("Passwords do not match.");
    } else if (error == "none") {
        ui->errorText->setText("");
    }
}

MongoDBHandler Signup::connectMongo() {
    MongoDBHandler handler;
    if (!handler.connect(connect, "MyBroker", "Login")) {
        std::cerr << "Failed to connect to the database" << std::endl;
    } else {
        std::cout << "Connected to the database" << std::endl;
    }
    return handler;
}

signup.h

#ifndef SIGNUP_H
#define SIGNUP_H

#include "qmainwindow.h"
#include <QWidget>
#include "ui_signup.h"
#include "ui_login.h"
#include "mongohandler.h"
#include "mybroker.h"

namespace Ui {
class Signup;
class Login;
}

class Signup : public MyBroker
{
    Q_OBJECT

public:
    explicit Signup(QWidget *parent = nullptr);
    QString getText(QString type) const;

    bool checkInfo();
    void errorHandle(QString error);
    void sendInfo();
    MongoDBHandler connectMongo();

    ~Signup();

private:
    Ui::Signup *ui;
    Ui::Login *Loginui;
    QWidget *currentWidget;
    QString lastName;
    QString firstName;
    QString email;
    QString username;
    QString password;


};
#endif // SIGNUP_H

I tried configuring the .pro file, including more header/source files than needed, and troubleshooting/debugging but I cannot figure out whats wrong. ChatGPT, which has usually worked well with debugging basic QT Creator issues cannot figure it out aswell.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật