Разделы презентаций


QT

Signals and SlotsSignal – send specific signal to a slot after a specific action is done(ex: button pressed() or released)Slot – what must be done after signal is received(ex: close() an

Слайды и текст этой презентации

Слайд 1QT
Week 12

Signals and Slots
Layouts

QTWeek 12Signals and SlotsLayouts

Слайд 2Signals and Slots
Signal – send specific signal to a slot

after a specific action is done(ex: button pressed() or released)

Slot

– what must be done after signal is received(ex: close() an application or change the color of label)
Signals and SlotsSignal – send specific signal to a slot after a specific action is done(ex: button

Слайд 3Syntax of Signal and Slot
QObject::connect(button,SIGNAL(clicked()),&application, SLOT(close()));

QObject is needed to create

a macro. Must be used when signal and slot are

used
connect() – function is needed to create a macro
button – object for signal
SIGNAL(clicked()) – what action must be done when function of object for signal is done
&application – object for slot
SLOT(close()) – what action must be done with object for slot
Syntax of Signal and SlotQObject::connect(button,SIGNAL(clicked()),&application, SLOT(close()));QObject is needed to create a macro. Must be used when signal

Слайд 4Layout types
There are 2 types of layout in QT

Layouts
Absolute positioning

Layout typesThere are 2 types of layout in QTLayoutsAbsolute positioning

Слайд 5Absolute Positioning
The programmer specifies the position and the size of

each widget in pixels. When you use absolute positioning, you

have to understand several things:

the size and the position of a widget do not change, if you resize a window
applications look different (often crappy) on various platforms
- changing fonts in your application might spoil the layout
- if you decide to change your layout, you must completely redo your layout, which is tedious and time consuming

Absolute PositioningThe programmer specifies the position and the size of each widget in pixels. When you use

Слайд 6Example
Function setGeometry(x,y,w,h)

x – begin coordinate of x-axis
y – begin coordinate

of y-axis
w – width of object
h – height of object

Ex:

button->setGeometry(100,0,50,50)
ExampleFunction setGeometry(x,y,w,h)x – begin coordinate of x-axisy – begin coordinate of y-axisw – width of objecth –

Слайд 7Layouts
QHBoxLayout – places objects in horizontal way
QVBoxLayout – places objects

in vertical way
QGridLayout – places objects like a grid

Ex: grid->addWidget(button, i, j);
LayoutsQHBoxLayout – places objects in horizontal wayQVBoxLayout – places objects in vertical wayQGridLayout – places objects like

Обратная связь

Если не удалось найти и скачать доклад-презентацию, Вы можете заказать его на нашем сайте. Мы постараемся найти нужный Вам материал и отправим по электронной почте. Не стесняйтесь обращаться к нам, если у вас возникли вопросы или пожелания:

Email: Нажмите что бы посмотреть 

Что такое TheSlide.ru?

Это сайт презентации, докладов, проектов в PowerPoint. Здесь удобно  хранить и делиться своими презентациями с другими пользователями.


Для правообладателей

Яндекс.Метрика