Fix warning about layout in TextViewDialog
This commit is contained in:
parent
6425b3c73f
commit
26056f1511
|
@ -51,10 +51,10 @@ TextViewDialog::TextViewDialog(const QString &title, QWidget *parent)
|
||||||
m_browser->setFont(QFontDatabase::systemFont(QFontDatabase::FixedFont));
|
m_browser->setFont(QFontDatabase::systemFont(QFontDatabase::FixedFont));
|
||||||
|
|
||||||
// setup layout
|
// setup layout
|
||||||
auto *layout = new QVBoxLayout(this);
|
m_layout = new QVBoxLayout(this);
|
||||||
layout->setAlignment(Qt::AlignCenter);
|
m_layout->setAlignment(Qt::AlignCenter);
|
||||||
layout->addWidget(m_browser);
|
m_layout->addWidget(m_browser);
|
||||||
setLayout(layout);
|
setLayout(m_layout);
|
||||||
|
|
||||||
// default position and size
|
// default position and size
|
||||||
resize(600, 500);
|
resize(600, 500);
|
||||||
|
@ -82,7 +82,7 @@ TextViewDialog *TextViewDialog::forDirectoryErrors(const Data::SyncthingDir &dir
|
||||||
}
|
}
|
||||||
|
|
||||||
// add layout to show status and additional buttons
|
// add layout to show status and additional buttons
|
||||||
auto *const buttonLayout = new QHBoxLayout(textViewDlg);
|
auto *const buttonLayout = new QHBoxLayout;
|
||||||
buttonLayout->setMargin(0);
|
buttonLayout->setMargin(0);
|
||||||
|
|
||||||
// add label for overall status
|
// add label for overall status
|
||||||
|
@ -124,7 +124,7 @@ TextViewDialog *TextViewDialog::forDirectoryErrors(const Data::SyncthingDir &dir
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
textViewDlg->layout()->addItem(buttonLayout);
|
textViewDlg->m_layout->addLayout(buttonLayout);
|
||||||
return textViewDlg;
|
return textViewDlg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
|
||||||
QT_FORWARD_DECLARE_CLASS(QTextBrowser)
|
QT_FORWARD_DECLARE_CLASS(QTextBrowser)
|
||||||
|
QT_FORWARD_DECLARE_CLASS(QVBoxLayout)
|
||||||
|
|
||||||
namespace Data {
|
namespace Data {
|
||||||
class SyncthingConnection;
|
class SyncthingConnection;
|
||||||
|
@ -35,6 +36,7 @@ private:
|
||||||
void showLogEntries(const std::vector<Data::SyncthingLogEntry> &logEntries);
|
void showLogEntries(const std::vector<Data::SyncthingLogEntry> &logEntries);
|
||||||
|
|
||||||
QTextBrowser *m_browser;
|
QTextBrowser *m_browser;
|
||||||
|
QVBoxLayout *m_layout;
|
||||||
};
|
};
|
||||||
|
|
||||||
inline QTextBrowser *TextViewDialog::browser()
|
inline QTextBrowser *TextViewDialog::browser()
|
||||||
|
|
Loading…
Reference in New Issue