Ejemplo n.º 1
0
void ZLApplicationWindow::init() {
	myApplication->myViewWidget = createViewWidget();

	initToolbar(WINDOW_TOOLBAR);
	initToolbar(FULLSCREEN_TOOLBAR);
	initMenu();
}
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow)
{    
    qRegisterMetaType<Packet>();

    ui->setupUi(this);

    _packetsReceivedCount = 0;
    _crcErrorCount = 0;
    _bytesSkippedCount = 0;

    _ioDevice = NULL;
    _logParser = NULL;
    _parserThread = new QThread();

    initToolbar();
    initStatusbar();

    _timestampMin = QDateTime::currentDateTime().toTime_t();
    _timestampMax = QDateTime::currentDateTime().toTime_t();

    ui->plotWidget->xAxis->setLabel("timestamp");
    ui->plotWidget->yAxis->setLabel("RSS [dBm]");
    ui->plotWidget->yAxis->setRange(-120, 0);
    ui->plotWidget->xAxis->setTickLabelType(QCPAxis::ltDateTime);
    ui->plotWidget->xAxis->setDateTimeFormat("hh:mm:ss:zzz");
    ui->plotWidget->xAxis->setTickLabelFont(QFont(QFont().family(), 8));
    ui->plotWidget->yAxis->setTickLabelFont(QFont(QFont().family(), 8));
    ui->plotWidget->legend->setVisible(true);
    ui->plotWidget->legend->setFont(QFont(QFont().family(), 8));
    ui->plotWidget->legend->setPositionStyle(QCPLegend::psBottomLeft);
}
Ejemplo n.º 3
0
void QWSMainWindow::init()
{
	initMenu();
	initToolbar();
	initStatusbar();
	createWidget();
}
Ejemplo n.º 4
0
bool P001::init()
{
    m_render = nullptr;
	m_test3dRotate = false;
    
	if ( !PBase::init() )
	{
		return false;
	}

	// 初始化场景Json
	initSceneJson("game/json/p001_welcome.json");

	// 初始化工具栏
	initToolbar();

	// 测试 骨骼动画
	testSkeleton();

	// 测试 3d
	testSprite3D();

	// 测试画笔
	testCanvas();
    
    // 测试模糊效果
    //testShader();

	// 测试2d图片3d旋转效果
	test3dRotate();
    
	return true;
}
bool QWinThumbnailToolBarPrivate::eventFilter(QObject *object, QEvent *event)
{
    if (object == window && event->type() == QWinEvent::TaskbarButtonCreated) {
        initToolbar();
        _q_scheduleUpdate();
    }
    return QObject::eventFilter(object, event);
}
Ejemplo n.º 6
0
void MainWindow::initialize(TraceModelPtr& model)
{
    model = restoreModel(model);//? trying to take settings from QSettings, but this is sooo bad
    initCanvas(model);
    // Restore window geometry
    QRect r = restoreGeometry();
    if (r.isValid())
    {
        setGeometry(r);
    }
    else
    {
        r = QApplication::desktop()->screenGeometry();
        resize(r.width(), r.height());
    }

    initToolbar();
    initSidebar();

    xinitialize(sidebarContents, canvas);

    toolbar->addActions(modeActions->actions());

    Q_ASSERT(browser);
    browser->addToolbarActions(toolbar);

    QAction* resetView = new QAction(this);
    resetView->setShortcut(Qt::Key_Escape);
    resetView->setShortcutContext(Qt::WindowShortcut);
    addAction(resetView);

    connect(resetView, SIGNAL(triggered(bool)), this,
                       SLOT(resetView()));

    toolbar->addSeparator();

    // Restore time unit and format
    QSettings settings;
    QString time_unit = settings.value("time_unit", Time::unit_name(0)).toString();
    for(int i = 0; i < Time::units().size(); ++i)
    {
        if (Time::unit_name(i) == time_unit)
        {
            Time::setUnit(i);
            break;
        }
    }
    if (settings.value("time_format", "separated") == "separated")
    {
        Time::setFormat(Time::Advanced);
    }

    // Adding freestanding tools
    foreach (QAction * action, freestandingTools)
    {
        toolbar->addAction(action);
    }
Ejemplo n.º 7
0
Common::Error CGE2Engine::loadGameState(int slot) {
	_commandHandler->clear();
	_commandHandlerTurbo->clear();
	sceneDown();
	if (!loadGame(slot))
		return Common::kReadingFailed;
	sceneUp(_now);
	initToolbar();
	return Common::kNoError;
}
Ejemplo n.º 8
0
FunctionManager::FunctionManager(QWidget* parent, Doc* doc)
    : QWidget(parent)
    , m_doc(doc)
    , m_hsplitter(NULL)
    , m_vsplitter(NULL)
    , m_tree(NULL)
    , m_toolbar(NULL)
    , m_addSceneAction(NULL)
    , m_addChaserAction(NULL)
    , m_addCollectionAction(NULL)
    , m_addEFXAction(NULL)
    , m_addRGBMatrixAction(NULL)
    , m_addScriptAction(NULL)
    , m_addAudioAction(NULL)
    , m_addVideoAction(NULL)
    , m_autostartAction(NULL)
    , m_wizardAction(NULL)
    , m_addFolderAction(NULL)
    , m_cloneAction(NULL)
    , m_deleteAction(NULL)
    , m_selectAllAction(NULL)
    , m_editor(NULL)
    , m_scene_editor(NULL)
{
    Q_ASSERT(s_instance == NULL);
    s_instance = this;

    Q_ASSERT(doc != NULL);

    new QVBoxLayout(this);
    layout()->setContentsMargins(0, 0, 0, 0);
    layout()->setSpacing(0);

    initActions();
    initToolbar();
    initSplitterView();
    updateActionStatus();

    connect(m_doc, SIGNAL(modeChanged(Doc::Mode)), this, SLOT(slotModeChanged()));
    m_tree->updateTree();

    connect(m_doc, SIGNAL(clearing()), this, SLOT(slotDocClearing()));
    connect(m_doc, SIGNAL(loaded()), this, SLOT(slotDocLoaded()));
    connect(m_doc, SIGNAL(functionNameChanged(quint32)), this, SLOT(slotFunctionNameChanged(quint32)));
    connect(m_doc, SIGNAL(functionAdded(quint32)), this, SLOT(slotFunctionAdded(quint32)));

    QSettings settings;
    QVariant var = settings.value(SETTINGS_SPLITTER);
    if (var.isValid() == true)
        m_hsplitter->restoreState(var.toByteArray());
    else
        m_hsplitter->setSizes(QList <int> () << int(this->width() / 2) << int(this->width() / 2));
}
Ejemplo n.º 9
0
FunctionManager::FunctionManager(QWidget* parent, Qt::WindowFlags flags)
	: QWidget(parent, flags)
{
	new QVBoxLayout(this);

	initActions();
	initMenu();
	initToolbar();

	initTree();
	updateActionStatus();

	/* Listen to document changes */
	connect(_app, SIGNAL(documentChanged(Doc*)),
		this, SLOT(slotDocumentChanged(Doc*)));
	/* Use the initial document */
	slotDocumentChanged(_app->doc());

	m_tree->sortItems(KColumnName, Qt::AscendingOrder);
}
Ejemplo n.º 10
0
void AssassinWar::initMainWin()
{
    setWindowFlags(Qt::FramelessWindowHint);

    initGameScreen();

    initToolbarManager();

    initGameSettingDlg();

    initJoinGameDlg();

    initToolbar();

    initRepainter();

    initBackground(BACKGROUND_IMG);

    showMainWin();
}
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow)
{    
    qRegisterMetaType<Packet>();

    ui->setupUi(this);

    _packetsReceivedCount = 0;
    _crcErrorCount = 0;
    _bytesSkippedCount = 0;

    _serialPortComboBox = new QComboBox(this);
    connect(_serialPortComboBox, SIGNAL(currentIndexChanged(int)), SLOT(onSerialPortSelected(int)));

    _serialPort = new SerialPort(this);
    _logParser = new LogParser(_serialPort);
    connect(_logParser, SIGNAL(logMessageReceived(QString)), SLOT(onLogMessageReceived(QString)));
    connect(_logParser, SIGNAL(packetParsed(Packet)), SLOT(onPacketParsed(Packet)));

    initToolbar();
    initStatusbar();

    QThread readerThread;
    _logParser->setParent(0);
    _logParser->moveToThread(&readerThread);
    readerThread.start();

    detectSerialPorts();

    ui->plotWidget->addGraph();
    ui->plotWidget->graph(0)->setScatterStyle(QCP::ssDisc);
    ui->plotWidget->graph(0)->setScatterSize(5);
    ui->plotWidget->xAxis->setLabel("timestamp");
    ui->plotWidget->yAxis->setLabel("RSS [dBm]");
    ui->plotWidget->yAxis->setRange(-120, 0);
    ui->plotWidget->xAxis->setTickLabelType(QCPAxis::ltDateTime);
    ui->plotWidget->xAxis->setDateTimeFormat("hh:mm:ss:zzz");
    ui->plotWidget->xAxis->setTickLabelFont(QFont(QFont().family(), 8));
    ui->plotWidget->yAxis->setTickLabelFont(QFont(QFont().family(), 8));
}
Ejemplo n.º 12
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    //QDesktopServices::openUrl(QUrl("file:///C:/Documents and Settings/All Users/Desktop", QUrl::TolerantMode));
    ui->setupUi( this);
    //ui->listWidget->setCurrentRow(0);
    //ui->listWidget_2->setCurrentRow(0);

    wordList << "title:"<<"author:"<<"keyword:"<<"tag:"<<"note:";
    initToolbar();

    initMainArea();
    initIcons();

    initTabWidget();

    initTheDownLeftCorner();
    initTheUpLeftCorner();
    initSignalsAndSlots();
    initContextMenu();
    ui->listWidget->setCurrentRow(0);
    ui->listWidget_2->setCurrentRow(0);
}
Ejemplo n.º 13
0
void ZLApplicationWindow::init() {
	myApplication->myViewWidget = createViewWidget();

	initToolbar();
	initMenu();
}