remove debug output from ListViewFocusController
This commit is contained in:
parent
caf29fb982
commit
b25d911328
2 changed files with 1 additions and 17 deletions
|
|
@ -32,18 +32,15 @@ void ListViewFocusController::viewAtCurrentIndex() const
|
||||||
switch (m_currentSection) {
|
switch (m_currentSection) {
|
||||||
case Section::Default: [[fallthrough]];
|
case Section::Default: [[fallthrough]];
|
||||||
case Section::Header: {
|
case Section::Header: {
|
||||||
qDebug() << "===>> [FOCUS ON BEGINNING...]";
|
|
||||||
QMetaObject::invokeMethod(m_listView, "positionViewAtBeginning");
|
QMetaObject::invokeMethod(m_listView, "positionViewAtBeginning");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case Section::Delegate: {
|
case Section::Delegate: {
|
||||||
qDebug() << "===>> [FOCUS ON INDEX...]";
|
|
||||||
QMetaObject::invokeMethod(m_listView, "positionViewAtIndex", Q_ARG(int, m_delegateIndex), // Index
|
QMetaObject::invokeMethod(m_listView, "positionViewAtIndex", Q_ARG(int, m_delegateIndex), // Index
|
||||||
Q_ARG(int, 2)); // PositionMode (0 = Visible)
|
Q_ARG(int, 2)); // PositionMode (0 = Visible)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case Section::Footer: {
|
case Section::Footer: {
|
||||||
qDebug() << "===>> [FOCUS ON END...]";
|
|
||||||
QMetaObject::invokeMethod(m_listView, "positionViewAtEnd");
|
QMetaObject::invokeMethod(m_listView, "positionViewAtEnd");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -68,8 +65,6 @@ void ListViewFocusController::setDelegateIndex(int index)
|
||||||
|
|
||||||
void ListViewFocusController::nextDelegate()
|
void ListViewFocusController::nextDelegate()
|
||||||
{
|
{
|
||||||
printSectionName();
|
|
||||||
|
|
||||||
switch (m_currentSection) {
|
switch (m_currentSection) {
|
||||||
case Section::Default: {
|
case Section::Default: {
|
||||||
if (hasHeader()) {
|
if (hasHeader()) {
|
||||||
|
|
@ -198,7 +193,6 @@ QQuickItem *ListViewFocusController::focusedItem() const
|
||||||
void ListViewFocusController::focusNextItem()
|
void ListViewFocusController::focusNextItem()
|
||||||
{
|
{
|
||||||
if (m_isReturnNeeded) {
|
if (m_isReturnNeeded) {
|
||||||
qDebug() << "===>> [ RETURN IS NEEDED... ]";
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -212,7 +206,6 @@ void ListViewFocusController::focusNextItem()
|
||||||
}
|
}
|
||||||
m_focusedItemIndex++;
|
m_focusedItemIndex++;
|
||||||
m_focusedItem = qobject_cast<QQuickItem *>(m_focusChain.at(m_focusedItemIndex));
|
m_focusedItem = qobject_cast<QQuickItem *>(m_focusChain.at(m_focusedItemIndex));
|
||||||
qDebug() << "==>> [ Focused Item: " << m_focusedItem << " with Index: " << m_focusedItemIndex << " ]";
|
|
||||||
m_focusedItem->forceActiveFocus(Qt::TabFocusReason);
|
m_focusedItem->forceActiveFocus(Qt::TabFocusReason);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -223,7 +216,7 @@ void ListViewFocusController::focusPreviousItem()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_focusChain.empty()) {
|
if (m_focusChain.empty()) {
|
||||||
qDebug() << "Empty focusChain with current delegate: " << currentDelegate() << "Scanning for elements...";
|
qInfo() << "Empty focusChain with current delegate: " << currentDelegate() << "Scanning for elements...";
|
||||||
reloadFocusChain();
|
reloadFocusChain();
|
||||||
}
|
}
|
||||||
if (m_focusChain.empty()) {
|
if (m_focusChain.empty()) {
|
||||||
|
|
@ -237,7 +230,6 @@ void ListViewFocusController::focusPreviousItem()
|
||||||
}
|
}
|
||||||
m_focusedItemIndex--;
|
m_focusedItemIndex--;
|
||||||
m_focusedItem = qobject_cast<QQuickItem *>(m_focusChain.at(m_focusedItemIndex));
|
m_focusedItem = qobject_cast<QQuickItem *>(m_focusChain.at(m_focusedItemIndex));
|
||||||
qDebug() << "==>> [ Focused Item: " << m_focusedItem << " with Index: " << m_focusedItemIndex << " ]";
|
|
||||||
m_focusedItem->forceActiveFocus(Qt::TabFocusReason);
|
m_focusedItem->forceActiveFocus(Qt::TabFocusReason);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -273,12 +265,6 @@ bool ListViewFocusController::hasFooter() const
|
||||||
return m_footer && !focusControl::getItemsChain(m_footer).isEmpty();
|
return m_footer && !focusControl::getItemsChain(m_footer).isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ListViewFocusController::printSectionName() const
|
|
||||||
{
|
|
||||||
const auto sectionName = m_currentSectionString[static_cast<int>(m_currentSection)];
|
|
||||||
qDebug() << "===>> [nextDelegate... current section: " << sectionName << " ]";
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ListViewFocusController::isFirstFocusItemInListView() const
|
bool ListViewFocusController::isFirstFocusItemInListView() const
|
||||||
{
|
{
|
||||||
switch (m_currentSection) {
|
switch (m_currentSection) {
|
||||||
|
|
|
||||||
|
|
@ -54,8 +54,6 @@ private:
|
||||||
bool hasHeader() const;
|
bool hasHeader() const;
|
||||||
bool hasFooter() const;
|
bool hasFooter() const;
|
||||||
|
|
||||||
void printSectionName() const;
|
|
||||||
|
|
||||||
QQuickItem *m_listView;
|
QQuickItem *m_listView;
|
||||||
QList<QObject *> m_focusChain;
|
QList<QObject *> m_focusChain;
|
||||||
Section m_currentSection;
|
Section m_currentSection;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue