2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2009-12-07 15:14:08 +01:00
|
|
|
**
|
2016-01-15 14:58:39 +01:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2009-12-07 15:14:08 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2009-12-07 15:14:08 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
2016-01-15 14:58:39 +01:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
2009-12-07 15:14:08 +01:00
|
|
|
**
|
2016-01-15 14:58:39 +01:00
|
|
|
** GNU General Public License Usage
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
2010-12-17 16:01:08 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2009-12-07 15:14:08 +01:00
|
|
|
|
2016-03-18 07:55:01 +01:00
|
|
|
#pragma once
|
2009-10-01 14:39:31 +02:00
|
|
|
|
|
|
|
|
#include "utils_global.h"
|
|
|
|
|
|
2012-02-15 10:42:41 +01:00
|
|
|
#include <QWidget>
|
2009-10-02 10:12:32 +02:00
|
|
|
|
2009-10-01 14:39:31 +02:00
|
|
|
namespace Utils {
|
2010-02-02 09:59:55 +01:00
|
|
|
|
2011-05-18 16:48:36 +02:00
|
|
|
class DetailsWidgetPrivate;
|
2010-05-07 12:26:01 +02:00
|
|
|
class FadingPanel;
|
2009-10-01 14:39:31 +02:00
|
|
|
|
|
|
|
|
class QTCREATOR_UTILS_EXPORT DetailsWidget : public QWidget
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
2009-10-02 10:12:32 +02:00
|
|
|
Q_PROPERTY(QString summaryText READ summaryText WRITE setSummaryText DESIGNABLE true)
|
2011-03-14 14:33:48 +01:00
|
|
|
Q_PROPERTY(QString additionalSummaryText READ additionalSummaryText WRITE setAdditionalSummaryText DESIGNABLE true)
|
2011-02-21 11:55:26 +01:00
|
|
|
Q_PROPERTY(bool useCheckBox READ useCheckBox WRITE setUseCheckBox DESIGNABLE true)
|
|
|
|
|
Q_PROPERTY(bool checked READ isChecked WRITE setChecked DESIGNABLE true)
|
2010-02-01 17:22:05 +01:00
|
|
|
Q_PROPERTY(State state READ state WRITE setState)
|
2010-02-02 09:59:55 +01:00
|
|
|
Q_ENUMS(State)
|
2009-11-30 15:16:05 +01:00
|
|
|
|
2009-10-01 14:39:31 +02:00
|
|
|
public:
|
2010-02-01 17:22:05 +01:00
|
|
|
enum State {
|
|
|
|
|
Expanded,
|
|
|
|
|
Collapsed,
|
2011-12-08 14:29:24 +01:00
|
|
|
NoSummary,
|
|
|
|
|
OnlySummary
|
2010-02-01 17:22:05 +01:00
|
|
|
};
|
|
|
|
|
|
2010-02-02 09:59:55 +01:00
|
|
|
explicit DetailsWidget(QWidget *parent = 0);
|
|
|
|
|
virtual ~DetailsWidget();
|
2009-10-01 14:39:31 +02:00
|
|
|
|
|
|
|
|
void setSummaryText(const QString &text);
|
2009-10-02 10:12:32 +02:00
|
|
|
QString summaryText() const;
|
|
|
|
|
|
2011-03-14 14:33:48 +01:00
|
|
|
void setAdditionalSummaryText(const QString &text);
|
|
|
|
|
QString additionalSummaryText() const;
|
|
|
|
|
|
2010-02-01 17:22:05 +01:00
|
|
|
void setState(State state);
|
|
|
|
|
State state() const;
|
2009-10-02 10:12:32 +02:00
|
|
|
|
2009-10-01 14:39:31 +02:00
|
|
|
void setWidget(QWidget *widget);
|
2009-10-02 10:12:32 +02:00
|
|
|
QWidget *widget() const;
|
2012-08-16 15:59:10 +02:00
|
|
|
QWidget *takeWidget();
|
2009-10-02 10:12:32 +02:00
|
|
|
|
2014-07-15 23:33:17 +03:00
|
|
|
void setToolWidget(FadingPanel *widget);
|
2009-10-02 10:12:32 +02:00
|
|
|
QWidget *toolWidget() const;
|
|
|
|
|
|
2011-02-21 11:55:26 +01:00
|
|
|
void setSummaryFontBold(bool b);
|
|
|
|
|
|
|
|
|
|
bool isChecked() const;
|
|
|
|
|
void setChecked(bool b);
|
|
|
|
|
|
|
|
|
|
bool useCheckBox();
|
|
|
|
|
void setUseCheckBox(bool b);
|
|
|
|
|
void setIcon(const QIcon &icon);
|
2011-03-14 14:33:48 +01:00
|
|
|
|
2012-11-15 17:14:40 +01:00
|
|
|
static QPixmap createBackground(const QSize &size, int topHeight, QWidget *widget);
|
|
|
|
|
|
2011-02-21 11:55:26 +01:00
|
|
|
signals:
|
|
|
|
|
void checked(bool);
|
2011-03-28 17:57:17 +02:00
|
|
|
void linkActivated(const QString &link);
|
2011-09-21 15:17:24 +02:00
|
|
|
void expanded(bool);
|
2011-05-18 16:48:36 +02:00
|
|
|
|
2010-02-01 17:22:05 +01:00
|
|
|
private slots:
|
2009-11-30 15:16:05 +01:00
|
|
|
void setExpanded(bool);
|
|
|
|
|
|
2009-10-02 10:12:32 +02:00
|
|
|
protected:
|
2010-02-02 09:59:55 +01:00
|
|
|
virtual void paintEvent(QPaintEvent *paintEvent);
|
|
|
|
|
virtual void enterEvent(QEvent *event);
|
|
|
|
|
virtual void leaveEvent(QEvent *event);
|
2009-10-02 10:12:32 +02:00
|
|
|
|
2009-10-01 14:39:31 +02:00
|
|
|
private:
|
2010-02-02 09:59:55 +01:00
|
|
|
DetailsWidgetPrivate *d;
|
2009-10-01 14:39:31 +02:00
|
|
|
};
|
2010-02-02 09:59:55 +01:00
|
|
|
|
|
|
|
|
} // namespace Utils
|