本文整理汇总了C++中pal函数的典型用法代码示例。如果您正苦于以下问题:C++ pal函数的具体用法?C++ pal怎么用?C++ pal使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pal函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: pal
void tst_QGLRender::values()
{
QGLSceneNode node; // by default has QGL::FlatColor
QGLSceneNode node2;
QSharedPointer<QGLMaterialCollection> pal(new QGLMaterialCollection());
node.setPalette(pal);
node2.setPalette(pal);
node2.setEffect(QGL::LitMaterial);
QGLRenderState s;
QGLRenderOrder order(&node, s);
QGLRenderOrder other(&node2, s);
QGLRenderOrderComparator cmp;
QVERIFY(!cmp.isEqualTo(other, order));
QVERIFY(cmp.isLessThan(order, other));
QGLRenderState state;
QGLMaterial *mat = new QGLMaterial;
mat->setAmbientColor(Qt::blue);
int ix = pal->addMaterial(mat);
QGLSceneNode node3;
node3.setPalette(pal);
node3.setMaterialIndex(ix);
node3.setEffect(QGL::LitMaterial);
state.updateFrom(&node3);
QGLRenderOrder other2(&node, state);
QVERIFY(other2.effectiveHasEffect());
QCOMPARE(other2.effectiveMaterial(), mat);
QCOMPARE(other2.effectiveStandardEffect(), QGL::LitMaterial);
QCOMPARE(other2.effectiveUserEffect(), (QGLAbstractEffect*)0);
QVERIFY(cmp.isLessThan(order, other2));
QVERIFY(cmp.isLessThan(other, other2));
}
示例2: p
void KexiDBLabel::paintEvent(QPaintEvent* e)
{
QPainter p(this);
KexiDBTextWidgetInterface::paint(this, &p, text().isEmpty(), alignment(), false);
p.end();
QPalette origPal;
if (editingMode()) {
origPal = palette();
QPalette pal(palette());
pal.setBrush(QPalette::WindowText, Qt::transparent);
setPalette(pal);
}
QLabel::paintEvent(e);
if (editingMode()) {
setPalette(origPal);
}
const bool hasFrame = frameWidth() >= 1 && frameShape() != QFrame::NoFrame;
if (designMode() && !hasFrame) {
p.begin(this);
KFormDesigner::paintWidgetFrame(p, rect());
p.end();
}
}
示例3: pal
void ToyPedalWidget::SetTextColor(const QColor &textColor)
{
ToyWidget::SetTextColor(textColor);
QPalette pal( m_Widget->palette() );
pal.setColor(QPalette::ButtonText, m_TextColor);
m_Widget->setPalette(pal);
}
示例4: GTK_COLOR_SELECTION
void wxColourDialog::ColourDataToDialog()
{
GtkColorSelection* sel = GTK_COLOR_SELECTION(
gtk_color_selection_dialog_get_color_selection(
GTK_COLOR_SELECTION_DIALOG(m_widget)));
const wxColour& color = m_data.GetColour();
if (color.IsOk())
{
#ifdef __WXGTK3__
gtk_color_selection_set_current_rgba(sel, color);
#else
gtk_color_selection_set_current_color(sel, color.GetColor());
#endif
}
// setup the palette:
GdkColor colors[wxColourData::NUM_CUSTOM];
gint n_colors = 0;
for (unsigned i = 0; i < WXSIZEOF(colors); i++)
{
wxColour c = m_data.GetCustomColour(i);
if (c.IsOk())
{
colors[n_colors] = *c.GetColor();
n_colors++;
}
}
wxGtkString pal(gtk_color_selection_palette_to_string(colors, n_colors));
GtkSettings *settings = gtk_widget_get_settings(GTK_WIDGET(sel));
g_object_set(settings, "gtk-color-palette", pal.c_str(), NULL);
}
示例5: main
int main()
{
char s[100001];
scanf("%s",s);
pal(s);
return 0;
}
示例6: drawColor
void drawColor(QPainter *p, int x, int y, int r, QColor* c)
{
QColor w("white");
QPalette pal(*c);
QPen oldPen = p->pen();
QBrush oldBrush = p->brush();
p->setBrush(pal.color( QPalette::Active, QPalette::Dark ));
p->setPen(pal.color( QPalette::Active, QPalette::Dark ));
p->drawEllipse( x-r - 10,y-r +5, 2*r,2*r);
p->setBrush(pal.color( QPalette::Active, QPalette::Mid ));
p->setPen(pal.color( QPalette::Active, QPalette::Mid ));
p->drawEllipse( x-r,y-r, 2*r,2*r);
p->setBrush(pal.color( QPalette::Active, QPalette::Light ));
p->setPen(pal.color( QPalette::Active, QPalette::Light ));
p->drawEllipse( x-r/3, y-r/3, 4*r/3,4*r/3);
p->setBrush(w);
p->setPen(w);
p->drawEllipse( x+r/3, y+r/3, r/3,r/3);
p->setPen(oldPen);
p->setBrush(oldBrush);
}
示例7: pal
void KexiRelationViewTableContainerHeader::unsetFocus()
{
QPalette pal(palette());
pal.setColor(QPalette::Window, m_inactiveBG);
pal.setColor(QPalette::WindowText, m_inactiveFG);
setPalette(pal);
}
示例8: main
int main()
{
while ( gets(input) )
{
printf("%s", input);
if ( pal() && mir() )
puts(" -- is a mirrored palindrome.\n");
else if ( pal() )
puts(" -- is a regular palindrome.\n");
else if ( mir() )
puts(" -- is a mirrored string.\n");
else
puts(" -- is not a palindrome.\n");
}
return 0;
}
示例9: main
void main()
{
char s[100];
scanf("%s",s);
printf("%d \n",pal(s));
}
示例10: pal
char pal(int a, int b){
if(a > b) return 1;
if(matrix[a][b] == -1){
if(str[a] == str[b] && pal(a+1, b-1)) return (matrix[a][b] = 1);
return (matrix[a][b] = 0);
}
return matrix[a][b];
}
示例11: pal
void ToyLabelWidget::SetColor(const QColor &color)
{
ToyWidget::SetColor(color);
QPalette pal( m_Widget->palette() );
pal.setColor(QPalette::Window, m_Color);
m_Widget->setPalette(pal);
}
示例12: QScrollArea
KexiDBSubForm::KexiDBSubForm(KFormDesigner::Form *parentForm, QWidget *parent)
: QScrollArea(parent), m_parentForm(parentForm), m_form(0), m_widget(0)
{
setFrameStyle(QFrame::WinPanel | QFrame::Sunken);
QPalette pal(viewport()->palette());
pal.setBrush(viewport()->backgroundRole(), pal.brush(QPalette::Mid));
viewport()->setPalette(pal);
}
示例13: main
void main(){
char a[100];
printf("enter the string:");
gets(a);
pal(a);
getch();
}
示例14: pal
void MainWindowEx::resizeEvent(QResizeEvent *event)
{
if( m_backgroundCover.isNull() ) return;
QPixmap temp = m_backgroundCover.copy(m_backgroundCover.rect());
QPalette pal(palette());
pal.setBrush(QPalette::Window,QBrush(temp.scaled(event->size())));
setPalette(pal);
}
示例15: pal
void CameraView::initView(QWidget *view)
{
QPalette pal(palette());
pal.setColor(QPalette::Background, Qt::black);
view->setAutoFillBackground(true);
view->setMinimumSize(400, 400);
view->setPalette(pal);
view->show();
}