mirror of
https://invent.kde.org/network/falkon.git
synced 2024-11-11 09:32:12 +01:00
[CodingStyle] TabStackedWidget::isValid should be private
And also choose better name - validIndex
This commit is contained in:
parent
1d1451aee4
commit
08929228bd
|
@ -80,11 +80,6 @@ void TabStackedWidget::setTabBar(ComboTabBar* tb)
|
||||||
setUpLayout();
|
setUpLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TabStackedWidget::isValid(int index)
|
|
||||||
{
|
|
||||||
return (index < m_stack->count() && index >= 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
void TabStackedWidget::tabWasRemoved(int index)
|
void TabStackedWidget::tabWasRemoved(int index)
|
||||||
{
|
{
|
||||||
m_tabBar->removeTab(index);
|
m_tabBar->removeTab(index);
|
||||||
|
@ -168,7 +163,7 @@ void TabStackedWidget::keyPressEvent(QKeyEvent* event)
|
||||||
|
|
||||||
void TabStackedWidget::showTab(int index)
|
void TabStackedWidget::showTab(int index)
|
||||||
{
|
{
|
||||||
if (isValid(index)) {
|
if (validIndex(index)) {
|
||||||
m_stack->setCurrentIndex(index);
|
m_stack->setCurrentIndex(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -301,3 +296,8 @@ int TabStackedWidget::count() const
|
||||||
{
|
{
|
||||||
return m_tabBar->count();
|
return m_tabBar->count();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool TabStackedWidget::validIndex(int index) const
|
||||||
|
{
|
||||||
|
return (index < m_stack->count() && index >= 0);
|
||||||
|
}
|
||||||
|
|
|
@ -38,8 +38,6 @@ public:
|
||||||
ComboTabBar* tabBar();
|
ComboTabBar* tabBar();
|
||||||
void setTabBar(ComboTabBar* tb);
|
void setTabBar(ComboTabBar* tb);
|
||||||
|
|
||||||
bool isValid(int index);
|
|
||||||
|
|
||||||
bool documentMode() const;
|
bool documentMode() const;
|
||||||
void setDocumentMode(bool enabled);
|
void setDocumentMode(bool enabled);
|
||||||
|
|
||||||
|
@ -64,16 +62,14 @@ public:
|
||||||
int indexOf(QWidget* widget) const;
|
int indexOf(QWidget* widget) const;
|
||||||
int count() const;
|
int count() const;
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void currentChanged(int index);
|
||||||
|
void tabCloseRequested(int index);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void setCurrentIndex(int index);
|
void setCurrentIndex(int index);
|
||||||
void setCurrentWidget(QWidget* widget);
|
void setCurrentWidget(QWidget* widget);
|
||||||
|
|
||||||
private:
|
|
||||||
QStackedWidget* m_stack;
|
|
||||||
ComboTabBar* m_tabBar;
|
|
||||||
QVBoxLayout* m_mainLayout;
|
|
||||||
bool m_dirtyTabBar;
|
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void tabWasRemoved(int index);
|
void tabWasRemoved(int index);
|
||||||
void showTab(int index);
|
void showTab(int index);
|
||||||
|
@ -83,9 +79,13 @@ protected:
|
||||||
bool eventFilter(QObject* obj, QEvent* event);
|
bool eventFilter(QObject* obj, QEvent* event);
|
||||||
void keyPressEvent(QKeyEvent* event);
|
void keyPressEvent(QKeyEvent* event);
|
||||||
|
|
||||||
signals:
|
private:
|
||||||
void currentChanged(int index);
|
bool validIndex(int index) const;
|
||||||
void tabCloseRequested(int index);
|
|
||||||
|
QStackedWidget* m_stack;
|
||||||
|
ComboTabBar* m_tabBar;
|
||||||
|
QVBoxLayout* m_mainLayout;
|
||||||
|
bool m_dirtyTabBar;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // TABSTACKEDWIDGET_H
|
#endif // TABSTACKEDWIDGET_H
|
||||||
|
|
Loading…
Reference in New Issue
Block a user