* Window Widget layout:
Spinner: Qspinbox
Slider: Qslider
* Three Parts Manager:
Level: Qhboxlayout
Vertical: Qvboxlayout
Grid: Qgridlayout
* Signal-Slot connection and layout:
Connect (transmit signal, macro signal (signal), accept signal, macro slot (slot))
#include"mainwindow.h"#include<QApplication>#include<QHBoxLayout>#include<QSlider>#include<QSpinBox>intMainintargcChar*argv[]) {qapplication app (argc, argv); Qwidget*window =NewQwidget; Window->setwindowtitle ("Enter Your Age"); Qspinbox*spinbox =NewQspinbox; Qslider*slider =NewQslider (qt::horizontal); Spinbox->setrange (0, -); Slider->setrange (0, -); Qobject::connect (Spinbox, SIGNAL (valuechanged (int), Slider, SLOT (SetValue (int))); Qobject::connect (Slider, SIGNAL (valuechanged (int), Spinbox, SLOT (SetValue (int))); Spinbox->setvalue ( *); Qhboxlayout*layout =Newqhboxlayout; Layout-AddWidget (Spinbox); Layout-addwidget (slider); Window-setlayout (layout); Window-Show (); returnApp.exec ();}
Novice on the road, Welcome to Exchange!
Introduction to C + + GUI qt