ui: polishing for presentation

* enabled highDpi icons in QApplication for Searchbar Icons
* realigned StartScreen contents
* showing version number 0.1
* "Search" as placeholder text in SearchBar
* same content margins for each dockwidget view
* brighter variable color in Graph
* press ESC to close StartScreen
This commit is contained in:
Eberhard Graether
2015-05-30 21:18:18 +02:00
parent 0153330317
commit 3e419bb41f
21 changed files with 192 additions and 166 deletions
@@ -70,20 +70,20 @@
<hover>#F4BC3D</hover> <hover>#F4BC3D</hover>
</method> </method>
<field> <field>
<normal>#6DA1BC</normal> <normal>#7BB5D4</normal>
<hover>#3190BA</hover> <hover>#42A1D4</hover>
</field> </field>
<global> <global>
<normal>#6DA1BC</normal> <normal>#7BB5D4</normal>
<hover>#3190BA</hover> <hover>#42A1D4</hover>
</global> </global>
<undefined> <undefined>
<normal>#00000000</normal> <normal>#00000000</normal>
<hover>#00000000</hover> <hover>#00000000</hover>
</undefined> </undefined>
<undefined_variable> <undefined_variable>
<normal>#6DA1BC</normal> <normal>#7BB5D4</normal>
<hover>#3190BA</hover> <hover>#42A1D4</hover>
</undefined_variable> </undefined_variable>
<undefined_function> <undefined_function>
<normal>#F4D07D</normal> <normal>#F4D07D</normal>
@@ -102,8 +102,8 @@
<hover>#ededed</hover> <hover>#ededed</hover>
</typedef> </typedef>
<enum_constant> <enum_constant>
<normal>#6DA1BC</normal> <normal>#7BB5D4</normal>
<hover>#3190BA</hover> <hover>#42A1D4</hover>
</enum_constant> </enum_constant>
<template_parameter_type> <template_parameter_type>
<normal>#ededed</normal> <normal>#ededed</normal>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

@@ -5,7 +5,6 @@
QPushButton { QPushButton {
background: #E0E0E0; background: #E0E0E0;
border: none; border: none;
background-position: 15px 5px;
height: 30px; height: 30px;
width: 30px; width: 30px;
} }
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

