Skip to content

Instantly share code, notes, and snippets.

@bigworld12
bigworld12 / Qt Tutorial.md
Last active January 7, 2024 00:09
installing Qt Creator using msys2 on windows

Qt is an open-source cross-platform gui library written in c++ you can install Qt using their online installer, or by downloading it as a package via msys2 (how to install msys2) The official IDE for developing Qt apps is Qt-Creator which is available for installation via msys2 package manager using the command (note that this also installs clang)

pacman -S mingw-w64-x86_64-clang mingw-w64-i686-clang
pacman -S mingw-w64-x86_64-qt-creator mingw-w64-i686-qt-creator

now you have Qt binaries installed, but since you didn't install them using a windows installer you won't get shortcuts added to desktop nor to start menu, you can find the binaries at c:\dev\msys64\mingw64\bin Qt exes are

static void Main(string[] args)
{
int num = int.Parse(Console.ReadLine());
Console.WriteLine(deciToBinary(num));
Console.ReadKey();
}
public static int deciToBinary(int num, int multiplier = 1)
{
if (num == 0)
class Program
{
static void Main(string[] args)
{
MyClass odd_c = new MyClass();
MyClass even_c = new MyClass();
while (true)
{
int user_input = int.Parse(Console.ReadLine());
if (user_input == 0)
class Program
{
static void Main(string[] args)
{
BankAccount ba = new BankAccount();
ba.deposit(50);
ba.withdraw(13);
ba.display();
Console.ReadKey();
public class BankAccount
{
double balance;
public BankAccount()
{
balance = 0;
}
public void deposit(double amount)
{
balance += amount;
private void BF4_Stats_Handler()
{
//edit custom stats
BF4_Stats["player"]["id"] = CurrentPlayerID;
BF4_Stats["player"]["name"] = CurrentPlayerName;
BF4_Stats["player"]["last_update_date"] = DateTime.Now;
//rank
long score = BF4_Stats["player"]["score"].ToObject<long>();
var todoRankObject = (JObject)BF4_Stats["player"]["rank"];
namespace Matrices
{
public class Matrix
{
#region Constructors And Creators
/// <summary>
/// separate rows by new lines or semi-colons (;)
/// and separate columns by spaces or commas (,)
/// </summary>
static void Reverse(int[] arr)
{
int[] buffer = new int[arr.Length];
for (int i = 0; i < arr.Length; i++)
{
buffer[arr.Length - 1 - i] = arr[i];
}
for (int i = 0; i < arr.Length; i++)
{
static void Main(string[] args)
{
int num = int.Parse(Console.ReadLine());
int result = Reverse(num);
Console.WriteLine("Reversed Number : {0}",result);
Console.ReadKey();
}
static int Reverse(int n)
Console.WriteLine("Please enter lines count : ");
int lines = int.Parse(Console.ReadLine());
//line count = 5
//4 spaces, i = 1,last number = 1
//3 spaces, i = 2,last number = 3
//2 spaces, i = 3,last number = 5
//1 space, i = 4,last number = 7
//0 space, i = 5,last number = 9