diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2012-11-11 15:56:56 +0100 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2012-12-10 02:48:06 +0100 |
commit | 18bab8c6387257be9d4e3b0cff91e5a9f4605f4a (patch) | |
tree | aae50c1924104c3bd316ced29a5942ff251a1407 | |
parent | WARNING: BIG COMMIT (diff) | |
download | rekonq-18bab8c6387257be9d4e3b0cff91e5a9f4605f4a.tar.xz |
Do not lock UI when add/insert tabs
See qt:qtabwidget#insertTab about.
-rw-r--r-- | src/tabwindow/rekonqwindow.cpp | 46 | ||||
-rw-r--r-- | src/tabwindow/rekonqwindow.h | 8 |
2 files changed, 54 insertions, 0 deletions
diff --git a/src/tabwindow/rekonqwindow.cpp b/src/tabwindow/rekonqwindow.cpp index 05608954..a401c343 100644 --- a/src/tabwindow/rekonqwindow.cpp +++ b/src/tabwindow/rekonqwindow.cpp @@ -354,3 +354,49 @@ bool RekonqWindow::restore(int number, bool show) } return false; } + + +// NOTE: For internal purpose only ------------------------------------------------------ + + +int RekonqWindow::addTab(QWidget *page, const QString &label) +{ + setUpdatesEnabled(false); + int i = KTabWidget::addTab(page, label); + setUpdatesEnabled(true); + + return i; +} + + +int RekonqWindow::addTab(QWidget *page, const QIcon &icon, const QString &label) +{ + setUpdatesEnabled(false); + int i = KTabWidget::addTab(page, icon, label); + setUpdatesEnabled(true); + + return i; +} + + +int RekonqWindow::insertTab(int index, QWidget *page, const QString &label) +{ + setUpdatesEnabled(false); + int i = KTabWidget::insertTab(index, page, label); + setUpdatesEnabled(true); + + return i; +} + + +int RekonqWindow::insertTab(int index, QWidget *page, const QIcon &icon, const QString &label) +{ + setUpdatesEnabled(false); + int i = KTabWidget::insertTab(index, page, icon, label); + setUpdatesEnabled(true); + + return i; +} + + +// -------------------------------------------------------------------------------------- diff --git a/src/tabwindow/rekonqwindow.h b/src/tabwindow/rekonqwindow.h index 67f0fcfa..6195f6ac 100644 --- a/src/tabwindow/rekonqwindow.h +++ b/src/tabwindow/rekonqwindow.h @@ -82,6 +82,14 @@ public: **/ bool restore(int number, bool show = true); + // NOTE: For internal purpose only ------------------------------------------------------ + int addTab(QWidget *page, const QString &label); + int addTab(QWidget *page, const QIcon &icon, const QString &label); + + int insertTab(int index, QWidget *page, const QString &label); + int insertTab(int index, QWidget *page, const QIcon &icon, const QString &label); + // -------------------------------------------------------------------------------------- + protected: /** * Save your instance-specific properties. The function is |