|
1 # -*- coding: utf-8 -*- |
|
2 |
|
3 # Copyright (c) 2017 Detlev Offenbach <detlev@die-offenbachs.de> |
|
4 # |
|
5 |
|
6 """ |
|
7 Module implementing the navigation container widget. |
|
8 """ |
|
9 |
|
10 from __future__ import unicode_literals |
|
11 |
|
12 from PyQt5.QtWidgets import QWidget, QVBoxLayout, QSizePolicy |
|
13 |
|
14 |
|
15 class NavigationContainer(QWidget): |
|
16 """ |
|
17 Class implementing the navigation container widget. |
|
18 """ |
|
19 def __init__(self, parent=None): |
|
20 """ |
|
21 Constructor |
|
22 |
|
23 @param parent reference to the parent widget |
|
24 @type QWidget |
|
25 """ |
|
26 super(NavigationContainer, self).__init__(parent) |
|
27 self.setObjectName("navigationcontainer") |
|
28 |
|
29 self.__layout = QVBoxLayout(self) |
|
30 self.__layout.setContentsMargins(0, 0, 0, 0) |
|
31 self.__layout.setSpacing(0) |
|
32 |
|
33 self.setLayout(self.__layout) |
|
34 self.setSizePolicy(QSizePolicy.Preferred, QSizePolicy.Maximum) |
|
35 |
|
36 def addWidget(self, widget): |
|
37 """ |
|
38 Public method to add a widget to the container. |
|
39 |
|
40 @param widget reference to the widget to be added |
|
41 @type QWidget |
|
42 """ |
|
43 self.__layout.addWidget(widget) |