私はWt C++フレームワークを使用しており、クラス機能を持つプッシュボタンを接続する必要があります。以下のコードはうまく動作しますが、スレッドの関数doors_open_allを実行して、同時に他のアクションを使用できるようにする必要があります。std :: threadでboost :: bindを使う方法(Wt C++で)
Wt::WPushButton *open_doors_button = new Wt::WPushButton("open all");
container_box->addWidget(open_doors_button);
open_doors_button->clicked().connect(boost::bind(&Servicemode::doors_open_all, this));
線に沿って何かが必要とされている:
open_doors_button->clicked().connect(boost::threaded_bind(&Servicemode::doors_open_all, this));
'Servicemode :: doors_open_all()'関数内で新しいスレッドを起動することはできませんか? – Galik
どうやら、このような方法で非静的メンバー関数を使用することはできません。 – Levi
'Servicemode :: doors_open_all()'の中にスレッドを起動して、必要に応じてラムダ関数を与えることができます。しかし、実際には、スレッド内で非静的メンバー関数を実行することもできます。 – Galik