Skip to content

Commit c8d4487

Browse files
Improved source code documentation, removed empty main.qrc to silence qmake warning
1 parent a2b07fd commit c8d4487

17 files changed

+410
-388
lines changed

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.

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
{

src/DockAreaWidget.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,12 +185,12 @@ protected slots:
185185
QList<CDockWidget*> dockWidgets() const;
186186

187187
/**
188-
* Returns the number of dock widgets in this area
188+
* Returns the number of open dock widgets in this area
189189
*/
190190
int openDockWidgetsCount() const;
191191

192192
/**
193-
* Returns a list of dock widgets that are not closed
193+
* Returns a list of dock widgets that are not closed.
194194
*/
195195
QList<CDockWidget*> openedDockWidgets() const;
196196

@@ -236,8 +236,10 @@ protected slots:
236236
* This functions returns the dock widget features of all dock widget in
237237
* this area.
238238
* A bitwise and is used to combine the flags of all dock widgets. That
239-
* means, if only dock widget does not support a certain flag, the whole
240-
* dock are does not support the flag.
239+
* means, if only one single dock widget does not support a certain flag,
240+
* the whole dock are does not support the flag. I.e. if one single
241+
* dock widget in this area is not closabe, the whole dock are is not
242+
* closable.
241243
*/
242244
CDockWidget::DockWidgetFeatures features() const;
243245

src/DockContainerWidget.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,10 @@ struct FloatingDockContainerPrivate;
5050

5151
/**
5252
* Container that manages a number of dock areas with single dock widgets
53-
* or tabyfied dock widgets in each area
53+
* or tabyfied dock widgets in each area.
54+
* Each window that support docking has a DockContainerWidget. That means
55+
* the main application window and all floating windows are ore contain
56+
* an DockContainerWidget.
5457
*/
5558
class ADS_EXPORT CDockContainerWidget : public QFrame
5659
{

src/DockManager.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ class ADS_EXPORT CDockManager : public CDockContainerWidget
131131
* If the given parent is a QMainWindow, the dock manager sets itself as the
132132
* central widget.
133133
* Before you create any dock widgets, you should properly setup the
134-
* configuration flags via setConfigFlags()
134+
* configuration flags via setConfigFlags().
135135
*/
136136
CDockManager(QWidget* parent = 0);
137137

src/DockOverlay.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -245,9 +245,6 @@ class CDockOverlayCross : public QWidget
245245
protected:
246246
virtual void showEvent(QShowEvent* e) override;
247247
void setAreaWidgets(const QHash<DockWidgetArea, QWidget*>& widgets);
248-
249-
private:
250-
251248
}; // CDockOverlayCross
252249

253250
} // namespace ads

0 commit comments

Comments
 (0)