Example #1
0
void MainWindow::toggledFullScreen(bool val) {
	QMenuBar* pMenuBar = menuBar();
	if ( pMenuBar )
		pMenuBar->setVisible(!val);

	QStatusBar *pStatusBar = statusBar();
	if ( pStatusBar )
		pStatusBar->setVisible(!val);
}
Example #2
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow),
    pSettings_(NULL),
    redValue_(0),
    greenValue_(0),
    blueValue_(0),
    pRedLabel_(NULL),
    pGreenLabel_(NULL),
    pBlueLabel_(NULL),
    pRedValueLabel_(NULL),
    pGreenValueLabel_(NULL),
    pBlueValueLabel_(NULL),
    pRedSlider_(NULL),
    pGreenSlider_(NULL),
    pBlueSlider_(NULL)
{
    ui->setupUi(this);

    QString settingsFilePath = QDir::homePath() + "/.colorsrc";
    pSettings_ = new QSettings(settingsFilePath, QSettings::NativeFormat, this);

    redValue_ = static_cast<uint8_t>(pSettings_->value(redValueKey).toInt());
    greenValue_ = static_cast<uint8_t>(pSettings_->value(greenValueKey).toInt());
    blueValue_ = static_cast<uint8_t>(pSettings_->value(blueValueKey).toInt());

    // hides all main window normal GUI related stuff
    QObjectList childObjects = children();
    foreach (QObject* pChildObject, childObjects) {
        QToolBar* pToolBar = qobject_cast<QToolBar*>(pChildObject);
        if (pToolBar)
            pToolBar->setVisible(false);

        QStatusBar* pStatusBar = qobject_cast<QStatusBar*>(pChildObject);
        if (pStatusBar)
            pStatusBar->setVisible(false);

        QMenuBar* pMenuBar = qobject_cast<QMenuBar*>(pChildObject);
        if (pMenuBar)
            pMenuBar->setVisible(false);
    }