Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 42 additions & 41 deletions application/widgets/accessible/accessiblewidget.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd.
// SPDX-FileCopyrightText: 2022 - 2026 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-only

#include "ddlog.h"

Check warning on line 5 in application/widgets/accessible/accessiblewidget.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: "ddlog.h" not found.
#include "accessiblewidget.h"
#include <QLabel>

Check warning on line 7 in application/widgets/accessible/accessiblewidget.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QLabel> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QPushButton>

Check warning on line 8 in application/widgets/accessible/accessiblewidget.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QPushButton> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QComboBox>
#include <QDebug>

Expand All @@ -12,134 +13,134 @@
: QAccessibleWidget(widget)
, m_widget(widget)
{
qDebug() << "AccessibleWidget::AccessibleWidget constructor called.";
qCDebug(appLog) << "AccessibleWidget::AccessibleWidget constructor called.";
}

AccessibleWidget::~AccessibleWidget()
{
// qDebug() << "AccessibleWidget::~AccessibleWidget destructor called.";
// qCDebug(appLog) << "AccessibleWidget::~AccessibleWidget destructor called.";
}

void *AccessibleWidget::interface_cast(QAccessible::InterfaceType t)
{
qDebug() << "AccessibleWidget::interface_cast called with type:" << t;
qCDebug(appLog) << "AccessibleWidget::interface_cast called with type:" << t;
switch (t) {
case QAccessible::ActionInterface:
qDebug() << "Interface cast to ActionInterface.";
qCDebug(appLog) << "Interface cast to ActionInterface.";
return static_cast<QAccessibleActionInterface *>(this);
case QAccessible::TextInterface:
qDebug() << "Interface cast to TextInterface.";
qCDebug(appLog) << "Interface cast to TextInterface.";
return static_cast<QAccessibleTextInterface *>(this);
default:
qDebug() << "Interface cast to unknown type.";
qCDebug(appLog) << "Interface cast to unknown type.";
return nullptr;
}
}

QString AccessibleWidget::text(QAccessible::Text t) const
{
qDebug() << "AccessibleWidget::text called with text type:" << t;
qCDebug(appLog) << "AccessibleWidget::text called with text type:" << t;
switch (t) {
case QAccessible::Name:
qDebug() << "Returning accessible name.";
qCDebug(appLog) << "Returning accessible name.";
return m_widget->accessibleName();
case QAccessible::Description:
qDebug() << "Returning accessible description.";
qCDebug(appLog) << "Returning accessible description.";
return m_widget->accessibleDescription();
default:
qDebug() << "Returning empty string for unknown text type.";
qCDebug(appLog) << "Returning empty string for unknown text type.";
return QString();
}
}

QString AccessibleWidget::text(int startOffset, int endOffset) const
{
qDebug() << "AccessibleWidget::text(int, int) called.";
qCDebug(appLog) << "AccessibleWidget::text(int, int) called.";
Q_UNUSED(startOffset)
Q_UNUSED(endOffset)

Check warning on line 60 in application/widgets/accessible/accessiblewidget.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

syntax error

return QString();
}

void AccessibleWidget::selection(int selectionIndex, int *startOffset, int *endOffset) const
{
qDebug() << "AccessibleWidget::selection called.";
qCDebug(appLog) << "AccessibleWidget::selection called.";
Q_UNUSED(selectionIndex)
Q_UNUSED(startOffset)
Q_UNUSED(endOffset)
}

int AccessibleWidget::selectionCount() const
{
qDebug() << "AccessibleWidget::selectionCount called.";
qCDebug(appLog) << "AccessibleWidget::selectionCount called.";
return 0;
}

void AccessibleWidget::addSelection(int startOffset, int endOffset)
{
qDebug() << "AccessibleWidget::addSelection called.";
qCDebug(appLog) << "AccessibleWidget::addSelection called.";
Q_UNUSED(startOffset)
Q_UNUSED(endOffset)
}

void AccessibleWidget::removeSelection(int selectionIndex)
{
qDebug() << "AccessibleWidget::removeSelection called.";
qCDebug(appLog) << "AccessibleWidget::removeSelection called.";
Q_UNUSED(selectionIndex)
}

void AccessibleWidget::setSelection(int selectionIndex, int startOffset, int endOffset)
{
qDebug() << "AccessibleWidget::setSelection called.";
qCDebug(appLog) << "AccessibleWidget::setSelection called.";
Q_UNUSED(selectionIndex)
Q_UNUSED(startOffset)
Q_UNUSED(endOffset)
}

int AccessibleWidget::cursorPosition() const
{
qDebug() << "AccessibleWidget::cursorPosition called.";
qCDebug(appLog) << "AccessibleWidget::cursorPosition called.";
return 0;
}

void AccessibleWidget::setCursorPosition(int position)
{
qDebug() << "AccessibleWidget::setCursorPosition called.";
qCDebug(appLog) << "AccessibleWidget::setCursorPosition called.";
Q_UNUSED(position)
}

int AccessibleWidget::characterCount() const
{
qDebug() << "AccessibleWidget::characterCount called.";
qCDebug(appLog) << "AccessibleWidget::characterCount called.";
return 0;
}

