before initialising my label i made my widget to full screen.
my code:
widget.cpp
ui(new Ui::Widget)
{
showFullScreen();
activateWindow();
}
Widget::Widget(QWidget *parent) :
QWidget(parent),
ui(new Ui::Widget)
{
showFullScreen();
activateWindow();
label=new QLabel(this);
}
To copy to clipboard, switch view to plain text mode
displaying images in label:
void displayimages()
{
ImageToLoad.load(dir.absoluteFilePath(remoteimagefilename)); //image name
label
->setPixmap
(QPixmap::fromImage(ImageToLoad.
scaled(1025,
1025,Qt
::KeepAspectRatio,Qt
::FastTransformation))); label
->showFullScreen
();
}
void displayimages()
{
ImageToLoad.load(dir.absoluteFilePath(remoteimagefilename)); //image name
label->setPixmap(QPixmap::fromImage(ImageToLoad.scaled(1025,1025,Qt::KeepAspectRatio,Qt::FastTransformation))); label->showFullScreen();
}
To copy to clipboard, switch view to plain text mode
mouseclick event
{
if (event->button() & (Qt::LeftButton | Qt::RightButton))
{
showMaximized();
activateWindow();
update();
}
}
void Widget::mousePressEvent(QMouseEvent *event)
{
if (event->button() & (Qt::LeftButton | Qt::RightButton))
{
showMaximized();
activateWindow();
update();
}
}
To copy to clipboard, switch view to plain text mode

Originally Posted by
wysota
What have you tried so far to solve your problem?
Bookmarks