LeechCraft 0.6.70-17609-g3dde4097dd
Modular cross-platform feature rich live environment.
Loading...
Searching...
No Matches
pagenotification.cpp
Go to the documentation of this file.
1/**********************************************************************
2 * LeechCraft - modular cross-platform feature rich internet client.
3 * Copyright (C) 2006-2014 Georg Rudoy
4 *
5 * Distributed under the Boost Software License, Version 1.0.
6 * (See accompanying file LICENSE or copy at https://www.boost.org/LICENSE_1_0.txt)
7 **********************************************************************/
8
9#include "pagenotification.h"
10#include <stdexcept>
11#include <QVBoxLayout>
12
13namespace LC::Util
14{
16 : QWidget (widget)
17 {
18 auto lay = qobject_cast<QVBoxLayout*> (widget->parentWidget ()->layout ());
19 if (!lay)
20 throw std::runtime_error ("Passed parent object has no QVBoxLayout");
21
22 const auto idx = lay->indexOf (widget);
23 lay->insertWidget (idx + 1, this);
24 }
25}
PageNotification(QWidget *parent)
Creates the widget embedding into the parent layout of the parent widget.