qTox  Version: nightly | Commit: bc751c8e1cac455f9690654fcfe0f560d2d7dfdd
genericchatitemlayout.h
Go to the documentation of this file.
1 /*
2  Copyright © 2019 by The qTox Project Contributors
3 
4  This file is part of qTox, a Qt-based graphical interface for Tox.
5 
6  qTox is libre software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  qTox is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with qTox. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 #pragma once
21 
22 #include <Qt>
23 
24 class QLayout;
25 class QVBoxLayout;
27 
29 {
30 public:
34 
35 #if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
36  void addSortedWidget(GenericChatItemWidget* widget, int stretch = 0, Qt::Alignment alignment = Qt::Alignment());
37 #else
38  void addSortedWidget(GenericChatItemWidget* widget, int stretch = 0, Qt::Alignment alignment = nullptr);
39 #endif
40  int indexOfSortedWidget(GenericChatItemWidget* widget) const;
41  bool existsSortedWidget(GenericChatItemWidget* widget) const;
43  void search(const QString& searchString, bool hideAll = false);
44 
45  QLayout* getLayout() const;
46 
47 private:
49  QVBoxLayout* layout;
50 };
GenericChatItemLayout::GenericChatItemLayout
GenericChatItemLayout()
Definition: genericchatitemlayout.cpp:31
GenericChatItemLayout::layout
QVBoxLayout * layout
Definition: genericchatitemlayout.h:49
GenericChatItemLayout::search
void search(const QString &searchString, bool hideAll=false)
Definition: genericchatitemlayout.cpp:91
GenericChatItemLayout::removeSortedWidget
void removeSortedWidget(GenericChatItemWidget *widget)
Definition: genericchatitemlayout.cpp:73
GenericChatItemWidget
Definition: genericchatitemwidget.h:27
GenericChatItemLayout::getLayout
QLayout * getLayout() const
Definition: genericchatitemlayout.cpp:102
GenericChatItemLayout
Definition: genericchatitemlayout.h:28
GenericChatItemLayout::~GenericChatItemLayout
~GenericChatItemLayout()
Definition: genericchatitemlayout.cpp:36
GenericChatItemLayout::indexOfClosestSortedWidget
int indexOfClosestSortedWidget(GenericChatItemWidget *widget) const
Definition: genericchatitemlayout.cpp:107
GenericChatItemLayout::existsSortedWidget
bool existsSortedWidget(GenericChatItemWidget *widget) const
Definition: genericchatitemlayout.cpp:68
GenericChatItemLayout::indexOfSortedWidget
int indexOfSortedWidget(GenericChatItemWidget *widget) const
Definition: genericchatitemlayout.cpp:48
GenericChatItemLayout::addSortedWidget
void addSortedWidget(GenericChatItemWidget *widget, int stretch=0, Qt::Alignment alignment=Qt::Alignment())
Definition: genericchatitemlayout.cpp:41