-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
46c4ec8
commit 1a293ad
Showing
14 changed files
with
113 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#include "cpu_settings.hpp" | ||
|
||
#include <QGridLayout> | ||
#include <QGroupBox> | ||
#include <QLabel> | ||
#include <QSlider> | ||
|
||
CpuSettings::CpuSettings(QWidget *parent) : | ||
QWidget(parent) | ||
{ | ||
auto layout = new QGridLayout(); | ||
|
||
layout->addWidget(buildCount(), 0, 0); | ||
layout->setRowStretch(1, 1); | ||
|
||
setLayout(layout); | ||
} | ||
|
||
CpuSettings::~CpuSettings() | ||
{ | ||
} | ||
|
||
QWidget *CpuSettings::buildCount() | ||
{ | ||
auto group = new QGroupBox("Count"); | ||
auto layout = new QGridLayout(); | ||
|
||
// Slider. | ||
auto slider = new QSlider(Qt::Horizontal); | ||
|
||
slider->setTickInterval(1); | ||
slider->setTickPosition(QSlider::TicksAbove); | ||
slider->setRange(1, 16); | ||
slider->setValue(8); | ||
|
||
layout->addWidget(slider, 0, 0); | ||
|
||
// Value. | ||
auto value = new QLabel("8"); | ||
|
||
connect(slider, &QAbstractSlider::valueChanged, value, qOverload<int>(&QLabel::setNum)); | ||
|
||
layout->addWidget(value, 0, 1); | ||
|
||
// Description. | ||
auto desc = new QLabel("Changing this value to other than 8 may crash the game."); | ||
|
||
desc->setWordWrap(true); | ||
|
||
layout->addWidget(desc, 1, 0, 1, -1); | ||
|
||
group->setLayout(layout); | ||
|
||
return group; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#pragma once | ||
|
||
#include <QWidget> | ||
|
||
class CpuSettings final : public QWidget { | ||
public: | ||
CpuSettings(QWidget *parent = nullptr); | ||
~CpuSettings() override; | ||
private: | ||
QWidget *buildCount(); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.