the-libs/lib/tpopover.h

59 lines
1.6 KiB
C
Raw Normal View History

2019-01-07 23:21:06 -05:00
/****************************************
*
* INSERT-PROJECT-NAME-HERE - INSERT-GENERIC-NAME-HERE
* Copyright (C) 2019 Victor Tran
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* *************************************/
#ifndef TPOPOVER_H
#define TPOPOVER_H
#include <QObject>
2019-01-15 23:00:10 -05:00
#include <the-libs_global.h>
2019-01-07 23:21:06 -05:00
struct tPopoverPrivate;
2019-01-15 23:00:10 -05:00
class THELIBSSHARED_EXPORT tPopover : public QObject
2019-01-07 23:21:06 -05:00
{
Q_OBJECT
public:
explicit tPopover(QWidget* popoverWidget, QObject *parent = nullptr);
~tPopover();
2019-01-29 03:43:56 -05:00
enum PopoverSide {
Leading,
Trailing
};
2019-01-07 23:21:06 -05:00
void setPopoverWidth(int width);
2019-01-29 03:43:56 -05:00
void setPopoverSide(PopoverSide side);
static tPopover* popoverForWidget(QWidget* popoverWidget);
2019-01-07 23:21:06 -05:00
signals:
void dismissed();
public slots:
void show(QWidget* parent);
void dismiss();
private:
tPopoverPrivate* d;
bool eventFilter(QObject* watched, QEvent* event);
2019-01-29 03:43:56 -05:00
bool isOpeningOnRight();
2019-01-07 23:21:06 -05:00
};
#endif // TPOPOVER_H