예제 #1
0
MainWindow::MainWindow(QWidget *parent)
    :QMainWindow(parent)
    ,ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    connect(ui->actionRestart_game, SIGNAL(triggered()), this, SLOT(restartGame()));
    connect(ui->actionShow_tip, SIGNAL(triggered()), this, SLOT(showTip()));
    connect(ui->actionStart_new_game, SIGNAL(triggered()), this, SLOT(startNewGame()));
    connect(ui->openGLWidget, SIGNAL(resizeParent(QSize)), this, SLOT(customResize(QSize)));
}
void SwitchMonitor::loadSwitchMonitors()
{
    getAllMonitors();

    if (m_ScreenList.length() > 1) {
        resizeParent();

        initMonitorItems();

        initScreenMode();
    } else {
        // if just 1 screen , quit the app immediately
        deleteOsd();
    }
}
void SwitchLayout::loadSwitchLayout()
{
    if (m_KeyboardList.length() > 1) {
        // give out the value of m_MaxTextWidth and m_KeyboradLayoutHeight, to help resize this app
        calculateKeyboardSize();

        resizeParent();

        initKeyboard();
    } else {
        qDebug() << "hide parent";
        // if user's keyboard layout(s) just contain(s) 1 kind, quit the app immediately
        hide();
        deleteOsd();
    }
}
예제 #4
0
void ResizeHandler::resize(QRectF newContents, QPointF newPos, bool needResizeParent) const
{
	newContents.moveTo(0, 0);

	sortChildrenIfNeeded();
	gripeIfMinimizesToChildrenContainer(newContents);

	if (!mTargetNode->isFolded()) {
		resizeAccordingToChildren(newContents, newPos);
	}
	normalizeSize(newContents);

	newContents.moveTo(newPos);

	mTargetNode->setGeometry(newContents);
	mTargetNode->storeGeometry();
	mTargetNode->setPos(newPos);

	if (needResizeParent) {
		resizeParent();
	}

	mTargetNode->updateLabels();
}