QT program

I made a chashier program and now i want to do it with qt program.
1.How can i make dynamic folders(buttons) which i can open them just if there is saved data(made a payment), and for example if there isnt a folder(button) of the year that the payment has been done to create one, if there isnt create a folder of month to create one and if there isnt created a folder of day to create and the titles of these folders should be for example for year just "2016" for month just "January" for folder day to be just "13".
https://imgur.com/MgjPZi6
2.And anyone any idea how to add a product and with just the barcode written to output the whole name and price of product
3.Anyone any idea how to make a search bar to appear the product names?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include <iostream>
#include <string>
#include <iomanip>
#include <ctime>
using namespace std;
int main()
{
    time_t t = time(NULL);
	tm* timePtr = localtime(&t);
    int i=1, x=1, id;
    int folderyear, foldermonth, folderday;
    float   quantity, price, total=0, sum;
    string name;
    char enter, tick;
    cout << "#" << " ID " << "Name" << " Quantity " << "Price" << " Total" << endl;
    do{
    cin >> id;
    cin >> name;
    cin >> quantity;
    cin >> price;
    cout <<"#" << x++ << " " << id << " " << name << " " << fixed << setprecision(2)
    << fixed << quantity << " " << fixed << setprecision(2)<< price << " " << fixed
    << setprecision(2) << quantity*price << endl;
    sum=quantity*price;
    total+=sum;
    cin >> tick;
    if(tick == 'enter'){cout << "                      " << total << endl;
    cout << timePtr->tm_mday << "." << timePtr->tm_mon + 1 << "." << timePtr->tm_year + 1900 << " // " << timePtr->tm_hour << ":" << timePtr->tm_min << ":" << timePtr->tm_sec << endl;
    }}while(tick == 'do');

    if(timePtr->tm_year +1900 == folderyear){
            if(timePtr->tm_mon == foldermonth)
                    if(timePtr->tm_mday == folderday){

                    }
                    else create folderday // and save here the payment

            }
            else if(timePtr->tm_mon != foldermonth){
                    create foldermonth, krijofolderday
            }
    }
    else if(timePtr->tm_year + 1900 != folderyear){
        create folderyear, foldermonth, folderday// and save here the payment
    }
    return 0;
}
Last edited on
Topic archived. No new replies allowed.