src: Fixed macOS build

This commit is contained in:
Eberhard Graether
2019-10-29 14:42:27 +01:00
parent ed1d4b7d33
commit 48c4bddc1b
3 changed files with 38 additions and 35 deletions
+35
View File
@@ -504,3 +504,38 @@ void QtDialogView::updateErrorCount(size_t errorCount, size_t fatalCount)
reportWindow->updateErrorCount(errorCount, fatalCount);
}
}
template <typename DialogType, typename... ParamTypes>
DialogType* QtDialogView::createWindow(ParamTypes... params)
{
DialogType* window = nullptr;
if (m_parentWindow)
{
window = new DialogType(params..., m_parentWindow);
}
else
{
window = new DialogType(params..., m_mainWindow);
}
connect(window, &QtIndexingDialog::canceled, &m_windowStack, &QtWindowStack::popWindow);
connect(window, &QtIndexingDialog::finished, &m_windowStack, &QtWindowStack::clearWindows);
connect(window, &QtIndexingDialog::visibleChanged, this, &QtDialogView::dialogVisibilityChanged);
if (m_mainWindow)
{
connect(
m_mainWindow, &QtMainWindow::hideIndexingDialog,
std::bind(&QtDialogView::dialogVisibilityChanged, this, true)
);
}
m_windowStack.pushWindow(window);
if (!m_dialogsVisible)
{
window->hide();
}
return window;
}
+1 -33
View File
@@ -66,39 +66,7 @@ private:
void updateErrorCount(size_t errorCount, size_t fatalCount);
template <typename DialogType, typename... ParamTypes>
DialogType* createWindow(ParamTypes... params)
{
DialogType* window = nullptr;
if (m_parentWindow)
{
window = new DialogType(params..., m_parentWindow);
}
else
{
window = new DialogType(params..., m_mainWindow);
}
connect(window, &QtIndexingDialog::canceled, &m_windowStack, &QtWindowStack::popWindow);
connect(window, &QtIndexingDialog::finished, &m_windowStack, &QtWindowStack::clearWindows);
connect(window, &QtIndexingDialog::visibleChanged, this, &QtDialogView::dialogVisibilityChanged);
if (m_mainWindow)
{
connect(
m_mainWindow, &QtMainWindow::hideIndexingDialog,
std::bind(&QtDialogView::dialogVisibilityChanged, this, true)
);
}
m_windowStack.pushWindow(window);
if (!m_dialogsVisible)
{
window->hide();
}
return window;
}
DialogType* createWindow(ParamTypes... params);
QtMainWindow* m_mainWindow;
QtWindow* m_parentWindow;
+2 -2
View File
@@ -23,11 +23,11 @@ protected:
static QLabel* createTitleLabel(QString title, QBoxLayout* layout);
static QLabel* createMessageLabel(QBoxLayout* layout);
static QWidget* createErrorWidget(QBoxLayout* layout);
static QLabel* QtIndexingDialog::createFlagLabel(QWidget* parent);
static QLabel* createFlagLabel(QWidget* parent);
public:
QtIndexingDialog(bool isSubWindow, QWidget* parent = nullptr);
virtual QSize sizeHint() const = 0;
QSize sizeHint() const override = 0;
signals:
void finished();