HAL
welcome_screen.cpp
Go to the documentation of this file.
2 
8 
9 #include <QHBoxLayout>
10 #include <QStyle>
11 
12 namespace hal
13 {
15  : QFrame(parent), mLayout(new QHBoxLayout()), mRecentFilesFrame(new LabeledFrame()), mOpenFileFrame(new LabeledFrame()), mGetInTouchFrame(new LabeledFrame()),
16  mRecentFilesWidget(new RecentFilesWidget()), mOpenFileWidget(new OpenFileWidget()), mGetInTouchWidget(new GetInTouchWidget())
17  {
18  mLayout->setContentsMargins(0, 0, 0, 0);
19  mLayout->setSpacing(0);
20  mLayout->setAlignment(Qt::AlignCenter);
21 
22  mRecentFilesFrame->setObjectName("recent-files-frame");
23  mOpenFileFrame->setObjectName("open-file-frame");
24  mGetInTouchFrame->setObjectName("get-in-touch-frame");
25 
26  mRecentFilesFrame->addContent(mRecentFilesWidget);
27  mOpenFileFrame->addContent(mOpenFileWidget);
28  mGetInTouchFrame->addContent(mGetInTouchWidget);
29 
30  mRecentFilesFrame->setGraphicsEffect(new ShadowEffect());
31  mOpenFileFrame->setGraphicsEffect(new ShadowEffect());
32  mGetInTouchFrame->setGraphicsEffect(new ShadowEffect());
33 
34  setLayout(mLayout);
35  mLayout->addWidget(mRecentFilesFrame);
36  mLayout->addWidget(mOpenFileFrame);
37  mLayout->addWidget(mGetInTouchFrame);
38 
39  repolish(); // CALL FROM PARENT
40  }
41 
43  {
44  QStyle* s = style();
45 
46  s->unpolish(this);
47  s->polish(this);
48 
49  mRecentFilesWidget->repolish();
50  mOpenFileWidget->repolish();
51  mGetInTouchWidget->repolish();
52  }
53 }
The welcome screen's GetInTouch section.
A QFrame with a label.
Definition: labeled_frame.h:45
void addContent(QWidget *content)
The welcome screen's OpenFile section.
The welcome screen's RecentFiles section.
Creates a shadow effect around QObjects.
Definition: shadow_effect.h:41
WelcomeScreen(QWidget *parent=nullptr)
void addWidget(QWidget *widget, int stretch, Qt::Alignment alignment)
void setSpacing(int spacing)
bool setAlignment(QWidget *w, Qt::Alignment alignment)
void setContentsMargins(int left, int top, int right, int bottom)
void setObjectName(const QString &name)
virtual void polish(QWidget *widget)
virtual void unpolish(QWidget *widget)
AlignCenter
void setGraphicsEffect(QGraphicsEffect *effect)
void setLayout(QLayout *layout)
QStyle * style() const const