[QTCLASS]
#include <QtGui>
#include "chestionar.h"
Chestionar
::Chestionar(QWidget *parent
){
nr_rand = 0;
variante_rasp = 0;
raspuns_corect ="Da";
setAttribute(Qt::WA_DeleteOnClose);
rg = 0;
//scrollArea->setBackgroundRole(QPalette::Dark);
// scrollArea->setsetLayout(grid);
qline
= new QTextEdit("dadasaasdsadadadsasdadsadassdadasda");
qline->setReadOnly(true);
// grid->addWidget(qline,0,0);
///aa
///aa
scroll->setWidget(qline);
//scroll->sets
scroll->setAlignment(Qt::AlignLeft);
// scroll->setWidgetResizable(true);
//scroll->widget()->resize();
// scroll->setBackgroundRole(QPalette::Dark);// set background of scroll Area
//qline->updateGeometry();
grid->addWidget(scroll,0,0);
//////////////////////////
radio1
= new QRadioButton(tr
("&Radio busssssssssxxxxxxxxxxxxxxxxxxxxxxxxxtssssssssssssssssssssssssssssssssssssssssssssssssssston 1"));
radio1->setMaximumWidth(10);;
radio2
= new QRadioButton(tr
("R&adio ssssssssxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxsssssssssssssssssssssssssssssssssssssssssssssssssbutton 2"));
radio3
= new QRadioButton(tr
("Ra&dio bssssxxxxxxxxxxxxxxxxxxxxxxxxxxxxxsssssssssssssssssssssssssssssssssssutton 3"));
radio1->setChecked(true);
grid->addWidget(radio1,1,0);
grid->addWidget(radio2,2,0);
grid->addWidget(radio3,3,0);
int32_t w=d->width();
radio1->setMaximumWidth(w);
///////////////////
//grid->addWidget(createFirstExclusiveGroup(), 1, 0);
setLayout(grid);
setWindowTitle(tr("xxx"));
// poza
topLevelLabel
= new QLabel("&xxx:",
this);
topLevelLabel->setText("sda");
pixmap.scaledToHeight(30, Qt::SmoothTransformation);
pixmap.scaledToWidth(50, Qt::SmoothTransformation);
topLevelLabel->setPixmap(pixmap);
topLevelLabel->setMask(pixmap.mask());
topLevelLabel->show();
grid->addWidget(topLevelLabel,4,0);
// poza
grid->addWidget(createNonExclusiveGroup(), 5, 0);
/*
QVBoxLayout *layout = new QVBoxLayout;
layout->addWidget(textEdit);
layout->addWidget(closeButton);
setLayout(layout);
*/
groupBox2->setTitle("ssssssssssssss");
qline->setText("testing"); ;
radio1->setText("dsa");
radio2->setText("dsada");
radio3->setText("adsdaddsadau");
}
QGroupBox *Chestionar
::createNonExclusiveGroup() {
groupBox2
= new QGroupBox(tr
("Non-Exclusive Checkboxes"));
groupBox2->setFlat(true);
//! [7]
//! [8]
connect(closeButton, SIGNAL(clicked()), this, SLOT(close()));
connect(closeButton2, SIGNAL(clicked()), this, SLOT(urmatoareaslot()));
//! [8]
//! [9]
vbox->addWidget(closeButton2);
vbox->addWidget(closeButton);
// vbox->addStretch(1);
groupBox2->setLayout(vbox);
return groupBox2;
}
void Chestionar::setWindowFlags(Qt::WindowFlags flags)
{
Qt::WindowFlags type = (flags & Qt::WindowType_Mask);
if (type == Qt::Window) {
text = "Qt::Window";
} else if (type == Qt::Dialog) {
text = "Qt::Dialog";
} else if (type == Qt::Sheet) {
text = "Qt::Sheet";
} else if (type == Qt::Drawer) {
text = "Qt::Drawer";
} else if (type == Qt::Popup) {
text = "Qt::Popup";
} else if (type == Qt::Tool) {
text = "Qt::Tool";
} else if (type == Qt::ToolTip) {
text = "Qt::ToolTip";
} else if (type == Qt::SplashScreen) {
text = "Qt::SplashScreen";
}
if (flags & Qt::MSWindowsFixedSizeDialogHint)
text += "\n| Qt::MSWindowsFixedSizeDialogHint";
if (flags & Qt::X11BypassWindowManagerHint)
text += "\n| Qt::X11BypassWindowManagerHint";
if (flags & Qt::FramelessWindowHint)
text += "\n| Qt::FramelessWindowHint";
if (flags & Qt::WindowTitleHint)
text += "\n| Qt::WindowTitleHint";
if (flags & Qt::WindowSystemMenuHint)
text += "\n| Qt::WindowSystemMenuHint";
if (flags & Qt::WindowMinimizeButtonHint)
text += "\n| Qt::WindowMinimizeButtonHint";
if (flags & Qt::WindowMaximizeButtonHint)
text += "\n| Qt::WindowMaximizeButtonHint";
if (flags & Qt::WindowContextHelpButtonHint)
text += "\n| Qt::WindowContextHelpButtonHint";
if (flags & Qt::WindowShadeButtonHint)
text += "\n| Qt::WindowShadeButtonHint";
if (flags & Qt::WindowStaysOnTopHint)
text += "\n| Qt::WindowStaysOnTopHint";
if (flags & Qt::CustomizeWindowHint)
text += "\n| Qt::CustomizeWindowHint";
textEdit->setPlainText(text);
}
void Chestionar::listItemClicked()
{
topLevelLabel->setText("xxxxxxxxxxxx");
}
void Chestionar::urmatoareaslot()
{
}//in plus
[/QTCLASS]
Bookmarks