I have problem with moving checkbox from middle to the left:
#include <qfiledialog.h>
#include <qcheckbox.h>
class FileDialog : public QFileDialog
{
public:
QCheckBox* checkbox
FileDialog() : QFileDialog(0)
{
checkbox = new QCheckBox(this);
checkbox->setText("checkbox");
addWidgets( 0, checkbox, 0 );
}
};
Looks like it: enter image description here
I need to move it like this(better option): enter image description here
or like this: enter image description here
I can't use this method:
#include <qcheckbox.h>
#include <qlabel.h>
#include <qlayout.h>
class CheckBox : public QLabel
{
QCheckBox* checkbox;
public:
CheckBox(QWidget * parent) : QLabel(parent)
{
QGridLayout * box = new QGridLayout(this);
checkbox = new QCheckBox(this);
checkbox->setText("checkbox");
box->addWidget(checkbox, 0, 0, Qt::AlignLeft);
}
void paintEvent ( QPaintEvent * ){}
};
class FileDialog : public QFileDialog
{
public:
FileDialog() : QFileDialog(0)
{
addWidgets(new CheckBox(this), 0, 0);
}
};
I need other way to solve this problem. Somebody can help me? :)
Aucun commentaire:
Enregistrer un commentaire