コード例 #1
1
ファイル: mainwindow.cpp プロジェクト: thesmartwon/OpenChess
void MainWindow::createDockWindows()
{
	// Engine debug
	QDockWidget* engineDebugDock = new QDockWidget(tr("Engine Debug"), this);
	m_engineDebugLog = new PlainTextLog(engineDebugDock);
	connect(m_engineDebugLog, SIGNAL(saveLogToFileRequest()), this,
		SLOT(saveLogToFile()));
	engineDebugDock->setWidget(m_engineDebugLog);

	addDockWidget(Qt::BottomDockWidgetArea, engineDebugDock);

	// Move list
	QDockWidget* moveListDock = new QDockWidget(tr("Moves"), this);
	moveListDock->setWidget(m_moveList);

	addDockWidget(Qt::RightDockWidgetArea, moveListDock);

	// Tags
	QDockWidget* tagsDock = new QDockWidget(tr("Tags"), this);
	QTreeView* tagsView = new QTreeView(tagsDock);
	tagsView->setModel(m_tagsModel);
	tagsView->setAlternatingRowColors(true);
	tagsView->setRootIsDecorated(false);
	tagsDock->setWidget(tagsView);

	addDockWidget(Qt::RightDockWidgetArea, tagsDock);

	tabifyDockWidget(moveListDock, tagsDock);
	moveListDock->raise();

	// Add toggle view actions to the View menu
	m_viewMenu->addAction(moveListDock->toggleViewAction());
	m_viewMenu->addAction(tagsDock->toggleViewAction());
	m_viewMenu->addAction(engineDebugDock->toggleViewAction());
}
コード例 #2
0
ファイル: gameprocess.cpp プロジェクト: Parz1val/Launchpad
GameProcess::GameProcess(ConfigParser* config, QWidget *parent) :
    QDialog(parent),
    ui(new Ui::GameProcess) {
    ui->setupUi(this);

    process = NULL;
    configParser = config;
    connect(ui->pushButton_config, SIGNAL(clicked()), this, SLOT(dumpConfigValues()));
    connect(ui->pushButton_kill, SIGNAL(clicked()), this, SLOT(killProcess()));
    connect(ui->pushButton_save, SIGNAL(clicked()), this, SLOT(saveLogToFile()));
    connect(ui->pushButton_clean, SIGNAL(clicked()), this, SLOT(clearOutputLogScreen()));
}
コード例 #3
0
LogDock::~LogDock()
{
    if (timerId) {
        killTimer(timerId);
        timerId = 0;
    };
    settings.beginGroup("LogDock");
    settings.setValue("LogSize", currLogSize);
    settings.setValue("AutoSave", autoSaveLog->isChecked());
    settings.endGroup();
    settings.sync();
    if ( autoSaveLog->isChecked() ) saveLogToFile();
}
コード例 #4
0
ファイル: log_dock.cpp プロジェクト: spthaolt/qt-virt-manager
/* public slots */
void LogDock::appendMsgToLog(QString &msg)
{
    Log->append(msg);
    Log->setToolTip(
                QString("Event/Error Log\nMaxSize:\t%1 Bytes\nCurrent:\t%2")
                .arg(currLogSize * ONE_MB)
                .arg(Log->toPlainText().count()));
    if ( Log->toPlainText().count()>currLogSize * ONE_MB ) {
        if ( autoSaveLog->isChecked() ) {
            saveLogToFile();
        } else {
            emit overflow(true);
        };
    };
}
コード例 #5
0
void LogDock::_saveLogToFile()
{
    lastProbe = true;
    saveLogToFile();
}