|
本帖最后由 Qter 于 2020-3-6 11:16 编辑
- std::forward<Parent>(parent),
- std::move
- std::make_unique<ContactsBoxController>()
- Ui::show(Box<PeerListBox>(std::make_unique<ContactsBoxController>(), [](not_null<PeerListBox*> box) {
- box->addButton(langFactory(lng_close), [box] { box->closeBox(); });
- box->addLeftButton(langFactory(lng_profile_add_contact), [] { App::wnd()->onShowAddContact(); });
- }));
- template <typename BoxType, typename ...Args>
- inline object_ptr<BoxType> Box(Args&&... args) {
- auto parent = static_cast<QWidget*>(nullptr);
- return object_ptr<BoxType>(parent, std::forward<Args>(args)...);
- }
- Fn<QString()> textFactory,
- std::move(textFactory),
- using Fn = std::function<Signature>;
- PeerListBox::PeerListBox( QWidget*, std::unique_ptr<PeerListController> controller, Fn<void(not_null<PeerListBox*>)> init): _controller(std::move(controller)), _init(std::move(init)) { Expects(_controller != nullptr);}
- Fn<void(PeerListBox*)> _init;
复制代码 |
|