'WindowList'クラスでウィンドウを管理しようとすると循環依存性に問題があります。下のcloseButtonPressedコードでウィンドウを閉じる場合は、windowListファイルからオブジェクトを削除する必要がありますが、WindowListterをWindowListファイルに含めています。このような以前のエラーは、前方宣言によって解決できましたが、私はこの問題を解決する方法がわかりません。 Annyの提案? (完全なコードはここで見ることができます:https://gist.github.com/anonymous/7d43c6d5b2cf1fef618be9f75077ad0c)不完全な型InNested名前指定子JUCE
#pragma once
#include "../JuceLibraryCode/JuceHeader.h"
#include "WindowList.h"
class WindowList;
class WindowSetter : public DialogWindow
{
public:
WindowSetter (const String& title,
Component* content,
bool shouldBeResizeable,
int initWidth, int initHeight,
int minWidth, int minHeight,
int maxWidth, int maxHeight)
: DialogWindow (title, Colours::white, true, true),
owner (this)
{
setUsingNativeTitleBar (true);
setResizable (true, true);
setResizeLimits (minWidth, minHeight, maxWidth, maxHeight);
setContentOwned (content, false);
setVisible (true);
}
~WindowSetter()
{
}
void closeButtonPressed() override
{
WindowList::getWindowList(); // ERROR: Incomplete type 'WindowList' named in nested name specifier
owner = nullptr;
}
bool escapeKeyPressed() override
{
return true;
}
private:
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (WindowSetter)
ScopedPointer<Component> owner;
};
編集:ファイルの完全なコードエラーの原因とエラーログのスクリーンショット
これはちょうど私が探している解決策の一種です! JUCE/C++のhello worldよりもまだまだ新しいこと – Jefferson
JUCEのサンプルのソースを読んでいる時間が何度も繰り返されます。 – bgporter