void SettingsFormDialog::build()
{
    mainLayout = new QVBoxLayout;
    topLayout = new QHBoxLayout;
    infobLabel = new QLabel(info,this);
    infobLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
    infobLabel->setWordWrap(true);
    QString backCol("white");
    QString textCol("black");
    infobLabel->setStyleSheet("QLabel {"
                              "background-color: " + backCol + ";"
                              "color: " + textCol + ";"
                              "border: 1px solid black;"
                              "padding: 4px;"
                              "font: bold 12pt;"
                              "}");
    buttonsLayout = new QVBoxLayout;
    okButton = new QPushButton("OK");
    cancelButton = new QPushButton("Cancel");
    connect(okButton, SIGNAL(clicked()), this, SLOT(checkBeforeAccept()));
    connect(cancelButton, SIGNAL(clicked()), this, SLOT(reject()));
    buttonsLayout->addWidget(okButton);
    buttonsLayout->addWidget(cancelButton);
    topLayout->addWidget(infobLabel);
    topLayout->addStretch();
    topLayout->addLayout(buttonsLayout);
    mainLayout->addLayout(topLayout);
    addExtraWidgets();
    setLayout(mainLayout);
    form->build();
    mainLayout->addWidget(form);
}
Exemple #2
0
/*!
  Reimplementation from QStyle
 */
void MetalStyle::polish( QApplication *app)
{
    oldPalette = app->palette();

    // we simply create a nice QColorGroup with a couple of fancy
    // pixmaps here and apply to it all widgets

    QFont f("times", app->font().pointSize() );
    f.setBold( TRUE );
    f.setItalic( TRUE );
    app->setFont( f, TRUE, "QMenuBar");
    app->setFont( f, TRUE, "QPopupMenu");



    //    QPixmap button( stonedark_xpm );

    QColor gold("#B9B9A5A54040"); //same as topgrad below
    QPixmap button( 1, 1 ); button.fill( gold );

    QPixmap background(marble_xpm);
    QPixmap dark( 1, 1 ); dark.fill( red.dark() );
    QPixmap mid( stone1_xpm );
    QPixmap light( stone1_xpm );//1, 1 ); light.fill( green );

    QPalette op = app->palette();

    QColor backCol( 227,227,227 );

    // QPalette op(white);
    QColorGroup active (op.active().foreground(),
		     QBrush(op.active().button(),button),
		     QBrush(op.active().light(), light),
		     QBrush(op.active().dark(), dark),
		     QBrush(op.active().mid(), mid),
		     op.active().text(),
		     Qt::white,
		     op.active().base(),//		     QColor(236,182,120),
		     QBrush(backCol, background)
		     );
    active.setColor( QColorGroup::ButtonText,  Qt::white  );
    active.setColor( QColorGroup::Shadow,  Qt::black  );
    QColorGroup disabled (op.disabled().foreground(),
		     QBrush(op.disabled().button(),button),
		     QBrush(op.disabled().light(), light),
		     op.disabled().dark(),
		     QBrush(op.disabled().mid(), mid),
		     op.disabled().text(),
		     Qt::white,
		     op.disabled().base(),//		     QColor(236,182,120),
		     QBrush(backCol, background)
		     );

    QPalette newPalette( active, disabled, active );
    app->setPalette( newPalette, TRUE );
}
void MouthView::paintEvent(QPaintEvent *event)
{
	PG_UNUSED(event);

	QString		phoneme;
	QImage		*img = NULL;
	QPainter	dc(this);

	if (fDoc && fDoc->fCurrentVoice)
		phoneme = fDoc->fCurrentVoice->GetPhonemeAtFrame(fFrame);
	else
		phoneme = "etc";
	if (phoneme.isEmpty() && fDoc)
		phoneme = fDoc->GetVolumePhonemeAtFrame(fFrame);

	img = fMouths[fMouthID].value(phoneme);
	if (img)
	{
		int32	x = 0, y = 0;
		int32	w = width();
		int32	h = height();
		QColor	backCol(255, 255, 255);
		if (w > h)
		{
			dc.fillRect(QRect(x, y, w, h), backCol);
			x = (w - h) / 2;
			w = h;
		}
		else if (h > w)
		{
			dc.fillRect(QRect(x, y, w, h), backCol);
			y = (h - w) / 2;
			h = w;
		}
		dc.drawImage(QRect(x, y, w, h), *img);
	}
	else
		dc.eraseRect(0, 0, width(), height());
}