Skip to content

Commit

Permalink
correct panels (with Qt6 on Linux)
Browse files Browse the repository at this point in the history
  • Loading branch information
LiangliangNan committed Dec 19, 2024
1 parent 0a445b4 commit a8e95a7
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 59 deletions.
26 changes: 13 additions & 13 deletions code/PolyFit/main_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,13 +222,8 @@ void MainWindow::createRenderingPanel() {
default_complexity_ = truncate_digits(Method::lambda_model_complexity, 3);

panelClick_ = new WeightPanelClick(this);
panelManual_ = new WeightPanelManual(this);

verticalLayoutWeights->addWidget(panelClick_);
verticalLayoutWeights->addWidget(panelManual_);
panelManual_->setVisible(false);

connect(panelClick_, SIGNAL(weights_changed()), panelManual_, SLOT(updateUI()));
verticalLayoutWeights->addWidget(panelClick_);
panelManual_ = nullptr;

connect(pushButtonDefaultWeight, SIGNAL(pressed()), this, SLOT(resetWeights()));
connect(checkBoxManualInputWeights, SIGNAL(toggled(bool)), this, SLOT(setManualInputWeights(bool)));
Expand Down Expand Up @@ -272,13 +267,19 @@ void MainWindow::resetWeights() {


void MainWindow::setManualInputWeights(bool b) {
if (!panelManual_) {
panelManual_ = new WeightPanelManual(this);
verticalLayoutWeights->addWidget(panelManual_);
connect(panelClick_, SIGNAL(weights_changed()), panelManual_, SLOT(updateUI()));
}

if (b) {
panelClick_->setVisible(false);
panelManual_->setVisible(true);
panelClick_->hide();
panelManual_->show();
}
else {
panelClick_->setVisible(true);
panelManual_->setVisible(false);
panelClick_->show();
panelManual_->hide();
}
}

Expand Down Expand Up @@ -411,8 +412,7 @@ void MainWindow::about()

"<p>Extract planes? You can use my <a href=\"https://3d.bk.tudelft.nl/liangliang/software.html\">Mapple</a> program for plane extraction. Please refer to the ReadMe files for more details.</p>"

"<p>For comments, suggestions, or any issues, please contact me at<br>"
"<a href=\"mailto:[email protected]\">[email protected]</a>.</p>"
"<p>For comments, suggestions, or any issues, please contact me at <a href=\"mailto:[email protected]\">[email protected]</a>.</p>"
"<p>Liangliang Nan<br>"
"<a href=\"https://3d.bk.tudelft.nl/liangliang/\">https://3d.bk.tudelft.nl/liangliang/</a><br>"
"@July.18, 2017</p>"
Expand Down
88 changes: 42 additions & 46 deletions code/PolyFit/main_window.ui
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<bool>true</bool>
</property>
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
<enum>Qt::FocusPolicy::StrongFocus</enum>
</property>
<property name="windowTitle">
<string>PolyFit</string>
Expand Down Expand Up @@ -55,12 +55,12 @@
<widget class="QScrollArea" name="scrollArea">
<property name="maximumSize">
<size>
<width>300</width>
<width>310</width>
<height>16777215</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
<enum>QFrame::Shape::NoFrame</enum>
</property>
<property name="widgetResizable">
<bool>true</bool>
Expand All @@ -70,8 +70,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>300</width>
<height>645</height>
<width>314</width>
<height>622</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
Expand Down Expand Up @@ -105,7 +105,7 @@
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>Check 'Manual' to specify the weights manually.</string>
<string>Check 'Manual' to specify weights manually.</string>
</property>
</widget>
</item>
Expand All @@ -114,12 +114,12 @@
<item>
<spacer name="horizontalSpacer_6">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>10</width>
<height>20</height>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
Expand All @@ -134,20 +134,20 @@
<item>
<spacer name="horizontalSpacer_7">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QCheckBox" name="checkBoxManualInputWeights">
<property name="layoutDirection">
<enum>Qt::RightToLeft</enum>
<enum>Qt::LayoutDirection::RightToLeft</enum>
</property>
<property name="text">
<string>Manual</string>
Expand All @@ -157,31 +157,27 @@
<item>
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>10</width>
<height>20</height>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="verticalLayoutWeights">
<item>
<layout class="QVBoxLayout" name="verticalLayout_3"/>
</item>
</layout>
<layout class="QHBoxLayout" name="verticalLayoutWeights"/>
</item>
</layout>
</item>
<item>
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<enum>Qt::Orientation::Horizontal</enum>
</property>
</widget>
</item>
Expand All @@ -194,10 +190,10 @@
<item row="0" column="0">
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
<enum>QSizePolicy::Policy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
Expand Down Expand Up @@ -251,26 +247,26 @@
<item row="0" column="3">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
<enum>QSizePolicy::Policy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>81</width>
<height>20</height>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="0">
<spacer name="horizontalSpacer_8">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
<enum>QSizePolicy::Policy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
Expand Down Expand Up @@ -324,26 +320,26 @@
<item row="1" column="3">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
<enum>QSizePolicy::Policy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>81</width>
<height>20</height>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="0">
<spacer name="horizontalSpacer_9">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
<enum>QSizePolicy::Policy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
Expand Down Expand Up @@ -397,15 +393,15 @@
<item row="2" column="3">
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
<enum>QSizePolicy::Policy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>81</width>
<height>20</height>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
Expand All @@ -416,7 +412,7 @@
<item>
<widget class="Line" name="line_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<enum>Qt::Orientation::Horizontal</enum>
</property>
</widget>
</item>
Expand All @@ -426,10 +422,10 @@
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
<enum>Qt::Orientation::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Preferred</enum>
<enum>QSizePolicy::Policy::Preferred</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
Expand All @@ -442,7 +438,7 @@
<item>
<widget class="QPlainTextEdit" name="plainTextEditOutput">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
Expand Down Expand Up @@ -478,7 +474,7 @@
</size>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextUnderIcon</enum>
<enum>Qt::ToolButtonStyle::ToolButtonTextUnderIcon</enum>
</property>
<attribute name="toolBarArea">
<enum>TopToolBarArea</enum>
Expand All @@ -494,7 +490,7 @@
<string>toolBar</string>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextUnderIcon</enum>
<enum>Qt::ToolButtonStyle::ToolButtonTextUnderIcon</enum>
</property>
<attribute name="toolBarArea">
<enum>TopToolBarArea</enum>
Expand Down

0 comments on commit a8e95a7

Please sign in to comment.