HAL
get_in_touch_widget.cpp
Go to the documentation of this file.
2 
5 
6 #include <QDesktopServices>
7 #include <QLabel>
8 #include <QList>
9 #include <QStyle>
10 #include <QUrl>
11 #include <QVBoxLayout>
12 
13 namespace hal
14 {
16  : QFrame(parent), mLayout(new QVBoxLayout()), mAboutItem(new GetInTouchItem("About", "Show license and version information")),
17  mNewsItem(new GetInTouchItem("Stay up to date", "Subscribe to our newsfeed for the latest updates and patchnotes")),
18  mForumItem(new GetInTouchItem("Get in touch", "Check out the forum and so on and so on i dont know what to write here")),
19  mCppDocumentationItem(new GetInTouchItem("Open C++ Documentation", "Check out the C++ documentation of the HAL core to develop your own plugins")),
20  mPyDocumentationItem(new GetInTouchItem("Open Python Documentation", "Check out the Python documentation of HAL")),
21  mTicketItem(new GetInTouchItem("Found a bug ?", "Submit a bug report or feature request to our public tracker"))
22  {
27 
28  mLayout->setContentsMargins(0, 0, 0, 0);
29  mLayout->setSpacing(0);
30 
31  mAboutItem->setObjectName("about_item");
33 
34  mNewsItem->setObjectName("news_item");
36 
37  mForumItem->setObjectName("forum_item");
39 
40  mCppDocumentationItem->setObjectName("documentation_item");
42 
43  mPyDocumentationItem->setObjectName("documentation_item");
45 
46  mTicketItem->setObjectName("ticket_item");
48 
49  setLayout(mLayout);
50  mLayout->addWidget(mAboutItem);
51  // mLayout->addWidget(mNewsItem);
52  // mLayout->addWidget(mForumItem);
53  mLayout->addWidget(mCppDocumentationItem);
54  mLayout->addWidget(mPyDocumentationItem);
55  mLayout->addWidget(mTicketItem);
56 
57  repolish();
58  }
59 
61  {
62  QStyle* s = style();
63 
64  s->unpolish(this);
65  s->polish(this);
66 
67  // mAboutItem->repolish();
68  // m_documentation_item->repolish();
69  // mTicketItem->repolish();
70 
71  // for (QObject* object : mLayout->children())
72  // {
73  // GetInTouchItem* item = qobject_cast<GetInTouchItem*>(object);
74 
75  // if (item)
76  // item->repolish();
77  // }
78 
79  for (int i = 0; i < mLayout->count(); i++)
80  {
81  QWidget* widget = mLayout->itemAt(i)->widget();
82  GetInTouchItem* item = qobject_cast<GetInTouchItem*>(widget);
83 
84  if (item)
85  item->repolish();
86  }
87  }
88 
90  {
91  AboutDialog ad;
92  ad.exec();
93  }
94 
96  {
97  QString link = "https://emsec.github.io/hal/doc/";
99  }
100 
102  {
103  QString link = "https://emsec.github.io/hal/pydoc/";
105  }
106 
108  {
109  QString link = "https://github.com/emsec/hal/issues";
111  }
112 }
Apache License January AND DISTRIBUTION Definitions License shall mean the terms and conditions for and distribution as defined by Sections through of this document Licensor shall mean the copyright owner or entity authorized by the copyright owner that is granting the License Legal Entity shall mean the union of the acting entity and all other entities that control are controlled by or are under common control with that entity For the purposes of this definition control direct or to cause the direction or management of such whether by contract or including but not limited to software source documentation and configuration files Object form shall mean any form resulting from mechanical transformation or translation of a Source including but not limited to compiled object generated and conversions to other media types Work shall mean the work of whether in Source or Object made available under the as indicated by a copyright notice that is included in or attached to the whether in Source or Object that is based or other modifications as a an original work of authorship For the purposes of this Derivative Works shall not include works that remain separable or merely link(or bind by name) to the interfaces of
A dialog that displays the Qt version and our open source license.
Definition: about_dialog.h:43
One item in the welcome screen's GetInTouch section.
GetInTouchWidget(QWidget *parent=nullptr)
void addWidget(QWidget *widget, int stretch, Qt::Alignment alignment)
virtual int count() const const override
virtual QLayoutItem * itemAt(int index) const const override
void setSpacing(int spacing)
bool openUrl(const QUrl &url)
virtual int exec()
void setContentsMargins(int left, int top, int right, int bottom)
virtual QWidget * widget()
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
void setObjectName(const QString &name)
virtual void polish(QWidget *widget)
virtual void unpolish(QWidget *widget)
void setLayout(QLayout *layout)
void setSizePolicy(QSizePolicy)
QStyle * style() const const