Merge branch '1.6'

This commit is contained in:
Sergio Martins
2022-05-05 10:46:14 +01:00
4 changed files with 19 additions and 4 deletions

View File

@@ -12,6 +12,7 @@
- Fixed MainWindow not propagating close events to docked widgets
- X11: Improved detecting which window is under the cursor, by using native X11 API
- X11: Fixed dragging a maximized floating window. Its size is now restored to normal size when the drag starts.
- Added DockWidgetBase::currentTabIndex()
* v1.5.0 (24 November 2021)
- Install the Python bindings to "site-packages"

View File

@@ -328,6 +328,14 @@ int DockWidgetBase::tabIndex() const
return 0;
}
int DockWidgetBase::currentTabIndex() const
{
if (Frame *frame = d->frame())
return frame->currentTabIndex();
return 0;
}
void DockWidgetBase::setIcon(const QIcon &icon, IconPlaces places)
{
if (places & IconPlace::TitleBar)

View File

@@ -266,12 +266,18 @@ public:
*/
Q_INVOKABLE void setAsCurrentTab();
/**
* @brief Returns which tab index this dock widget occupies in the tab widget it's contained in
* @brief Returns the tab index this dock widget occupies
* Note that dock widgets are almost always tabbed, even if you don't see the tab bar.
* A single floating dock widget is still tabbed on a tab widget with a single tab.
*/
int tabIndex() const;
/**
* @brief Returns the index of the current tab of the tab group this dock widget is in.
*/
int currentTabIndex() const;
/**
* @brief Sets an icon to show on title bars and tab bars.
* @param places Specifies where the icon will be shown (TitleBar, TabBar, ToggleAction, or All)

View File

@@ -14,8 +14,8 @@
#include "kddockwidgets/docks_export.h"
#include "KDDockWidgets.h"
#include "QWidgetAdapter.h"
#include "kddockwidgets/KDDockWidgets.h"
#include "kddockwidgets/QWidgetAdapter.h"
namespace KDDockWidgets {