+11 -43
View File
@@ -1,19 +1,16 @@
#include <memory> #include <memory>
#include <QApplication> #include <QApplication>
#include <QBitmap>
#include <QThread> #include "utility/logging/ConsoleLogger.h"
#include <QSplashScreen> #include "utility/logging/FileLogger.h"
#include <QtWidgets/qmainwindow.h> #include "utility/logging/LogManager.h"
#include "Application.h" #include "Application.h"
#include "includes.h" // defines 'void setup(int argc, char *argv[])' #include "includes.h" // defines 'void setup(int argc, char *argv[])'
#include "qt/element/QtSplashScreen.h" #include "qt/element/QtSplashScreen.h"
#include "qt/utility/utilityQt.h" #include "qt/utility/utilityQt.h"
#include "qt/view/QtViewFactory.h" #include "qt/view/QtViewFactory.h"
#include "utility/logging/ConsoleLogger.h"
#include "utility/logging/FileLogger.h"
#include "utility/logging/LogManager.h"
void init() void init()
{ {
@@ -28,56 +25,27 @@ void init()
utility::loadFontsFromDirectory("data/fonts", ".otf"); utility::loadFontsFromDirectory("data/fonts", ".otf");
} }
class InitThread : public QThread
{
public:
void run(void)
{
//min Time the Splash screen is displayed
QThread::msleep(500);
}
};
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
setup(argc, argv); setup(argc, argv);
QApplication qtApp(argc, argv); QApplication qtApp(argc, argv);
QPixmap whitePixmap(500,500); qtApp.setAttribute(Qt::AA_UseHighDpiPixmaps);
QPixmap whitePixmap(500, 500);
whitePixmap.fill(Qt::white); whitePixmap.fill(Qt::white);
QPixmap p;
p.load("data/gui/splash_white.png");
QPixmap foreground = p.scaled(whitePixmap.size()*0.8);
p.load("data/gui/splash_blue.png");
QPixmap background = p.scaled(whitePixmap.size()*0.9);
QtSplashScreen* splash = new QtSplashScreen(whitePixmap, Qt::WindowStaysOnTopHint); QtSplashScreen* splash = new QtSplashScreen(whitePixmap, Qt::WindowStaysOnTopHint);
qtApp.processEvents(); splash->setMessage("Loading UI");
splash->setForeground(foreground); splash->setVersion("0.1");
splash->setBackground(background); splash->exec(qtApp);
splash->show();
splash->repaint();
qtApp.processEvents();
if (splash) splash->message( "Starting GUI" );
qtApp.processEvents();
init(); init();
// Eventloop for Splashscreen
QEventLoop loop;
InitThread* initThread = new InitThread();
QObject::connect(initThread, SIGNAL(finished()), &loop, SLOT(quit()));
QObject::connect(initThread, SIGNAL(terminated()), &loop, SLOT(quit()));
initThread->start();
loop.exec();
QtViewFactory viewFactory; QtViewFactory viewFactory;
std::shared_ptr<Application> app = Application::create(&viewFactory); std::shared_ptr<Application> app = Application::create(&viewFactory);
if(splash) if (splash)
{ {
delete splash; delete splash;
} }
+7 -4
View File
@@ -42,10 +42,10 @@ QtMainWindow::QtMainWindow()
// Seconde call is in Application.cpp // Seconde call is in Application.cpp
loadLayout(); loadLayout();
//startScreen // StartScreen
startScreen = std::make_shared<QtStartScreen>(this); m_startScreen = std::make_shared<QtStartScreen>(this);
startScreen->setWindowModality(Qt::WindowModal); m_startScreen->setWindowModality(Qt::WindowModal);
startScreen->show(); m_startScreen->show();
} }
QtMainWindow::~QtMainWindow() QtMainWindow::~QtMainWindow()
@@ -57,6 +57,8 @@ void QtMainWindow::addView(View* view)
QDockWidget* dock = new QDockWidget(tr(view->getName().c_str()), this); QDockWidget* dock = new QDockWidget(tr(view->getName().c_str()), this);
dock->setWidget(QtViewWidgetWrapper::getWidgetOfView(view)); dock->setWidget(QtViewWidgetWrapper::getWidgetOfView(view));
dock->setObjectName(QString::fromStdString("Dock" + view->getName())); dock->setObjectName(QString::fromStdString("Dock" + view->getName()));
// dock->setFeatures(QDockWidget::NoDockWidgetFeatures);
// dock->setTitleBarWidget(new QWidget());
addDockWidget(Qt::TopDockWidgetArea, dock); addDockWidget(Qt::TopDockWidgetArea, dock);
m_dockWidgets.push_back(std::make_pair(view, dock)); m_dockWidgets.push_back(std::make_pair(view, dock));
} }
@@ -216,6 +218,7 @@ void QtMainWindow::redo()
void QtMainWindow::handleEscapeShortcut() void QtMainWindow::handleEscapeShortcut()
{ {
m_startScreen->hide();
MessageInterruptTasks().dispatch(); MessageInterruptTasks().dispatch();
} }
+2 -1
View File
@@ -56,7 +56,8 @@ private:
void setupShortcuts(); void setupShortcuts();
QDockWidget* getDockWidgetForView(View* view) const; QDockWidget* getDockWidgetForView(View* view) const;
std::shared_ptr<QtStartScreen> startScreen;
std::shared_ptr<QtStartScreen> m_startScreen;
std::vector<std::pair<View*, QDockWidget*>> m_dockWidgets; std::vector<std::pair<View*, QDockWidget*>> m_dockWidgets;
+1 -1
View File
@@ -781,7 +781,7 @@ void QtSmartSearchBox::updatePlaceholder()
{ {
if (!text().size() && !m_elements.size()) if (!text().size() && !m_elements.size())
{ {
setPlaceholderText("Please enter your search string."); setPlaceholderText("Search");
} }
else else
{ {
+82 -42
View File
@@ -1,63 +1,103 @@
#include "QtSplashScreen.h" #include "QtSplashScreen.h"
#include <QApplication>
#include <QThread>
#include <QTimer> #include <QTimer>
QtSplashScreen::QtSplashScreen(const QPixmap &pixmap, Qt::WindowFlags f) : QSplashScreen (pixmap, f) #include "qt/utility/QtDeviceScaledPixmap.h"
namespace
{ {
state = 0; class InitThread : public QThread
QTimer *timer = new QTimer( this ); {
QObject::connect(timer, SIGNAL(timeout()), this, SLOT(animate())); public:
timer->start(150); void run(void)
show(); {
repaint(); // Mininmum time the SplashScreen gets displayed.
QThread::msleep(5000);
}
};
}
QtSplashScreen::QtSplashScreen(const QPixmap &pixmap, Qt::WindowFlags f)
: QSplashScreen(pixmap, f)
, m_state(0)
{
QtDeviceScaledPixmap foreground("data/gui/splash_white.png");
foreground.scaleToHeight(pixmap.size().height() * 0.8);
m_foreground = foreground.pixmap();
QtDeviceScaledPixmap background("data/gui/splash_blue.png");
background.scaleToHeight(pixmap.size().height() * 0.9);
m_background = background.pixmap();
} }
QtSplashScreen::~QtSplashScreen() QtSplashScreen::~QtSplashScreen()
{ {
} }
void QtSplashScreen::exec(QApplication& app)
{
m_state = 0;
QTimer* timer = new QTimer(this);
QObject::connect(timer, SIGNAL(timeout()), this, SLOT(animate()));
timer->start(150);
app.processEvents();
show();
repaint();
app.processEvents();
// Eventloop for the SplashScreen
// QEventLoop loop;
// InitThread* initThread = new InitThread();
// QObject::connect(initThread, SIGNAL(finished()), &loop, SLOT(quit()));
// initThread->start();
// loop.exec();
}
void QtSplashScreen::setMessage(const QString &str)
{
m_string = str;
repaint();
}
void QtSplashScreen::setVersion(const QString &str)
{
m_version = str;
repaint();
}
void QtSplashScreen::animate() void QtSplashScreen::animate()
{ {
state = (state+2)%120; m_state = (m_state + 2) % 120;
repaint(); repaint();
}
void QtSplashScreen::setBackground(QPixmap& pixmap)
{
m_Background = pixmap;
}
void QtSplashScreen::setForeground(QPixmap &pixmap)
{
m_Foreground = pixmap;
}
void QtSplashScreen::message(const QString &str, int flag, const QColor &color)
{
QSplashScreen::showMessage(str,flag,color);
animate();
m_string = str;
} }
void QtSplashScreen::drawContents(QPainter *painter) void QtSplashScreen::drawContents(QPainter *painter)
{ {
painter->save(); painter->save();
painter->translate(rect().width()/2,rect().height()/2); painter->translate(rect().width() / 2, rect().height() / 2);
painter->rotate(state*3); painter->rotate(m_state * 3);
painter->drawPixmap(-rect().width()*0.9/2,-rect().height()*0.9/2,m_Background); painter->drawPixmap(-rect().width() * 0.9 / 2, -rect().height() * 0.9 / 2, m_background);
painter->restore(); painter->restore();
painter->drawPixmap(rect().width()*0.1,rect().height()*0.1,m_Foreground); painter->drawPixmap(rect().width() * 0.1, rect().height() * 0.1, m_foreground);
painter->setPen(QColor(74,112,18)); QRect r = rect();
QRect r = rect(); r.setRect(r.x() + 5, r.height() - 20, r.width() - 10, 20);
r.setRect(r.x() + 5, r.y() + 5, r.width() - 10, r.height() - 10);
// TODO: automated Version number // TODO: automated Version number
painter->drawText(r, Qt::AlignRight, "Version 0.0.0"); painter->drawText(r, Qt::AlignRight, QString("Coati v").append(m_version));
// Draw message at given position, limited to 43 chars // Draw message at given position, limited to 43 chars
// If message is too long, string is truncated // If message is too long, string is truncated
if (m_string.length() > 40) {m_string.truncate(39); m_string += "...";} if (m_string.length() > 40)
painter->drawText(90, 16,m_string); {
m_string.truncate(39);
m_string += "...";
}
painter->drawText(r, Qt::AlignLeft, m_string);
} }
+20 -15
View File
@@ -5,30 +5,35 @@
#include <QPainter> #include <QPainter>
#include <QWidget> #include <QWidget>
class QApplication;
class QPixmap; class QPixmap;
class QtSplashScreen : public QSplashScreen class QtSplashScreen
: public QSplashScreen
{ {
Q_OBJECT Q_OBJECT
public: public:
QtSplashScreen(const QPixmap& pixmap, Qt::WindowFlags f = 0); QtSplashScreen(const QPixmap& pixmap, Qt::WindowFlags f = 0);
QtSplashScreen(Qt::WindowFlags f = 0); virtual ~QtSplashScreen();
virtual ~QtSplashScreen();
void setBackground(QPixmap& pixmap); void exec(QApplication& app);
void setForeground(QPixmap& pixmap); void setMessage(const QString& str);
protected: void setVersion(const QString& str);
void drawContents(QPainter* painter);
public slots: public slots:
void animate(); void animate();
void message(const QString& str, int flag = Qt::AlignLeft, const QColor& color = Qt::black);
private: private:
QString m_string; void drawContents(QPainter* painter);
int state;
QPixmap m_Background; int m_state;
QPixmap m_Foreground;
QString m_string;
QString m_version;
QPixmap m_background;
QPixmap m_foreground;
}; };
#endif //QTSPLASHSCREEN_H #endif //QTSPLASHSCREEN_H
+54 -46
View File
@@ -1,17 +1,17 @@
#include <QtWidgets/qlabel.h>
#include "QtStartScreen.h" #include "QtStartScreen.h"
#include <QPainter> #include <QLabel>
#include <QKeyEvent>
#include "utility/file/FileSystem.h" #include "utility/file/FileSystem.h"
#include "utility/messaging/type/MessageLoadProject.h" #include "utility/messaging/type/MessageLoadProject.h"
#include "qt/utility/QtDeviceScaledPixmap.h"
QtRecentProjectButton::QtRecentProjectButton(const QString &text, QWidget *parent) QtRecentProjectButton::QtRecentProjectButton(const QString &text, QWidget *parent)
: QPushButton(text, parent) : QPushButton(text, parent)
{ {
m_projectFile = text.toStdString(); m_projectFile = text.toStdString();
this->setText(FileSystem::fileName(FileSystem::filePathWithoutExtension(text.toStdString())).c_str()); this->setText(FileSystem::fileName(text.toStdString()).c_str());
} }
void QtRecentProjectButton::handleButtonClick() void QtRecentProjectButton::handleButtonClick()
@@ -23,37 +23,41 @@ void QtRecentProjectButton::handleButtonClick()
QtStartScreen::QtStartScreen(QWidget *parent) QtStartScreen::QtStartScreen(QWidget *parent)
: QWidget(parent, Qt::Dialog | Qt::Popup | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint ) : QWidget(parent, Qt::Dialog | Qt::Popup | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint )
{ {
setGeometry(parent->pos().x()+parent->width()/2-350,parent->pos().y()+parent->height()/2-250,600,500); setGeometry(parent->pos().x()+parent->width()/2-250,parent->pos().y()+parent->height()/2-250,500,500);
QPalette palette; QPalette palette;
QLinearGradient linearGradient(QPointF(0, 0), QPointF(0, 500)); QLinearGradient linearGradient(QPointF(0, 275), QPointF(0, 500));
linearGradient.setColorAt(0, QColor(46,61,135)); linearGradient.setColorAt(0, QColor(46, 61, 135));
linearGradient.setColorAt(1, QColor(0,120,195)); linearGradient.setColorAt(1, QColor(0, 120, 195));
palette.setBrush(QPalette::Window,*(new QBrush(linearGradient))); palette.setBrush(QPalette::Window, *(new QBrush(linearGradient)));
this->setPalette(palette); this->setPalette(palette);
//QPixmap coati_logo("data/gui/logo_coati.png"); QtDeviceScaledPixmap coati_logo("data/gui/startscreen/logo_white.png");
QPixmap coati_logo("data/gui/startscreen/logo_white.png"); coati_logo.scaleToWidth(100);
QPixmap cpp_icon("data/gui/startscreen/cpluspluss_icon.png");
QLabel* coatiLogoLabel = new QLabel(this); QLabel* coatiLogoLabel = new QLabel(this);
coatiLogoLabel->setPixmap(coati_logo); coatiLogoLabel->setPixmap(coati_logo.pixmap());
coatiLogoLabel->setGeometry(30,30,100,138); coatiLogoLabel->setGeometry(30, 30, coati_logo.width(), coati_logo.height());
std::string buttonStyle = std::string buttonStyle =
"QPushButton{font-family: " "QPushButton {"
"Source Code Pro; " "font-size: 17pt; "
"font-size: 17pt; " "border-radius: 10px; "
"border-radius: 15px; " "background: white; "
"background: white} " "} "
"QPushButton:hover {background:lightgrey;}"; "QPushButton:hover {"
"background: rgba(255, 255, 255, 0.8); "
"}";
m_newProjectButton = new QPushButton("New Project", this); m_newProjectButton = new QPushButton("New Project", this);
m_newProjectButton->setGeometry(20,350, 200, 50); m_newProjectButton->setAttribute(Qt::WA_LayoutUsesWidgetRect); // fixes layouting on Mac
m_newProjectButton->setGeometry(30, 375, 140, 30);
m_newProjectButton->setStyleSheet(buttonStyle.c_str()); m_newProjectButton->setStyleSheet(buttonStyle.c_str());
connect(m_newProjectButton, SIGNAL(clicked()), this, SLOT(handleNewProjectButton())); connect(m_newProjectButton, SIGNAL(clicked()), this, SLOT(handleNewProjectButton()));
m_openProjectButton = new QPushButton("Open Project", this); m_openProjectButton = new QPushButton("Open Project", this);
m_openProjectButton->setGeometry(20,420, 200, 50); m_openProjectButton->setAttribute(Qt::WA_LayoutUsesWidgetRect); // fixes layouting on Mac
m_openProjectButton->setGeometry(30, 420, 140, 30);
m_openProjectButton->setStyleSheet(buttonStyle.c_str()); m_openProjectButton->setStyleSheet(buttonStyle.c_str());
connect(m_openProjectButton, SIGNAL(clicked()), this, SLOT(handleOpenProjectButton())); connect(m_openProjectButton, SIGNAL(clicked()), this, SLOT(handleOpenProjectButton()));
@@ -61,47 +65,51 @@ QtStartScreen::QtStartScreen(QWidget *parent)
connect(this, SIGNAL(openNewProjectDialog()), parent, SLOT(newProject())); connect(this, SIGNAL(openNewProjectDialog()), parent, SLOT(newProject()));
QLabel* recentProjectsLabel = new QLabel("RECENT PROJECTS: ", this); QLabel* recentProjectsLabel = new QLabel("RECENT PROJECTS: ", this);
QFont font("Helvetica", 20); recentProjectsLabel->setGeometry(300, 129, 300, 50);
recentProjectsLabel->setFont(font); recentProjectsLabel->setStyleSheet(
recentProjectsLabel->setStyleSheet("QLabel{font-family: Source Code Pro; font-size: 20pt; color: white;}"); "QLabel {"
recentProjectsLabel->setGeometry(250, 100, 300, 50); "font-size: 16pt; "
"color: white; "
"}"
);
std::vector<std::string> extensions; std::vector<std::string> extensions;
extensions.push_back(".xml"); extensions.push_back(".xml");
std::vector<std::string> recentProjects = FileSystem::getFileNamesFromDirectory("data/projects", extensions); std::vector<std::string> recentProjects = FileSystem::getFileNamesFromDirectory("data/projects", extensions);
int position = 150; int position = 200;
for(std::string project : recentProjects) QIcon cpp_icon("data/gui/startscreen/cpluspluss_icon.png");
for (std::string project : recentProjects)
{ {
QtRecentProjectButton* button = new QtRecentProjectButton(project.c_str(), this); QtRecentProjectButton* button = new QtRecentProjectButton(project.c_str(), this);
button->setGeometry(250, position, 400, 40); button->setAttribute(Qt::WA_LayoutUsesWidgetRect); // fixes layouting on Mac
button->setIcon(cpp_icon); button->setIcon(cpp_icon);
button->setIconSize(QSize(40,40)); button->setIconSize(QSize(25, 25));
button->setStyleSheet( button->setStyleSheet(
"QPushButton{" "QPushButton{"
"font-family: Source Code Pro; " "font-size: 12pt; "
"font-size: 12pt; " // "text-align: left; " // when using this the QPixmap is drawn without regard of the screens DPI
"Text-align:left; " "color: white; "
"color: white; " "background: none; "
"background:none; " "border: none; "
"border:none;} " "} "
"QPushButton:hover{color:lightgrey;}"); "QPushButton:hover{"
"background: rgba(255, 255, 255, 0.15); "
"border-radius: 10px; "
"}"
);
button->minimumSizeHint(); // force font loading
button->setGeometry(292, position, button->fontMetrics().width(button->text()) + 45, 40);
connect(button, SIGNAL(clicked()), button, SLOT(handleButtonClick())); connect(button, SIGNAL(clicked()), button, SLOT(handleButtonClick()));
position +=50; position += 40;
} }
this->raise(); this->raise();
} }
QSize QtStartScreen::sizeHint() const QSize QtStartScreen::sizeHint() const
{ {
return QSize(500,500); return QSize(500, 500);
}
void QtStartScreen::paintEvent(QPaintEvent *event)
{
QPainter* painter = new QPainter(this);
} }
void QtStartScreen::handleNewProjectButton() void QtStartScreen::handleNewProjectButton()
-4
View File
@@ -5,7 +5,6 @@
#include <QWidget> #include <QWidget>
#include <QtWidgets/qpushbutton.h> #include <QtWidgets/qpushbutton.h>
class QtRecentProjectButton : public QPushButton class QtRecentProjectButton : public QPushButton
{ {
Q_OBJECT Q_OBJECT
@@ -25,8 +24,6 @@ public:
QtStartScreen(QWidget* parent = 0); QtStartScreen(QWidget* parent = 0);
QSize sizeHint() const Q_DECL_OVERRIDE; QSize sizeHint() const Q_DECL_OVERRIDE;
void paintEvent(QPaintEvent* event);
signals: signals:
void openOpenProjectDialog(); void openOpenProjectDialog();
void openNewProjectDialog(); void openNewProjectDialog();
@@ -40,5 +37,4 @@ private:
std::vector<QPushButton*> m_recentProjects; std::vector<QPushButton*> m_recentProjects;
}; };
#endif //STARTSCREEN_H #endif //STARTSCREEN_H
@@ -36,6 +36,12 @@ public:
return m_pixmap.height() / devicePixelRatio(); return m_pixmap.height() / devicePixelRatio();
} }
void scaleToWidth(int width)
{
m_pixmap = m_pixmap.scaledToWidth(width * devicePixelRatio(), Qt::SmoothTransformation);
m_pixmap.setDevicePixelRatio(devicePixelRatio());
}
void scaleToHeight(int height) void scaleToHeight(int height)
{ {
m_pixmap = m_pixmap.scaledToHeight(height * devicePixelRatio(), Qt::SmoothTransformation); m_pixmap = m_pixmap.scaledToHeight(height * devicePixelRatio(), Qt::SmoothTransformation);
+1 -1
View File
@@ -19,7 +19,7 @@ QtCompositeView::QtCompositeView(ViewLayout* viewLayout, CompositeDirection dire
} }
layout->setSpacing(5); layout->setSpacing(5);
layout->setContentsMargins(5, 5, 5, 5); layout->setContentsMargins(8, 8, 8, 8);
layout->setAlignment(Qt::AlignTop); layout->setAlignment(Qt::AlignTop);
m_widget = new QWidget(); m_widget = new QWidget();