Home > Mobile >  How to open and display images in qt?
How to open and display images in qt?

Time:09-25

Qt5, please point in detail, it is open and display, can automatically adjust the picture small,

CodePudding user response:

And baidu example to QT

CodePudding user response:

The
reference 1/f, to be continued _1006 response:
QT the cabin and baidu example

That help search, I search a validation of the whole problem,

CodePudding user response:

It depends on how you want, according to the basic idea is to make the image size and window size is consistent, at least signal QSS groove, rewrite window size change event, two methods to QML wide high fill can put the pictures into the window (control) wide higher, many methods, and is the foundation, basic tutorial is some, if even the tutorial to find...

CodePudding user response:

reference lishadowl reply: 3/f
it depends on how you want, according to the basic idea is to make the image size and window size consistent, at least signal QSS groove, rewrite window size change event, two methods to QML wide high fill can put the pictures into the window (control) wide higher, many methods, and is the foundation, basic tutorial is some, if even the tutorial to find...

This really can't find the tutorial , suddenly the teacher to learn qt, then no matter, don't know this thing before,

CodePudding user response:

QPixmap p (path); Loading images
Lb QLabel *=new QLabel; Create a label
Lb - & gt; The resize (w, h); Settings you want to show that the width of high
Lb - & gt; SetPixmap (p. cale (w1, h1)); Zoom pictures to show size

Qt Qt Document into the website to view, use baidu said very detailed,

CodePudding user response:


I have already set up the window in the UI interface, have also set up button, want to press the button in the window to open the pictures,

CodePudding user response:

The
this is a nice nickname reference 5 floor response:
QPixmap p (path); Loading images
Lb QLabel *=new QLabel; Create a label
Lb - & gt; The resize (w, h); Settings you want to show that the width of high
Lb - & gt; SetPixmap (p. cale (w1, h1)); Zoom pictures to show size

Qt Qt Document into the website to view, use baidu said very detailed,

To explain again, please? I run to be wrong

CodePudding user response:

CodePudding user response:

Weixin_45670380
reference 4 floor response:
Quote: refer to the third floor lishadowl response:
it depends on how you want, according to the basic idea is to make the image size and window size consistent, at least signal QSS groove, rewrite the window size change event, two methods to QML wide high fill can put the pictures into the window (control) wide higher, many methods, and is the foundation, basic tutorial is some, if even the tutorial to find...

This really can't find the tutorial , suddenly the teacher to learn qt, then no matter, don't know this thing before,

B station search qt there are a lot of video tutorials, grab a relatively complete to have the most basic part of (or even human hair have turn abroad all in English), to further may want to find some books to see again, and if you learn c + +, qt is quick to learn everything (c + + can be used in qt), and this is one of them, you can also look for the other and you have seen without this inside of you need to speak (is ten hours go up, a lot of repetition) https://www.bilibili.com/video/av20446734/
  •  Tags:  
  • Qt
  • Related