I have a dialog placed a label control ( add images used ) , there are some PushButton, the entire interface together with a QGridLayout layout , the main drag big dialog , the control can work together to become larger .
I want to label the image is larger than the time to add a scroll bar in the label , but this , the whole interface controls positions are chaotic mess , do not re-set in the code from the effect , does anyone know how to go back things , how to solve ?
Or, there are no heroes know that in tow large or small dialog dragging , it will not send a signal , I can manually change the dialog in the size of the control ?
urgently , online, thanks!
------ Solution ---------------------------------------- ----
drag the resize event is generated when
your picture display area is not Gridlayout manage it
------ Solution ------------------------- -------------------
changed a bit, the QLabel to QScrollArea, use the code to add QLabel QScrollArea,
with void setWidget (QWidget * widget) Add QLabel
will void setWidgetResizable (bool resizable) is set to false
then you can add a picture to the label , the picture bigger than the window automatically when a scroll bar.
------ eference ------------------------------------ ---
QScrollArea also need to set what attributes do ?
I just tried it, picture than the window is large , and no scroll bar appears.
------ eference --------------------------------------- < br> mainLabel = new QLabel;
ui-> scrollArea-> setWidget (mainLabel);
ui-> scrollArea-> setWidgetResizable (true);
ui-> scrollArea-> setHorizontalScrollBarPolicy (Qt :: ScrollBarAlwaysOn);
ui-> scrollArea-> setVerticalScrollBarPolicy (Qt :: ScrollBarAlwaysOn);
QString sPnlPath = "D :/ PcsMessage/release/MaterialsInfo/as/20100710008.jpg";
mainLabel-> setPixmap (QPixmap (sPnlPath));
That's it
------ eference -------------------------------- -------
4 Floor positive solutions ~ ~
没有评论:
发表评论