我给Label加了边框,现在是黑色的边框,请问怎么改为其它颜色。
源代码如下:
#include <QtGui>
int
main(int argc, char**argv)
{
QApplication app(argc,argv);
QMainWindow window;
window.resize(640,480);
QLabel L1(&window);
QLabel L2(&window);
L1.setGeometry(0,0,240,180);
L2.setGeometry(240,180,240,180);
QSize size(240,180);
L1.resize(size);
L2.resize(size);
L1.setScaledContents(true);
L2.setScaledContents(true);
QImage image1("D:\\20.jpg");
QImage image2("D:\\10.jpg");
L1.setPixmap(QPixmap::fromImage(image2));
L2.setPixmap(QPixmap::fromImage(image2));
L1.setLineWidth(10);
L1.setFrameShadow(QFrame::Plain);
L1.setFrameShape(QFrame::Box);
window.show();
return app.exec();
}