How to Change the Background Color of QWidget/fa: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
AutoSpider (talk | contribs) m (AutoSpider moved page How to Change the Background Color of QWidget Persian to How to Change the Background Color of QWidget/fa: Localisation) |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
{{Cleanup | reason=Auto-imported from ExpressionEngine.}} | |||
p{direction:rtl;text-align:right}. برای تغییر رنگ پس زمینه widget ها از کد زیر استفاده می کنیم. | p{direction:rtl;text-align:right}. برای تغییر رنگ پس زمینه widget ها از کد زیر استفاده می کنیم. | ||
Latest revision as of 16:00, 16 March 2015
This article may require cleanup to meet the Qt Wiki's quality standards. Reason: Auto-imported from ExpressionEngine. Please improve this article if you can. Remove the {{cleanup}} tag and add this page to Updated pages list after it's clean. |
p{direction:rtl;text-align:right}. برای تغییر رنگ پس زمینه widget ها از کد زیر استفاده می کنیم.
h1{direction:rtl;text-align:right}. استفاده از Palette
m_pMyWidget = new QWidget(this);
m_pMyWidget->setGeometry(0,0,300,100);
QPalette Pal(palette());
// set black background
Pal.setColor(QPalette::Background, Qt::black);
m_pMyWidget->setAutoFillBackground(true);
m_pMyWidget->setPalette(Pal);
m_pMyWidget->show();
h1{direction:rtl;text-align:right}. استفاده از Style Sheet
m_pMyWidget = new QWidget(this);
m_pMyWidget->setGeometry(0,0,300,100);
m_pMyWidget->setStyleSheet("background-color:black;");
m_pMyWidget->show();