I created image background by border_image to make it zoom-able but whenever I create lineEdit,, Menu, or other things, the background still exist in those tool. How can I make other too empty of background that I have created? Capture.jpg
I created image background by border_image to make it zoom-able but whenever I create lineEdit,, Menu, or other things, the background still exist in those tool. How can I make other too empty of background that I have created? Capture.jpg
Thanks, but now I found the solution and now a new trouble is I have a label that containing image and whenever I re-size the form I want the background and the label re-size together. Could you give me advises?
I apply itQt Code:
this->setStyleSheet("border-image: url(:/testLoadImage/C:/Users/kimkeang/Pictures/bc-black-ui.png)");To copy to clipboard, switch view to plain text mode
Is the label in a layout?
That's wrong because it also applies to child widgets. You need a selector (e.g. by id or by class) that will only pick the widget you want.I apply itQt Code:
this->setStyleSheet("border-image: url(:/testLoadImage/C:/Users/kimkeang/Pictures/bc-black-ui.png)");To copy to clipboard, switch view to plain text mode
My code is:
Qt Code:
#include "testloadimage.h" { ui.setupUi(this); this->setStyleSheet("border-image: url(:/testLoadImage/C:/Users/kimkeang/Pictures/bc-black-ui.png)"); ui.label->setPixmap(pix); ui.label->adjustSize(); resize(bac_image.width(), bac_image.height()); }To copy to clipboard, switch view to plain text mode
whenever I re-size the form, I need the background and the label re-size too.
Can you tell me more specific?
Last edited by chong_kimkeang; 10th October 2012 at 09:05.
This doesn't state whether you are using layouts or not. Looking at line #14 of your snippet, I'm assuming that not. So go back to Designer and apply a layout to your form.
use QFormLayout, QGridLayout or which layout? and If I use layout, I can re-size the label but the label will be swipe-able(to left or to right) because I will make it swipe-able. Which solution should I use?
Can I swipe the label if I use layout?
Not directly? what is not direct? only this two worlds I can do nothing. Can you kindly tell me or give me ways?
chong_kimkeang (11th October 2012)
You are very kind thank you very mcuh.![]()
Bookmarks