QRect AccessibleWidget::characterRect(int offset) const
{
qDebug() << "AccessibleWidget::characterRect called.";
qCDebug(appLog) << "AccessibleWidget::characterRect called.";
Q_UNUSED(offset)

return QRect();
}

int AccessibleWidget::offsetAtPoint(const QPoint &point) const
{
qDebug() << "AccessibleWidget::offsetAtPoint called.";
qCDebug(appLog) << "AccessibleWidget::offsetAtPoint called.";
Q_UNUSED(point)

return 0;
}

void AccessibleWidget::scrollToSubstring(int startIndex, int endIndex)
{
qDebug() << "AccessibleWidget::scrollToSubstring called.";
qCDebug(appLog) << "AccessibleWidget::scrollToSubstring called.";
Q_UNUSED(startIndex)
Q_UNUSED(endIndex)
}

QString AccessibleWidget::attributes(int offset, int *startOffset, int *endOffset) const
{
qDebug() << "AccessibleWidget::attributes called.";
qCDebug(appLog) << "AccessibleWidget::attributes called.";
Q_UNUSED(offset)
Q_UNUSED(startOffset)
Q_UNUSED(endOffset)
Expand All @@ -151,76 +152,76 @@
: AccessibleWidget(label)
, m_label(label)
{
qDebug() << "AccessibleLabel::AccessibleLabel constructor called.";
qCDebug(appLog) << "AccessibleLabel::AccessibleLabel constructor called.";
}

AccessibleLabel::~AccessibleLabel()
{
// qDebug() << "AccessibleLabel::~AccessibleLabel destructor called.";
// qCDebug(appLog) << "AccessibleLabel::~AccessibleLabel destructor called.";
}

QString AccessibleLabel::text(int startOffset, int endOffset) const
{
qDebug() << "AccessibleLabel::text(int, int) called.";
qCDebug(appLog) << "AccessibleLabel::text(int, int) called.";
if (Q_NULLPTR != m_label) {
qDebug() << "Label is not null.";
qCDebug(appLog) << "Label is not null.";
if (m_label->objectName().contains("@==@")) {
qDebug() << "Label object name contains '@==@', removing it.";
qCDebug(appLog) << "Label object name contains '@==@', removing it.";
return m_label->objectName().remove("@==@");
} else {
qDebug() << "Label object name does not contain '@==@', returning text.";
qCDebug(appLog) << "Label object name does not contain '@==@', returning text.";
return m_label->text();
}
}

qDebug() << "Label is null, calling base class text.";
qCDebug(appLog) << "Label is null, calling base class text.";
return AccessibleWidget::text(startOffset, endOffset);
}

AccessibleButton::AccessibleButton(QPushButton *button)
: AccessibleWidget(button)
, m_button(button)
{
qDebug() << "AccessibleButton::AccessibleButton constructor called.";
qCDebug(appLog) << "AccessibleButton::AccessibleButton constructor called.";
}

AccessibleButton::~AccessibleButton()
{
qDebug() << "AccessibleButton::~AccessibleButton destructor called.";
qCDebug(appLog) << "AccessibleButton::~AccessibleButton destructor called.";
}

QString AccessibleButton::text(int startOffset, int endOffset) const
{
qDebug() << "AccessibleButton::text(int, int) called.";
qCDebug(appLog) << "AccessibleButton::text(int, int) called.";
if (Q_NULLPTR != m_button) {
qDebug() << "Button is not null, returning text.";
qCDebug(appLog) << "Button is not null, returning text.";
return m_button->text();
}

qDebug() << "Button is null, calling base class text.";
qCDebug(appLog) << "Button is null, calling base class text.";
return AccessibleWidget::text(startOffset, endOffset);
}

AccessibleComboBox::AccessibleComboBox(QComboBox *comboBox)
: AccessibleWidget(comboBox)
, m_comboBox(comboBox)
{
qDebug() << "AccessibleComboBox::AccessibleComboBox constructor called.";
qCDebug(appLog) << "AccessibleComboBox::AccessibleComboBox constructor called.";
}

AccessibleComboBox::~AccessibleComboBox()
{
qDebug() << "AccessibleComboBox::~AccessibleComboBox destructor called.";
qCDebug(appLog) << "AccessibleComboBox::~AccessibleComboBox destructor called.";
}

QString AccessibleComboBox::text(int startOffset, int endOffset) const
{
qDebug() << "AccessibleComboBox::text(int, int) called.";
qCDebug(appLog) << "AccessibleComboBox::text(int, int) called.";
if (Q_NULLPTR != m_comboBox) {
qDebug() << "ComboBox is not null, returning current text.";
qCDebug(appLog) << "ComboBox is not null, returning current text.";
return m_comboBox->currentText();
}

qDebug() << "ComboBox is null, calling base class text.";
qCDebug(appLog) << "ComboBox is null, calling base class text.";
return AccessibleWidget::text(startOffset, endOffset);
}
31 changes: 16 additions & 15 deletions application/widgets/animationdialog.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd.
// SPDX-FileCopyrightText: 2022 - 2026 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-only


#include "ddlog.h"

Check warning on line 6 in application/widgets/animationdialog.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: "ddlog.h" not found.
#include "animationdialog.h"

#include <DWindowCloseButton>

Check warning on line 9 in application/widgets/animationdialog.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <DWindowCloseButton> not found. Please note: Cppcheck does not need standard library headers to get proper results.

#include <QVBoxLayout>
#include <QKeyEvent>
Expand All @@ -13,65 +14,65 @@

AnimationDialog::AnimationDialog(QWidget *parent) : DDialog(parent)
{
qDebug() << "AnimationDialog initializing...";
qCDebug(appLog) << "AnimationDialog initializing...";
initUi();
qDebug() << "AnimationDialog initialized";
qCDebug(appLog) << "AnimationDialog initialized";
}

void AnimationDialog::initUi()
{
qDebug() << "AnimationDialog::initUi called.";
qCDebug(appLog) << "AnimationDialog::initUi called.";
setFixedSize(380, 160);
setWindowFlags(windowFlags() & ~Qt::WindowCloseButtonHint);
qDebug() << "AnimationDialog window flags set.";
qCDebug(appLog) << "AnimationDialog window flags set.";

DFrame *m_mainFrame = new DFrame(this);
m_mainFrame->setFrameRounded(false);
m_mainFrame->setFrameStyle(DFrame::NoFrame);
addContent(m_mainFrame);
qDebug() << "Main frame initialized and added as content.";
qCDebug(appLog) << "Main frame initialized and added as content.";

m_label = new DLabel(this);
m_label->setAccessibleName("animationTitle");
qDebug() << "Label initialized.";
qCDebug(appLog) << "Label initialized.";
QVBoxLayout *mainLayout = new QVBoxLayout(m_mainFrame);
m_spinner = new DSpinner(m_mainFrame);
m_spinner->setFixedSize(28, 28);
m_spinner->start();
m_spinner->hide();
qDebug() << "Spinner initialized and started, initially hidden.";
qCDebug(appLog) << "Spinner initialized and started, initially hidden.";

mainLayout->addWidget(m_label, 0, Qt::AlignCenter | Qt::AlignTop);
mainLayout->addSpacing(15);
mainLayout->addWidget(m_spinner, 0, Qt::AlignCenter);
mainLayout->addStretch();
mainLayout->setSpacing(0);
mainLayout->setContentsMargins(0, 0, 0, 0);
qDebug() << "Layout configured.";
qCDebug(appLog) << "Layout configured.";
}

void AnimationDialog::setShowSpinner(bool isShow, const QString &title)
{
qDebug() << "Setting spinner visibility:" << isShow << "with title:" << title;
qCDebug(appLog) << "Setting spinner visibility:" << isShow << "with title:" << title;

if (isShow) {
qDebug() << "Showing spinner.";
qCDebug(appLog) << "Showing spinner.";
m_label->setText(title);
m_spinner->show();
} else {
qDebug() << "Hiding spinner.";
qCDebug(appLog) << "Hiding spinner.";
m_spinner->hide();
}
}

void AnimationDialog::keyPressEvent(QKeyEvent *event)
{
// qDebug() << "AnimationDialog::keyPressEvent called. Key:" << event->key();
// qCDebug(appLog) << "AnimationDialog::keyPressEvent called. Key:" << event->key();
if (event->key() == Qt::Key::Key_Escape) {
qDebug() << "Escape key pressed, ignoring event";
qCDebug(appLog) << "Escape key pressed, ignoring event";
event->ignore();
} else {
// qDebug() << "Other key pressed, calling base keyPressEvent.";
// qCDebug(appLog) << "Other key pressed, calling base keyPressEvent.";
DDialog::keyPressEvent(event);
}
}
Expand Down
11 changes: 6 additions & 5 deletions application/widgets/centerwidget.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd.
// SPDX-FileCopyrightText: 2022 - 2026 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-only


#include "ddlog.h"

Check warning on line 6 in application/widgets/centerwidget.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: "ddlog.h" not found.
#include "centerwidget.h"
#include "titlewidget.h"
#include "mainsplitter.h"
Expand All @@ -17,18 +18,18 @@
CenterWidget::CenterWidget(DWidget *parent)
: Dtk::Widget::DWidget(parent)
{
qDebug() << "CenterWidget initializing...";
qCDebug(appLog) << "CenterWidget initializing...";
initUi();
}

CenterWidget::~CenterWidget()
{
qDebug() << "CenterWidget destroyed";
qCDebug(appLog) << "CenterWidget destroyed";
}

void CenterWidget::HandleQuit()
{
qDebug() << "Handling CenterWidget quit";
qCDebug(appLog) << "Handling CenterWidget quit";
}

TitleWidget *CenterWidget::getTitleWidget()
Expand All @@ -38,7 +39,7 @@

void CenterWidget::initUi()
{
qDebug() << "Initializing CenterWidget UI";
qCDebug(appLog) << "Initializing CenterWidget UI";

m_titleWidget = new TitleWidget(this);
QVBoxLayout *mainlayout = new QVBoxLayout;
Expand Down
Loading
Loading