remove debug output from FocusController
This commit is contained in:
parent
32ef1eae84
commit
caf29fb982
1 changed files with 0 additions and 50 deletions
|
|
@ -18,7 +18,6 @@ FocusController::FocusController(QQmlApplicationEngine *engine, QObject *parent)
|
|||
QQuickItem *newDefaultFocusItem = object->findChild<QQuickItem *>("defaultFocusItem");
|
||||
if (newDefaultFocusItem && m_defaultFocusItem != newDefaultFocusItem) {
|
||||
m_defaultFocusItem.reset(newDefaultFocusItem);
|
||||
qDebug() << "===>> NEW DEFAULT FOCUS ITEM: " << m_defaultFocusItem;
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -60,35 +59,25 @@ void FocusController::setFocusItem(QQuickItem *item)
|
|||
{
|
||||
if (m_focusedItem != item) {
|
||||
m_focusedItem = item;
|
||||
qDebug() << "===>> FocusItem is changed to " << item << "!";
|
||||
} else {
|
||||
qDebug() << "===>> FocusItem is is the same: " << item << "!";
|
||||
}
|
||||
emit focusedItemChanged();
|
||||
}
|
||||
|
||||
void FocusController::setFocusOnDefaultItem()
|
||||
{
|
||||
qDebug() << "===>> Setting focus on DEFAULT FOCUS ITEM...";
|
||||
setFocusItem(m_defaultFocusItem.get());
|
||||
}
|
||||
|
||||
void FocusController::pushRootObject(QObject *object)
|
||||
{
|
||||
qDebug() << "===>> Calling < pushRootObject >...";
|
||||
m_rootObjects.push(object);
|
||||
dropListView();
|
||||
// setFocusOnDefaultItem();
|
||||
qDebug() << "===>> ROOT OBJECT is changed to: " << m_rootObjects.top();
|
||||
qDebug() << "===>> ROOT OBJECTS: " << m_rootObjects;
|
||||
}
|
||||
|
||||
void FocusController::dropRootObject(QObject *object)
|
||||
{
|
||||
qDebug() << "===>> Calling < dropRootObject >...";
|
||||
if (m_rootObjects.empty()) {
|
||||
qDebug() << "ROOT OBJECT is already DEFAULT";
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -96,11 +85,6 @@ void FocusController::dropRootObject(QObject *object)
|
|||
m_rootObjects.pop();
|
||||
dropListView();
|
||||
setFocusOnDefaultItem();
|
||||
if (m_rootObjects.size()) {
|
||||
qDebug() << "===>> ROOT OBJECT is changed to: " << m_rootObjects.top();
|
||||
} else {
|
||||
qDebug() << "===>> ROOT OBJECT is changed to DEFAULT";
|
||||
}
|
||||
} else {
|
||||
qWarning() << "===>> TRY TO DROP WRONG ROOT OBJECT: " << m_rootObjects.top() << " SHOULD BE: " << object;
|
||||
}
|
||||
|
|
@ -108,14 +92,11 @@ void FocusController::dropRootObject(QObject *object)
|
|||
|
||||
void FocusController::resetRootObject()
|
||||
{
|
||||
qDebug() << "===>> Calling < resetRootObject >...";
|
||||
m_rootObjects.clear();
|
||||
qDebug() << "===>> ROOT OBJECT IS RESETED";
|
||||
}
|
||||
|
||||
void FocusController::reload(Direction direction)
|
||||
{
|
||||
qDebug() << "===>> Calling < reload >...";
|
||||
m_focusChain.clear();
|
||||
|
||||
QObject *rootObject = (m_rootObjects.empty() ? m_engine->rootObjects().value(0) : m_rootObjects.top());
|
||||
|
|
@ -127,8 +108,6 @@ void FocusController::reload(Direction direction)
|
|||
return;
|
||||
}
|
||||
|
||||
qDebug() << "===>> ROOT OBJECTS: " << rootObject;
|
||||
|
||||
m_focusChain.append(focusControl::getSubChain(rootObject));
|
||||
|
||||
std::sort(m_focusChain.begin(), m_focusChain.end(),
|
||||
|
|
@ -144,13 +123,10 @@ void FocusController::reload(Direction direction)
|
|||
|
||||
void FocusController::nextItem(Direction direction)
|
||||
{
|
||||
qDebug() << "===>> Calling < nextItem >...";
|
||||
|
||||
reload(direction);
|
||||
|
||||
if (m_lvfc && focusControl::isListView(m_focusedItem)) {
|
||||
direction == Direction::Forward ? focusNextListViewItem() : focusPreviousListViewItem();
|
||||
qDebug() << "===>> Handling the [ ListView ]...";
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
@ -164,13 +140,10 @@ void FocusController::nextItem(Direction direction)
|
|||
auto focusedItemIndex = m_focusChain.indexOf(m_focusedItem);
|
||||
|
||||
if (focusedItemIndex == -1) {
|
||||
qDebug() << "Current FocusItem is not in chain, switch to first in chain...";
|
||||
focusedItemIndex = 0;
|
||||
} else if (focusedItemIndex == (m_focusChain.size() - 1)) {
|
||||
qDebug() << "Last focus index. Starting from the beginning...";
|
||||
focusedItemIndex = 0;
|
||||
} else {
|
||||
qDebug() << "Incrementing focus index...";
|
||||
focusedItemIndex++;
|
||||
}
|
||||
|
||||
|
|
@ -183,7 +156,6 @@ void FocusController::nextItem(Direction direction)
|
|||
}
|
||||
|
||||
if (focusControl::isListView(focusedItem)) {
|
||||
qDebug() << "===>> Found [ListView]";
|
||||
m_lvfc = new ListViewFocusController(focusedItem, this);
|
||||
m_focusedItem = focusedItem;
|
||||
if (direction == Direction::Forward) {
|
||||
|
|
@ -197,33 +169,16 @@ void FocusController::nextItem(Direction direction)
|
|||
}
|
||||
|
||||
setFocusItem(focusedItem);
|
||||
|
||||
focusControl::printItems(m_focusChain, focusedItem);
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
const auto w = m_defaultFocusItem->window();
|
||||
|
||||
qDebug() << "===>> CURRENT ACTIVE ITEM: " << w->activeFocusItem();
|
||||
qDebug() << "===>> CURRENT FOCUS OBJECT: " << w->focusObject();
|
||||
if (m_rootObjects.empty()) {
|
||||
qDebug() << "===>> ROOT OBJECT IS DEFAULT";
|
||||
} else {
|
||||
qDebug() << "===>> ROOT OBJECT: " << m_rootObjects.top();
|
||||
}
|
||||
}
|
||||
|
||||
void FocusController::focusNextListViewItem()
|
||||
{
|
||||
qDebug() << "===>> Calling < focusNextListViewItem >...";
|
||||
m_lvfc->reloadFocusChain();
|
||||
if (m_lvfc->isLastFocusItemInListView() || m_lvfc->isReturnNeeded()) {
|
||||
qDebug() << "===>> Last item in [ ListView ] was reached. Going to the NEXT element after [ ListView ]";
|
||||
dropListView();
|
||||
nextItem(Direction::Forward);
|
||||
return;
|
||||
} else if (m_lvfc->isLastFocusItemInDelegate()) {
|
||||
qDebug() << "===>> End of delegate's elements was reached. Going to the next delegate";
|
||||
m_lvfc->resetFocusChain();
|
||||
m_lvfc->nextDelegate();
|
||||
}
|
||||
|
|
@ -233,15 +188,12 @@ void FocusController::focusNextListViewItem()
|
|||
|
||||
void FocusController::focusPreviousListViewItem()
|
||||
{
|
||||
qDebug() << "===>> Calling < focusPreviousListViewItem >...";
|
||||
m_lvfc->reloadFocusChain();
|
||||
if (m_lvfc->isFirstFocusItemInListView() || m_lvfc->isReturnNeeded()) {
|
||||
qDebug() << "===>> First item in [ ListView ] was reached. Going to the PREVIOUS element after [ ListView ]";
|
||||
dropListView();
|
||||
nextItem(Direction::Backward);
|
||||
return;
|
||||
} else if (m_lvfc->isFirstFocusItemInDelegate()) {
|
||||
qDebug() << "===>> End of delegate's elements was reached. Going to the previous delegate";
|
||||
m_lvfc->resetFocusChain();
|
||||
m_lvfc->previousDelegate();
|
||||
}
|
||||
|
|
@ -251,8 +203,6 @@ void FocusController::focusPreviousListViewItem()
|
|||
|
||||
void FocusController::dropListView()
|
||||
{
|
||||
qDebug() << "===>> Calling < dropListView >...";
|
||||
|
||||
if (m_lvfc) {
|
||||
delete m_lvfc;
|
||||
m_lvfc = nullptr;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue