Qt 5.10 Book Examples
chapter24
Printer
main.cpp
Go to the documentation of this file.
1
// ======================================================================
2
// main.cpp
3
// ======================================================================
4
// This file is a part of the book
5
// "Qt 5.10 Professional programming with C++"
6
// http://qt-book.com
7
// ======================================================================
8
// Copyright (c) 2017 by Max Schlee
9
// ======================================================================
10
11
#include <QtWidgets>
12
#include "
Printer.h
"
13
14
// ----------------------------------------------------------------------
15
int
main
(
int
argc,
char
** argv)
16
{
17
QApplication app(argc, argv);
18
QWidget wgt;
19
20
Printer
* pprinter =
new
Printer
;
21
QPushButton* pcmd =
new
QPushButton(
"&Print"
);
22
23
QObject::connect(pcmd, SIGNAL(clicked()),
24
pprinter, SLOT(slotPrint())
25
);
26
27
//Layout setup
28
QVBoxLayout* pvbxLayout =
new
QVBoxLayout;
29
pvbxLayout->setContentsMargins(0, 0, 0, 0);
30
pvbxLayout->setSpacing(0);
31
pvbxLayout->addWidget(pprinter);
32
pvbxLayout->addWidget(pcmd);
33
wgt.setLayout(pvbxLayout);
34
35
wgt.resize(250, 320);
36
wgt.show();
37
38
return
app.exec();
39
}
Printer.h
main
int main(int argc, char **argv)
Definition:
main.cpp:15
Printer
Definition:
Printer.h:19
Generated by
1.8.14