@@ -16,16 +16,16 @@ QT_BEGIN_NAMESPACE
1616
1717class Ui_UnitSelector {
1818public:
19+ QDialog *self;
1920 QDialogButtonBox *choiceSelect{};
2021 QListView *unit_list{};
2122 QCheckBox *choiceDefUnit;
2223
23- std::vector<GraphicalUnit> gpuList;
24-
2524 void setupUi (QDialog *UnitSelector) {
2625 if (UnitSelector->objectName ().isEmpty ())
2726 UnitSelector->setObjectName (" UnitSelector" );
2827 UnitSelector->resize (400 , 300 );
28+ self = UnitSelector;
2929 choiceSelect = new QDialogButtonBox (UnitSelector);
3030 choiceSelect->setObjectName (" choiceSelect" );
3131 choiceSelect->setGeometry (QRect (50 , 250 , 341 , 32 ));
@@ -40,22 +40,6 @@ class Ui_UnitSelector {
4040 choiceDefUnit->setGeometry (QRect (0 , 240 , 161 , 22 ));
4141
4242 retranslateUi (UnitSelector);
43- QObject::connect (choiceSelect, &QDialogButtonBox::accepted, UnitSelector, [&]() {
44- QModelIndex index = unit_list->currentIndex ();
45-
46- if (index.isValid ()) {
47- int gpuIndex = index.row ();
48- GraphicalUnit unit = gpuList.at (gpuIndex);
49- } else
50- QMessageBox::warning (UnitSelector, " GPU Selection" , " No valid GPU selected." );
51-
52- onItemSelect (true );
53- UnitSelector->accept ();
54- });
55- QObject::connect (choiceSelect, &QDialogButtonBox::rejected, UnitSelector, [&]() {
56- onItemSelect (false );
57- UnitSelector->reject ();
58- });
5943
6044 QMetaObject::connectSlotsByName (UnitSelector);
6145
@@ -69,8 +53,6 @@ class Ui_UnitSelector {
6953
7054 void performLogic () const ;
7155
72- void onItemSelect (bool accept) const ;
73-
7456};
7557
7658namespace Ui {
0 commit comments