Qt-2-Varsta-Age-Tutorial: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
AutoSpider (talk | contribs) (Add "cleanup" tag) |
||
(One intermediate revision by one other user not shown) | |||
Line 1: | Line 1: | ||
{{Cleanup | reason=Auto-imported from ExpressionEngine.}} | |||
@#include "varsta.h" | |||
#include <QApplication> | |||
#include <QSpinBox> | |||
#include <QSlider> | |||
#include <QHBoxLayout> | |||
int main(int argc, char *argv[]) | |||
{ | |||
QApplication a(argc, argv); | |||
QWidget *w = new QWidget; | |||
w->setWindowTitle("Introduceti varsta dvs."); | |||
QSpinBox *spinBox = new QSpinBox; | |||
QSlider *slider = new QSlider(Qt::Horizontal); | |||
spinBox->setRange(0,130); | |||
slider->setRange(0,130); | |||
QObject::connect(spinBox, SIGNAL (valueChanged(int)), slider, SLOT (setValue(int))); | |||
QObject::connect(slider, SIGNAL (valueChanged(int)), spinBox, SLOT (setValue(int))); | |||
spinBox->setValue(35); | |||
w- | QHBoxLayout *layout = new QHBoxLayout; | ||
layout->addWidget(spinBox); | |||
layout->addWidget(slider); | |||
w->setLayout(layout); | |||
return a.exec | w->show(); | ||
return a.exec(); | |||
} | |||
<code> |
Latest revision as of 16:25, 3 March 2015
This article may require cleanup to meet the Qt Wiki's quality standards. Reason: Auto-imported from ExpressionEngine. Please improve this article if you can. Remove the {{cleanup}} tag and add this page to Updated pages list after it's clean. |
@#include "varsta.h"
- include <QApplication>
- include <QSpinBox>
- include <QSlider>
- include <QHBoxLayout>
int main(int argc, char *argv[]) {
QApplication a(argc, argv); QWidget *w = new QWidget; w->setWindowTitle("Introduceti varsta dvs.");
QSpinBox *spinBox = new QSpinBox;
QSlider *slider = new QSlider(Qt::Horizontal); spinBox->setRange(0,130); slider->setRange(0,130);
QObject::connect(spinBox, SIGNAL (valueChanged(int)), slider, SLOT (setValue(int)));
QObject::connect(slider, SIGNAL (valueChanged(int)), spinBox, SLOT (setValue(int))); spinBox->setValue(35);
QHBoxLayout *layout = new QHBoxLayout;
layout->addWidget(spinBox); layout->addWidget(slider); w->setLayout(layout);
w->show();
return a.exec();
}