GUI: Add close-button to log view.
This commit is contained in:
parent
7e88d7b41d
commit
7f3825d922
|
@ -22,9 +22,16 @@ LogView::LogView(QWidget *parent)
|
||||||
{
|
{
|
||||||
mUI.setupUi(this);
|
mUI.setupUi(this);
|
||||||
setWindowFlags(Qt::Tool);
|
setWindowFlags(Qt::Tool);
|
||||||
|
|
||||||
|
connect(mUI.mCloseButton, SIGNAL(clicked()), this, SLOT(CloseButtonClicked()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void LogView::AppendLine(const QString &line)
|
void LogView::AppendLine(const QString &line)
|
||||||
{
|
{
|
||||||
mUI.mLogEdit->appendPlainText(line);
|
mUI.mLogEdit->appendPlainText(line);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LogView::CloseButtonClicked()
|
||||||
|
{
|
||||||
|
close();
|
||||||
|
}
|
||||||
|
|
|
@ -42,6 +42,14 @@ public:
|
||||||
*/
|
*/
|
||||||
void AppendLine(const QString &line);
|
void AppendLine(const QString &line);
|
||||||
|
|
||||||
|
protected slots:
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Called when close button is clicked.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
void CloseButtonClicked();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::LogView mUI;
|
Ui::LogView mUI;
|
||||||
};
|
};
|
||||||
|
|
|
@ -27,6 +27,30 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="mCloseButton">
|
||||||
|
<property name="text">
|
||||||
|
<string>Close</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<resources/>
|
<resources/>
|
||||||
|
|
Loading…
Reference in New Issue