Skip to content

Commit cdca8c2

Browse files
authored
Merge pull request #1 from XenotriX1337/deprecated_function
Replace deprecated function
2 parents 2b7232c + 53ec8b8 commit cdca8c2

23 files changed

+415
-395
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ install(TARGETS qtadvanceddocking
8686
ARCHIVE DESTINATION lib COMPONENT library
8787
)
8888
target_include_directories(qtadvanceddocking PUBLIC
89-
$<BUILD_INTERFACE:${ads_INCLUDE}>
89+
"$<BUILD_INTERFACE:${ads_INCLUDE}>"
9090
$<INSTALL_INTERFACE:include>
9191
)
9292
target_link_libraries(qtadvanceddocking PUBLIC ${ads_LIBS})

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Qt Advanced Docking System lets you create customizable layouts using a full
99
featured window docking system similar to what is found in many popular
1010
integrated development environements (IDEs) such as Visual Studio.
1111
Everything is implemented with standard Qt functionality without any
12-
platform specific code. Basic usage of QWidgets an QLayouts and using basic
12+
platform specific code. Basic usage of QWidgets and QLayouts and using basic
1313
styles as much as possible.
1414

1515
This work is based on and inspired by the

demo/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ set(ads_demo_SRCS
2424
main.cpp
2525
MainWindow.cpp
2626
mainwindow.ui
27-
main.qrc
2827
)
2928
add_executable(AdvancedDockingSystemDemo WIN32 ${ads_demo_SRCS})
3029
if(BUILD_STATIC)

demo/demo.pro

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ HEADERS += \
2121
FORMS += \
2222
mainwindow.ui
2323

24-
RESOURCES += main.qrc
2524

2625
LIBS += -L$${ADS_OUT_ROOT}/lib
2726

demo/main.qrc

Lines changed: 0 additions & 3 deletions
This file was deleted.

example/example.pro

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ HEADERS += \
2323
FORMS += \
2424
MainWindow.ui
2525

26-
#RESOURCES += main.qrc
2726

2827
LIBS += -L$${ADS_OUT_ROOT}/lib
2928

src/DockAreaTabBar.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ class CFloatingDockContainer;
4444
* Custom tabbar implementation for tab area that is shown on top of a
4545
* dock area widget.
4646
* The tabbar displays the tab widgets of the contained dock widgets.
47+
* We cannot use QTabBar here because it does a lot of fancy animations
48+
* that will crash the application if a tab is removed while the animation
49+
* has not finished. And we need to remove a tab, if the user drags a
50+
* a dock widget out of a group of tabbed widgets
4751
*/
4852
class CDockAreaTabBar : public QScrollArea
4953
{
@@ -61,6 +65,7 @@ private slots:
6165

6266
protected:
6367
virtual void wheelEvent(QWheelEvent* Event) override;
68+
6469
/**
6570
* Stores mouse position to detect dragging
6671
*/
@@ -96,6 +101,7 @@ private slots:
96101

97102
public:
98103
using Super = QScrollArea;
104+
99105
/**
100106
* Default Constructor
101107
*/

src/DockAreaTitleBar.cpp

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,9 @@ struct DockAreaTitleBarPrivate
9999
}
100100

