-
Notifications
You must be signed in to change notification settings - Fork 19
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
9e6b018
commit 87a9f2f
Showing
46 changed files
with
579 additions
and
46 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#pragma once | ||
#include <QApplication> | ||
#include <QCheckBox> | ||
#include <QFrame> | ||
|
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#pragma once | ||
#include <QFrame> | ||
#include <QMainWindow> | ||
#include <QCheckBox> | ||
|
1 change: 1 addition & 0 deletions
1
Qt.Widgets/CommonControls/CheckedListWidget/src/CheckedListWidget.h
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#pragma once | ||
#include <QDebug> | ||
#include <QFrame> | ||
#include <QMainWindow> | ||
|
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#pragma once | ||
#include <QComboBox> | ||
#include <QFrame> | ||
#include <QMainWindow> | ||
|
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#pragma once | ||
#include <QFrame> | ||
#include <QLabel> | ||
#include <QMainWindow> | ||
|
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#pragma once | ||
#include <QFont> | ||
#include <QFrame> | ||
#include <QLCDNumber> | ||
|
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#pragma once | ||
#include <QFrame> | ||
#include <QMainWindow> | ||
#include <QLabel> | ||
|
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#pragma once | ||
#include <QFrame> | ||
#include <QMainWindow> | ||
#include <QLineEdit> | ||
|
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#pragma once | ||
#include <QFrame> | ||
#include <QLabel> | ||
#include <QMainWindow> | ||
|
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#pragma once | ||
#include <QFrame> | ||
#include <QGraphicsPixmapItem> | ||
#include <QGraphicsScene> | ||
|
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#pragma once | ||
#include <QFrame> | ||
#include <QMainWindow> | ||
#include <QProgressBar> | ||
|
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#pragma once | ||
#include <QFrame> | ||
#include <QLabel> | ||
#include <QMainWindow> | ||
|
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#pragma once | ||
#include <QFrame> | ||
#include <QMainWindow> | ||
#include <QRadioButton> | ||
|
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#pragma once | ||
#include <QFrame> | ||
#include <QLabel> | ||
#include <QMainWindow> | ||
|
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#pragma once | ||
#include <QFrame> | ||
#include <QLabel> | ||
#include <QMainWindow> | ||
|
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#pragma once | ||
#include <QFrame> | ||
#include <QLabel> | ||
#include <QMainWindow> | ||
|
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#pragma once | ||
#include <QFrame> | ||
#include <QMainWindow> | ||
#include <QPushButton> | ||
|
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#pragma once | ||
#include <QFrame> | ||
#include <QMainWindow> | ||
#include <QWidget> | ||
|
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#pragma once | ||
#include <QCursor> | ||
#include <QFrame> | ||
#include <QListWidget> | ||
|
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#pragma once | ||
#include <QFont> | ||
#include <QFrame> | ||
#include <QLabel> | ||
|
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#pragma once | ||
#include <QMainWindow> | ||
#include <QFrame> | ||
|
||
|
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#pragma once | ||
#include <QFrame> | ||
#include <QGroupBox> | ||
#include <QMainWindow> | ||
|
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#pragma once | ||
#include <QFrame> | ||
#include <QMainWindow> | ||
#include <QTabWidget> | ||
|
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#pragma once | ||
#include <QCloseEvent> | ||
#include <QFrame> | ||
#include <QMainWindow> | ||
|
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#pragma once | ||
#include <QColorDialog> | ||
#include <QFrame> | ||
#include <QMainWindow> | ||
|
1 change: 1 addition & 0 deletions
1
Qt.Widgets/Dialogs/FolderBrowserDialog/src/FolderBrowserDialog.h
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#pragma once | ||
#include <QFileDialog> | ||
#include <QMainWindow> | ||
#include <QDir> | ||
|
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#pragma once | ||
#include <QFontDialog> | ||
#include <QFrame> | ||
#include <QDebug> | ||
|
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#pragma once | ||
#include <QFrame> | ||
#include <QLabel> | ||
#include <QMainWindow> | ||
|
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#pragma once | ||
#include <QFileDialog> | ||
#include <QFrame> | ||
#include <QLabel> | ||
|
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#pragma once | ||
#include <QFileDialog> | ||
#include <QFrame> | ||
#include <QLabel> | ||
|
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
1 change: 1 addition & 0 deletions
1
Qt.Widgets/HelloWorld/HelloWorldMessageBox/src/HelloWorldMessageBox.h
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#pragma once | ||
#include <QFrame> | ||
#include <QMainWindow> | ||
#include <QMessageBox> | ||
|
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#pragma once | ||
#include <QFrame> | ||
#include <QMainWindow> | ||
#include <QStatusBar> | ||
|
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 |
---|---|---|
|
@@ -5,3 +5,4 @@ project(Others) | |
|
||
# Others | ||
add_subdirectory(LCDNumber2) | ||
add_subdirectory(Wiggly) |
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#pragma once | ||
#include <QMouseEvent> | ||
#include <QLCDNumber> | ||
#include <QFont> | ||
|
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
TEMPLATE = subdirs | ||
SUBDIRS = \ | ||
LCDNumber2 \ | ||
Wiggly | |
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,17 @@ | ||
cmake_minimum_required(VERSION 3.1) | ||
|
||
# Project | ||
project(Wiggly) | ||
find_package(Qt5Widgets CONFIG REQUIRED) | ||
|
||
# Options | ||
set(CMAKE_AUTOMOC ON) | ||
set(CMAKE_AUTORCC ON) | ||
set(CMAKE_AUTOUIC ON) | ||
set(CMAKE_CXX_STANDARD 17) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
|
||
# Application | ||
add_executable(Wiggly WIN32 MACOSX_BUNDLE src/Wiggly.cpp src/Wiggly.h) | ||
target_link_libraries(Wiggly Qt5::Widgets) | ||
|
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,4 @@ | ||
CONFIG += c++17 | ||
QT = widgets | ||
SOURCES = src/Wiggly.cpp | ||
HEADERS = src/Wiggly.h |
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 @@ | ||
#include <QApplication> | ||
#include "Wiggly.h" | ||
|
||
using namespace Examples; | ||
|
||
int main(int argc, char *argv[]) { | ||
QApplication application(argc, argv); | ||
Window1 window1; | ||
window1.show(); | ||
return application.exec(); | ||
} |
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,80 @@ | ||
#pragma once | ||
#include <QBasicTimer> | ||
#include <QFrame> | ||
#include <QLineEdit> | ||
#include <QMainWindow> | ||
#include <QPaintEvent> | ||
#include <QPainter> | ||
#include <QVBoxLayout> | ||
|
||
namespace Examples { | ||
class WigglyWidget : public QWidget { | ||
Q_OBJECT | ||
public: | ||
WigglyWidget(QWidget *parent = nullptr) : QWidget(parent) { | ||
setBackgroundRole(QPalette::Midlight); | ||
setAutoFillBackground(true); | ||
|
||
auto newFont = font(); | ||
newFont.setPointSize(newFont.pointSize() + 20); | ||
setFont(newFont); | ||
|
||
timer.start(60, this); | ||
} | ||
|
||
public slots: | ||
void setText(const QString &newText) {text = newText;} | ||
|
||
protected: | ||
void paintEvent(QPaintEvent *) override { | ||
static const std::vector sins = {0, 38, 71, 92, 100, 92, 71, 38, 0, -38, -71, -92, -100, -92, -71, -38}; | ||
QFontMetrics metrics(font()); | ||
auto pos = QPoint {(width() - metrics.horizontalAdvance(text)) / 2, (height() + metrics.ascent() - metrics.descent()) / 2}; | ||
QPainter painter(this); | ||
for (auto i = 0; i < text.size(); ++i) { | ||
auto index = (step + i) % sins.size(); | ||
painter.setPen(QColor::fromHsv(360.0f / sins.size() * index, 255, 191)); | ||
painter.drawText(pos - QPoint {0, (sins[index] * metrics.height()) / 400}, QString(text[i])); | ||
pos.setX(pos.x() + metrics.horizontalAdvance(text[i])); | ||
} | ||
} | ||
|
||
void timerEvent(QTimerEvent *event) override { | ||
if (event->timerId() == timer.timerId()) { | ||
++step; | ||
update(); | ||
} else | ||
QWidget::timerEvent(event); | ||
} | ||
|
||
private: | ||
QBasicTimer timer; | ||
QString text; | ||
int step = 0; | ||
}; | ||
|
||
class Window1 : public QMainWindow { | ||
Q_OBJECT | ||
public: | ||
Window1() { | ||
setCentralWidget(&frame); | ||
setWindowTitle("Wiggly"); | ||
resize(330, 130); | ||
connect(&lineEdit, &QLineEdit::textChanged, &wigglyWidget, &WigglyWidget::setText); | ||
|
||
wigglyWidget.setGeometry(20, 20, 290, 60); | ||
|
||
layout.addWidget(&wigglyWidget); | ||
layout.addWidget(&lineEdit); | ||
lineEdit.move(20, 90); | ||
lineEdit.setGeometry(20, 90, 290, lineEdit.height()); | ||
lineEdit.setText("Habemus papam"); | ||
} | ||
|
||
private: | ||
QFrame frame; | ||
QVBoxLayout layout {&frame}; | ||
WigglyWidget wigglyWidget; | ||
QLineEdit lineEdit; | ||
}; | ||
} |
Oops, something went wrong.