30 #include <QApplication>
32 #include <QGridLayout>
35 #include <QScrollArea>
59 const bool FlatProjectsMode(
false);
94 , m_grid(new QGridLayout)
95 , m_summaryLabelIcon(new QLabel(parent))
96 , m_summaryLabel(new QLabel(parent))
97 , m_summaryCheckBox(new QCheckBox(parent))
98 , m_additionalSummaryLabel(new QLabel(parent))
99 , m_toolWidget(nullptr)
103 , m_useCheckBox(false)
105 QHBoxLayout* summaryLayout =
new QHBoxLayout;
107 summaryLayout->setSpacing(0);
114 m_summaryLabel->setTextInteractionFlags(Qt::TextSelectableByMouse | Qt::LinksAccessibleByMouse);
115 m_summaryLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum);
121 Qt::WA_LayoutUsesWidgetRect);
132 m_grid->setContentsMargins(0, 0, 0, 0);
134 m_grid->addLayout(summaryLayout, 0, 0);
141 QPixmap pixmap(size);
142 pixmap.fill(Qt::transparent);
145 QRect topRect(0, 0, size.width(), topHeight);
146 QRect fullRect(0, 0, size.width(), size.height());
148 p.fillRect(fullRect, QApplication::palette().window().color());
150 p.fillRect(fullRect, QApplication::palette().window().color());
152 if (!FlatProjectsMode) {
153 QLinearGradient lg(topRect.topLeft(), topRect.bottomLeft());
156 lg.setCoordinateMode(QGradient::ObjectBoundingMode);
157 lg.setFinalStop(0, 1);
162 lg.setColorAt(0, QColor(255, 255, 255, 0));
163 lg.setColorAt(1, QColor(255, 255, 255, 50));
166 p.fillRect(topRect, lg);
167 p.setRenderHint(QPainter::Antialiasing,
true);
168 p.translate(0.5, 0.5);
169 p.setPen(QColor(0, 0, 0, 40));
170 p.setBrush(Qt::NoBrush);
171 p.drawRoundedRect(fullRect.adjusted(0, 0, -1, -1), 2, 2);
172 p.setBrush(Qt::NoBrush);
173 p.setPen(QColor(255, 255, 255, 140));
174 p.drawRoundedRect(fullRect.adjusted(1, 1, -2, -2), 2, 2);
175 p.setPen(QPen(
widget->palette().color(QPalette::Mid)));
193 for (QWidget* w =
q; w; w = w->parentWidget()) {
195 w->layout()->activate();
196 if (QScrollArea* area = qobject_cast<QScrollArea*>(w)) {
197 QEvent e(QEvent::LayoutRequest);
198 QCoreApplication::sendEvent(area, &e);
262 int iconSize = style()->pixelMetric(QStyle::PM_ButtonIconSize, 0,
this);
276 QPoint topLeft(topLeftWidget->geometry().left() -
MARGIN, contentsRect().top());
277 const QRect paintArea(topLeft, contentsRect().bottomRight());
297 QWidget::enterEvent(event);
303 QWidget::leaveEvent(event);
virtual void setOpacity(qreal value)=0
virtual void fadeTo(qreal value)=0