101101
/**
102-
* Helper class to set title bar button icons depending on operating system
103-
* and to avoid duplicated code
102+
* Helper function to set title bar button icons depending on operating
103+
* system and to avoid duplicated code. On windows the standard icons
104+
* are blurry since Qt 5.11 so we need to do some additional steps
104105
*/
105106
void setTitleBarButtonIcon(tTileBarButton* Button, QStyle::StandardPixmap StandarPixmap)
106107
{
@@ -136,14 +137,14 @@ void DockAreaTitleBarPrivate::createButtons()
136137
TabsMenuButton->setPopupMode(QToolButton::InstantPopup);
137138
setTitleBarButtonIcon(TabsMenuButton, QStyle::SP_TitleBarUnshadeButton);
138139
QMenu* TabsMenu = new QMenu(TabsMenuButton);
139-
#ifndef QT_NO_TOOLTIP
140+
#ifndef QT_NO_TOOLTIP
140141
TabsMenu->setToolTipsVisible(true);
141-
#endif
142+
#endif
142143
_this->connect(TabsMenu, SIGNAL(aboutToShow()), SLOT(onTabsMenuAboutToShow()));
143144
TabsMenuButton->setMenu(TabsMenu);
144-
#ifndef QT_NO_TOOLTIP
145+
#ifndef QT_NO_TOOLTIP
145146
TabsMenuButton->setToolTip(QObject::tr("List all tabs"));
146-
#endif
147+
#endif
147148
TabsMenuButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding);
148149
TopLayout->addWidget(TabsMenuButton, 0);
149150
_this->connect(TabsMenuButton->menu(), SIGNAL(triggered(QAction*)),
@@ -154,9 +155,9 @@ void DockAreaTitleBarPrivate::createButtons()
154155
UndockButton = new tTileBarButton();
155156
UndockButton->setObjectName("undockButton");
156157
UndockButton->setAutoRaise(true);
157-
#ifndef QT_NO_TOOLTIP
158+
#ifndef QT_NO_TOOLTIP
158159
UndockButton->setToolTip(QObject::tr("Detach Group"));
159-
#endif
160+
#endif
160161
setTitleBarButtonIcon(UndockButton, QStyle::SP_TitleBarNormalButton);
161162
UndockButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding);
162163
TopLayout->addWidget(UndockButton, 0);
@@ -168,7 +169,7 @@ void DockAreaTitleBarPrivate::createButtons()
168169
CloseButton->setObjectName("closeButton");
169170
CloseButton->setAutoRaise(true);
170171
setTitleBarButtonIcon(CloseButton, QStyle::SP_TitleBarCloseButton);
171-
#ifndef QT_NO_TOOLTIP
172+
#ifndef QT_NO_TOOLTIP
172173
if (testConfigFlag(CDockManager::DockAreaCloseButtonClosesTab))
173174
{
174175
CloseButton->setToolTip(QObject::tr("Close Active Tab"));
@@ -177,7 +178,7 @@ void DockAreaTitleBarPrivate::createButtons()
177178
{
178179
CloseButton->setToolTip(QObject::tr("Close Group"));
179180
}
180-
#endif
181+
#endif
181182
CloseButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding);
182183
CloseButton->setIconSize(QSize(16, 16));
183184
TopLayout->addWidget(CloseButton, 0);

src/DockAreaTitleBar.h

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ class CDockAreaWidget;
4343
struct DockAreaTitleBarPrivate;
4444

4545
/**
46-
* Title bar of a dock area
46+
* Title bar of a dock area.
47+
* The title bar contains a tabbar with all tabs for a dock widget group and
48+
* with a tabs menu button, a undock button and a close button.
4749
*/
4850
class CDockAreaTitleBar : public QFrame
4951
{
@@ -61,6 +63,10 @@ private slots:
6163
void showContextMenu(const QPoint& pos);
6264

6365
public slots:
66+
/**
67+
* Call this slot to tell the title bar that it should update the tabs menu
68+
* the next time it is shown.
69+
*/
6470
void markTabsMenuOutdated();
6571

6672

@@ -87,7 +93,8 @@ public slots:
8793
QAbstractButton* button(TitleBarButton which) const;
8894

8995
/**
90-
* This function is here for debug reasons
96+
* Marks the tabs menu outdated before it calls its base class
97+
* implementation
9198
*/
9299
virtual void setVisible(bool Visible) override;
93100

src/DockAreaWidget.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,11 @@ static const char* const INDEX_PROPERTY = "index";
6363
static const char* const ACTION_PROPERTY = "action";
6464

6565
/**
66-
* New dock area layout mimics stack layout but only inserts the current
67-
* widget into the internal QLayout object
66+
* Internal dock area layout mimics stack layout but only inserts the current
67+
* widget into the internal QLayout object.
68+
* \warning Only the current widget has a parent. All other widgets
69+
* do not have a parent. That means, a widget that is in this layout may
70+
* return nullptr for its parent() function if it is not the current widget.
6871
*/
6972
class CDockAreaLayout
7073
{
@@ -118,7 +121,7 @@ class CDockAreaLayout
118121
}
119122

120123
/**
121-
* Removes the given widget from the lyout
124+
* Removes the given widget from the layout
122125
*/
123126
void removeWidget(QWidget* Widget)
124127
{

0 commit comments

Comments
 (0)