[solved]Setting Images in QListWidget
-
Can you post your constructor code (the one containing this connect statement) ?
-
Not just the same connect statement, the complete constructor code
-
@
ImageRegistration::ImageRegistration(QWidget *parent) :
QWidget(parent),
ui(new Ui::ImageRegistration)
{ui->setupUi(this); ui->ExportTransformationMatrix->setStyleSheet("border-style:inset"); ui->ExportTransformationMatrix->setStyleSheet("border-width: 2px"); ui->ManualRegistrationView->setStyleSheet(" border: 2px solid rgb(130,170,245)"); ui->StationaryImageView->setStyleSheet(" border: 2px solid rgb(130,170,245)"); ui->MovingImageView->setStyleSheet("border: 2px solid rgb(130,170,245)"); ui->ZoomImage->setStyleSheet("border: 2px solid black "); connect(ui->ZoomImage,SIGNAL(valueChanged(int)),this,SLOT(updateTransform())); connect(ui->RotateImage,SIGNAL(valueChanged(int)),this,SLOT(updateTransform())); connect(ui->ImportImages,SIGNAL(clicked()),&listObject_, SLOT(setData_()));
}
@
I have initialised the object in header as @ listWidget listObject_; @
-
You don't show listObject_.
And since it's not in any layout, it won't be automatically placed/resized for you
-
Hi,
Thanks for the response. When i added
@listObject_.show(); @ its shown in separate window, how can i make it visible in listWidget? I thought when we create an object, and apply the slot it would be placed in the class from which object is created. If we have to specify it manually is there a way to do it? -
It won't automagically be layouted because you create it in a widget.
You need to either add it to your ui file (using designer) or add it to your widgets layout.
-
This is not a clean solution.
Remove listWidget from your code and only call ui->ImageList. You are starting evil things there (have a look about at the QObject documentation to know why copying QObject/QObject derived class is not allowed)