mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 06:35:52 +08:00
Fixes some issues with navigator widget to avoid Qt size warnings.
Remarks: Some but not all warnings are gone
This commit is contained in:
committed by
Mathew Sutcliffe
parent
018c5ae1bf
commit
91f0b99cc5
@@ -42,25 +42,20 @@ namespace BlackGui
|
||||
InfoArea area = static_cast<InfoArea>(areaIndex);
|
||||
switch (area)
|
||||
{
|
||||
case InfoAreaHorizontalNavigator:
|
||||
return QSize(400, 50);
|
||||
case InfoAreaVerticalNavigator:
|
||||
return QSize(50, 400);
|
||||
case InfoAreaNavigator:
|
||||
{
|
||||
return this->ui->comp_Navigator->minimumSize();
|
||||
}
|
||||
default:
|
||||
Q_ASSERT_X(false, Q_FUNC_INFO, "Unknown index for invisible info area");
|
||||
return QSize(0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
const QPixmap &CInvisibleInfoAreaComponent::indexToPixmap(int areaIndex) const
|
||||
{
|
||||
InfoArea area = static_cast<InfoArea>(areaIndex);
|
||||
switch (area)
|
||||
{
|
||||
case InfoAreaHorizontalNavigator:
|
||||
case InfoAreaVerticalNavigator:
|
||||
default:
|
||||
return CIcons::empty();
|
||||
}
|
||||
Q_UNUSED(areaIndex);
|
||||
return CIcons::empty();
|
||||
}
|
||||
|
||||
CNavigatorDockWidget *CInvisibleInfoAreaComponent::getNavigatorComponent()
|
||||
|
||||
@@ -33,8 +33,7 @@ namespace BlackGui
|
||||
enum InfoArea
|
||||
{
|
||||
// index must match tab index!
|
||||
InfoAreaVerticalNavigator = 0,
|
||||
InfoAreaHorizontalNavigator = 1
|
||||
InfoAreaNavigator = 0
|
||||
};
|
||||
|
||||
//! Consturctor
|
||||
|
||||
@@ -2,22 +2,26 @@
|
||||
<ui version="4.0">
|
||||
<class>CInvisibleInfoAreaComponent</class>
|
||||
<widget class="QMainWindow" name="CInvisibleInfoAreaComponent">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>600</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Invisible info area</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="qw_InvisibleInfoArea"/>
|
||||
<widget class="QWidget" name="qw_InvisibleInfoArea">
|
||||
<layout class="QVBoxLayout" name="vl_InvisibleInfoAreaComponent">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="BlackGui::Components::CNavigatorDockWidget" name="comp_Navigator">
|
||||
<property name="floating">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="features">
|
||||
<set>QDockWidget::AllDockWidgetFeatures</set>
|
||||
</property>
|
||||
|
||||
@@ -31,6 +31,7 @@ namespace BlackGui
|
||||
this->allowStatusBar(false);
|
||||
ui->setupUi(this);
|
||||
this->ps_onStyleSheetsChanged();
|
||||
this->buildNavigator(1);
|
||||
}
|
||||
|
||||
CNavigatorDockWidget::~CNavigatorDockWidget()
|
||||
@@ -90,10 +91,7 @@ namespace BlackGui
|
||||
// set the real values
|
||||
c = gridLayout->columnCount();
|
||||
r = gridLayout->rowCount();
|
||||
this->setMinimumSizeForWidgets(r, c);
|
||||
|
||||
// sizes
|
||||
QSize ws(gridLayout->sizeHint());
|
||||
QSize ws = this->setMinimumSizeForWidgets(r, c);
|
||||
this->resize(ws);
|
||||
|
||||
// see documentation, required as layout was changed
|
||||
@@ -151,14 +149,15 @@ namespace BlackGui
|
||||
return (c * rows) < items ? c + 1 : c;
|
||||
}
|
||||
|
||||
void CNavigatorDockWidget::setMinimumSizeForWidgets(int rows, int columns)
|
||||
QSize CNavigatorDockWidget::setMinimumSizeForWidgets(int rows, int columns)
|
||||
{
|
||||
int w = 10 * columns;
|
||||
int h = 10 * rows;
|
||||
int w = 20 * columns;
|
||||
int h = 20 * rows;
|
||||
QSize min(w, h);
|
||||
this->ui->qw_NavigatorDockWidgetOuter->setMinimumSize(min);
|
||||
this->ui->fr_NavigatorDockWidgetInner->setMinimumSize(min);
|
||||
this->setMinimumSize(min);
|
||||
return min;
|
||||
}
|
||||
|
||||
} // ns
|
||||
|
||||
@@ -70,7 +70,7 @@ namespace BlackGui
|
||||
int columnsForRows(int rows);
|
||||
|
||||
//! Set widgets to their minimum size
|
||||
void setMinimumSizeForWidgets(int rows, int columns);
|
||||
QSize setMinimumSizeForWidgets(int rows, int columns);
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -2,20 +2,6 @@
|
||||
<ui version="4.0">
|
||||
<class>CNavigatorDockWidget</class>
|
||||
<widget class="QDockWidget" name="CNavigatorDockWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>90</width>
|
||||
<height>383</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="floating">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
|
||||
Reference in New Issue
Block a user