How can we just display image if we don't have any base widget?
General and Desktop
6
Posts
4
Posters
2.6k
Views
1
Watching
-
I think something like this:
@#include <QApplication>
#include <QLable>
#include <QPixmap>int main( int argc, char* argv[] )
{
QApplication app( argc, argv );
QLabel imageLabel;
imageLabel.setPixmap( QPixmap( "/path/to/your/image" ) );
imageLabel.show();
return app.exec();
}@ -
You cannot display anything without a window, but you can display a window without a frame (and I assume this is what you want to achieve) by setting the Qt::FramlessWindowHint flag.
@
int main(int argc, char *argv[])
{
QApplication a(argc, argv);QLabel label; label.setWindowFlags(Qt::FramelessWindowHint); label.setPixmap(QPixmap("logo.png")); label.show(); return a.exec();
}
@
Brain to terminal. Not tested. Exemplary.