#include "mainwindow.h"
#include "pitime.h"
#include "qad_types.h"

#include <QApplication>
#include <QDebug>
#include <QScrollArea>
#include <QTimer>
#include <iconedlabel.h>

int main(int argc, char * argv[]) {
	QApplication a(argc, argv);
	enableHighDPI();
	/*struct {
		QStyle::StandardPixmap v;
		const char * n;
	} list[] = {
		{QStyle::SP_TitleBarMenuButton,               "TitleBarMenuButton,              "},
		{QStyle::SP_TitleBarMinButton,                "TitleBarMinButton,               "},
		{QStyle::SP_TitleBarMaxButton,                "TitleBarMaxButton,               "},
		{QStyle::SP_TitleBarCloseButton,              "TitleBarCloseButton,             "},
		{QStyle::SP_TitleBarNormalButton,             "TitleBarNormalButton,            "},
		{QStyle::SP_TitleBarShadeButton,              "TitleBarShadeButton,             "},
		{QStyle::SP_TitleBarUnshadeButton,            "TitleBarUnshadeButton,           "},
		{QStyle::SP_TitleBarContextHelpButton,        "TitleBarContextHelpButton,       "},
		{QStyle::SP_DockWidgetCloseButton,            "DockWidgetCloseButton,           "},
		{QStyle::SP_MessageBoxInformation,            "MessageBoxInformation,           "},
		{QStyle::SP_MessageBoxWarning,                "MessageBoxWarning,               "},
		{QStyle::SP_MessageBoxCritical,               "MessageBoxCritical,              "},
		{QStyle::SP_MessageBoxQuestion,               "MessageBoxQuestion,              "},
		{QStyle::SP_DesktopIcon,                      "DesktopIcon,                     "},
		{QStyle::SP_TrashIcon,                        "TrashIcon,                       "},
		{QStyle::SP_ComputerIcon,                     "ComputerIcon,                    "},
		{QStyle::SP_DriveFDIcon,                      "DriveFDIcon,                     "},
		{QStyle::SP_DriveHDIcon,                      "DriveHDIcon,                     "},
		{QStyle::SP_DriveCDIcon,                      "DriveCDIcon,                     "},
		{QStyle::SP_DriveDVDIcon,                     "DriveDVDIcon,                    "},
		{QStyle::SP_DriveNetIcon,                     "DriveNetIcon,                    "},
		{QStyle::SP_DirOpenIcon,                      "DirOpenIcon,                     "},
		{QStyle::SP_DirClosedIcon,                    "DirClosedIcon,                   "},
		{QStyle::SP_DirLinkIcon,                      "DirLinkIcon,                     "},
		{QStyle::SP_DirLinkOpenIcon,                  "DirLinkOpenIcon,                 "},
		{QStyle::SP_FileIcon,                         "FileIcon,                        "},
		{QStyle::SP_FileLinkIcon,                     "FileLinkIcon,                    "},
		{QStyle::SP_ToolBarHorizontalExtensionButton, "ToolBarHorizontalExtensionButton,"},
		{QStyle::SP_ToolBarVerticalExtensionButton,   "ToolBarVerticalExtensionButton,  "},
		{QStyle::SP_FileDialogStart,                  "FileDialogStart,                 "},
		{QStyle::SP_FileDialogEnd,                    "FileDialogEnd,                   "},
		{QStyle::SP_FileDialogToParent,               "FileDialogToParent,              "},
		{QStyle::SP_FileDialogNewFolder,              "FileDialogNewFolder,             "},
		{QStyle::SP_FileDialogDetailedView,           "FileDialogDetailedView,          "},
		{QStyle::SP_FileDialogInfoView,               "FileDialogInfoView,              "},
		{QStyle::SP_FileDialogContentsView,           "FileDialogContentsView,          "},
		{QStyle::SP_FileDialogListView,               "FileDialogListView,              "},
		{QStyle::SP_FileDialogBack,                   "FileDialogBack,                  "},
		{QStyle::SP_DirIcon,                          "DirIcon,                         "},
		{QStyle::SP_DialogOkButton,                   "DialogOkButton,                  "},
		{QStyle::SP_DialogCancelButton,               "DialogCancelButton,              "},
		{QStyle::SP_DialogHelpButton,                 "DialogHelpButton,                "},
		{QStyle::SP_DialogOpenButton,                 "DialogOpenButton,                "},
		{QStyle::SP_DialogSaveButton,                 "DialogSaveButton,                "},
		{QStyle::SP_DialogCloseButton,                "DialogCloseButton,               "},
		{QStyle::SP_DialogApplyButton,                "DialogApplyButton,               "},
		{QStyle::SP_DialogResetButton,                "DialogResetButton,               "},
		{QStyle::SP_DialogDiscardButton,              "DialogDiscardButton,             "},
		{QStyle::SP_DialogYesButton,                  "DialogYesButton,                 "},
		{QStyle::SP_DialogNoButton,                   "DialogNoButton,                  "},
		{QStyle::SP_ArrowUp,                          "ArrowUp,                         "},
		{QStyle::SP_ArrowDown,                        "ArrowDown,                       "},
		{QStyle::SP_ArrowLeft,                        "ArrowLeft,                       "},
		{QStyle::SP_ArrowRight,                       "ArrowRight,                      "},
		{QStyle::SP_ArrowBack,                        "ArrowBack,                       "},
		{QStyle::SP_ArrowForward,                     "ArrowForward,                    "},
		{QStyle::SP_DirHomeIcon,                      "DirHomeIcon,                     "},
		{QStyle::SP_CommandLink,                      "CommandLink,                     "},
		{QStyle::SP_VistaShield,                      "VistaShield,                     "},
		{QStyle::SP_BrowserReload,                    "BrowserReload,                   "},
		{QStyle::SP_BrowserStop,                      "BrowserStop,                     "},
		{QStyle::SP_MediaPlay,                        "MediaPlay,                       "},
		{QStyle::SP_MediaStop,                        "MediaStop,                       "},
		{QStyle::SP_MediaPause,                       "MediaPause,                      "},
		{QStyle::SP_MediaSkipForward,                 "MediaSkipForward,                "},
		{QStyle::SP_MediaSkipBackward,                "MediaSkipBackward,               "},
		{QStyle::SP_MediaSeekForward,                 "MediaSeekForward,                "},
		{QStyle::SP_MediaSeekBackward,                "MediaSeekBackward,               "},
		{QStyle::SP_MediaVolume,                      "MediaVolume,                     "},
		{QStyle::SP_MediaVolumeMuted,                 "MediaVolumeMuted,                "},
		{QStyle::SP_LineEditClearButton,              "LineEditClearButton,             "},
		{QStyle::SP_DialogYesToAllButton,             "DialogYesToAllButton,            "},
		{QStyle::SP_DialogNoToAllButton,              "DialogNoToAllButton,             "},
		{QStyle::SP_DialogSaveAllButton,              "DialogSaveAllButton,             "},
		{QStyle::SP_DialogAbortButton,                "DialogAbortButton,               "},
		{QStyle::SP_DialogRetryButton,                "DialogRetryButton,               "},
		{QStyle::SP_DialogIgnoreButton,               "DialogIgnoreButton,              "},
		{QStyle::SP_RestoreDefaultsButton,            "RestoreDefaultsButton,           "},
		{QStyle::SP_CustomBase,                       nullptr                            }
	};
	QScrollArea area;
	auto * lay = new QBoxLayout(QBoxLayout::TopToBottom);
	area.setWidget(new QWidget());
	area.widget()->setLayout(lay);
	QTimer::singleShot(500, [lay, list] {
		auto * s = qApp->style();
		for (int i = 0;; ++i) {
			if (!list[i].n) break;
			auto * r = new IconedLabel();
			r->setIcon(s->standardIcon(list[i].v));
			r->setText(list[i].n);
			lay->addWidget(r);
			r->show();
		}
	});
	area.setWidgetResizable(true);
	area.show();
*/
	MainWindow w;
	w.show();
	return a.exec();
}
