bool QDialogButtons::qt_invoke( int _id, QUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: handleClicked(); break;
    default:
	return QWidget::qt_invoke( _id, _o );
    }
    return TRUE;
}
Ejemplo n.º 2
0
ToolButton_Impl::ToolButton_Impl()
	: QToolButton(), WidgetInterface(), fFlat(false)
{
	setPopupMode(InstantPopup);
	setAutoRaise(true);
	
	connect(this, SIGNAL(clicked()), this, SLOT(handleClicked()), Qt::QueuedConnection);
	connect(this, SIGNAL(toggled(bool)), this, SLOT(handleToggled(bool)));
	connect(SL_QAPP(), SIGNAL(endDrag(QObject *)), this, SLOT(handleEndDrag(QObject *)));
}
Ejemplo n.º 3
0
Archivo: main.cpp Proyecto: najati/logo
int main(int argc, char **argv)
{
	QApplication app(argc, argv);

	QWidget window;

	QTextEdit editor;
	QFile mainFile("./main.rb");
	mainFile.open(QIODevice::ReadOnly | QIODevice::Text);
	editor.setPlainText(mainFile.readAll());

	Runner runner;

	MyPushButton helloButton(runner, "Run", editor);
	helloButton.resize(100, 30);
	MyPushButton::connect(&helloButton, SIGNAL (clicked()), &helloButton, SLOT (handleClicked()));

	QPushButton stopButton("Stop");
	stopButton.resize(100, 30);
	QPushButton::connect(&stopButton, SIGNAL (clicked()), &runner, SLOT (Stop()));

	QHBoxLayout mainLayout;

	QVBoxLayout editorLayout;
	editorLayout.addWidget(&editor);
	editorLayout.addWidget(&helloButton);
	editorLayout.addWidget(&stopButton);

	QGraphicsScene scene(0, 0, 600, 600);

	Drawing::Init(&scene);

	QGraphicsView sceneView(&scene);
	sceneView.setMinimumSize(610, 610);

	mainLayout.addLayout(&editorLayout);
	mainLayout.addWidget(&sceneView);

	window.setLayout(&mainLayout);
	window.show();

	return app.exec();
}
ServiceMessagesPage::ServiceMessagesPage(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::ServiceMessagesPage),
    clientModel(0),
    walletModel(0)
{
    ui->setupUi(this);

    connect(ui->tableServiceMessagesView, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(handleClicked(QModelIndex)));

    QColor foreground(qRgb(48,134,196));
    QStandardItemModel* model = new QStandardItemModel(2, 2, this);

    for (int i = 0; i < 0; ++i)
    {
        QStandardItem* item = new QStandardItem(trUtf8("17:56, 01.03.2012"));
        item->setForeground(foreground);
        model->setItem(i, 0, item);

        item = new QStandardItem(QString::fromUtf8(
                                     i == 0 ?
                                         "":
                                         ""));
        item->setForeground(foreground);
        model->setItem(i, 1, item);
    }

    ui->tableServiceMessagesView->setModel(model);
    ui->tableServiceMessagesView->setColumnWidth(0, 120);
    ui->tableServiceMessagesView->horizontalHeader()->setStretchLastSection(true);
    ui->tableServiceMessagesView->resizeRowsToContents();
}
Ejemplo n.º 5
0
QWidget *
QDialogButtons::createButton(Button b)
{
    QPushButton *ret = new QPushButton(this, "qdialog_button");
    QObject::connect(ret, SIGNAL(clicked()), this, SLOT(handleClicked()));
    if(d->text.contains(b)) {
	ret->setText(d->text[b]);
    } else {
	switch(b) {
	case All: {
	    QString txt = buttonText(defaultButton());
	    if(txt.isNull()) {
		if(defaultButton() == Accept) {
		    if(questionMode())
			txt = tr("Yes to All");
		    else
		        txt = tr("OK to All");
		} else {
		    if(questionMode())
		        txt = tr("No to All");
		    else
			txt = tr("Cancel All");
		}
	    } else {
		txt += tr(" to All"); //ick, I can't really do this!!
	    }
	    ret->setText(txt);
	    break; }
	case Accept:
	    if(questionMode())
		ret->setText(tr("Yes"));
	    else
		ret->setText(tr("OK"));
	    break;
	case Reject:
	    if(questionMode())
		ret->setText(tr("No"));
	    else
		ret->setText(tr("Cancel"));
	    break;
	case Apply:
	    ret->setText(tr("Apply"));
	    break;
	case Ignore:
	    ret->setText(tr("Ignore"));
	    break;
	case Retry:
	    ret->setText(tr("Retry"));
	    break;
	case Abort:
	    ret->setText(tr("Abort"));
	    break;
	case Help:
	    ret->setText(tr("Help"));
	    break;
	default:
	    break;
	}
    }
    return ret;
}