Skip to content

Commit 1064c19

Browse files
committed
发布用
1 parent ce43631 commit 1064c19

File tree

2 files changed

+24
-193
lines changed

2 files changed

+24
-193
lines changed

mainwindow.cpp

Lines changed: 6 additions & 184 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,11 @@ void MainWindow::keyPressEvent(QKeyEvent *event)
241241
}
242242
}
243243

244+
void MainWindow::keyPressedDisplay(QLabel* label)
245+
{
246+
label->setStyleSheet("background-color: rgb(255, 153, 0);");
247+
}
248+
244249
void MainWindow::keyReleaseEvent(QKeyEvent *event)
245250
{
246251
int key = event->nativeScanCode(); //区分同样键位可用nativeScanCode,码是唯一的
@@ -254,195 +259,12 @@ void MainWindow::keyReleaseEvent(QKeyEvent *event)
254259
}
255260
}
256261

257-
//void MainWindow::DefaultColor()
258-
//{
259-
// ui->centralWidget->setStyleSheet("background-color: rgb(0, 102, 153);"); //背景色
260-
// ui->scrollAreaWidgetContents
261-
// ->setStyleSheet("border:none; border-radius:0px; background-color: rgb(0, 0, 0, 100); color: rgb(255, 255, 255);font-size:11px;");
262-
// ui->widget_Keyboard
263-
// ->setStyleSheet("QWidget#widget_Keyboard{ border:none; border-radius:8px; background-color:rgb(17,17,17,100);} "
264-
// "QLabel{ border:none; border-radius:5px; color: rgb(255, 255, 255); font-size:9px;}"); //键盘外壳色,字颜色
265-
266-
// QMapIterator<int, QLabel *> itA(m_mapKeysPartA);
267-
// QMapIterator<int, QLabel *> itB(m_mapKeysPartB);
268-
// while (itA.hasNext())
269-
// {
270-
// itA.next();
271-
// itA.value()->setStyleSheet("background-color: rgb(102, 204, 255);"); //A区颜色
272-
// }
273-
// while (itB.hasNext())
274-
// {
275-
// itB.next();
276-
// itB.value()->setStyleSheet("background-color: rgb(0, 120, 159);"); //B区颜色
277-
// }
278-
//}
279-
280-
281-
///**
282-
// * @brief GMK情人节
283-
// */
284-
//void MainWindow::Valentine()
285-
//{
286-
//// ui->centralWidget->setStyleSheet("background-color: rgb(191, 191, 185); font-size:9px;"); //背景色
287-
//// ui->widget_Keyboard->setStyleSheet("QWidget#widget_Keyboard{ border:none; border-radius:8px; background-color:rgb(233,233,228);} "
288-
//// "QLabel{ border:none; border-radius:5px; font-size:9px;}"); //键盘外壳色,字颜色
289-
//// for ( int i=0; i!=m_listKeysPartA.size(); ++i )
290-
//// {
291-
//// m_listKeysPartA.at(i)->setStyleSheet("background-color: rgb(254, 253, 248); color: rgb(219,66,147);"); //A区颜色
292-
//// }
293-
294-
//// for ( int i=0; i!=m_listKeysPartB.size(); ++i )
295-
//// {
296-
//// m_listKeysPartB.at(i)->setStyleSheet("background-color: rgb(219,66,147); color: rgb(254, 253, 248);"); //B区颜色
297-
//// }
298-
//}
299-
300-
301-
///**
302-
// * @brief GMK KA1953
303-
// */
304-
//void MainWindow::KA1953()
305-
//{
306-
//// ui->centralWidget->setStyleSheet("background-color: rgb(38, 38, 38); font-size:9px;"); //背景色
307-
//// ui->widget_Keyboard->setStyleSheet("QWidget#widget_Keyboard{ border:none; border-radius:8px; background-color:rgb(68,68,68);} "
308-
//// "QLabel{ border:none; border-radius:5px; color: rgb(5, 5, 5); font-size:9px;}"); //键盘外壳色,字颜色
309-
//// for ( int i=0; i!=m_listKeysPartA.size(); ++i )
310-
//// {
311-
//// m_listKeysPartA.at(i)->setStyleSheet("background-color: rgb(254, 253, 248);"); //A区颜色
312-
//// }
313-
314-
//// for ( int i=0; i!=m_listKeysPartB.size(); ++i )
315-
//// {
316-
//// m_listKeysPartB.at(i)->setStyleSheet("background-color: rgb(188, 185, 173);"); //B区颜色
317-
//// }
318-
319-
//}
320-
321-
///**
322-
// * @brief GMK大碳
323-
// */
324-
//void MainWindow::Carbon()
325-
//{
326-
//// ui->centralWidget->setStyleSheet("background-color: rgb(38, 38, 38); font-size:9px;"); //背景色
327-
//// ui->widget_Keyboard->setStyleSheet("QWidget#widget_Keyboard{ border:none; border-radius:8px; background-color:rgb(68,68,68);} "
328-
//// "QLabel{ border:none; border-radius:5px; color: rgb(87,93,94); font-size:9px;}"); //键盘外壳色,字颜色
329-
//// for ( int i=0; i!=m_listKeysPartA.size(); ++i )
330-
//// {
331-
//// m_listKeysPartA.at(i)->setStyleSheet("background-color: rgb(227,217,198); color:rgb(87,93,94);"); //A区颜色
332-
//// }
333-
334-
//// for ( int i=0; i!=m_listKeysPartB.size(); ++i )
335-
//// {
336-
//// m_listKeysPartB.at(i)->setStyleSheet("background-color: rgb(87,93,94); color:rgb(237,107,33);"); //B区颜色
337-
//// }
338-
339-
//// ui->label_esc->setStyleSheet("background-color: rgb(237,107,33); color: rgb(87,93,94);"); //Esc
340-
//// ui->label_f5->setStyleSheet("background-color: rgb(237,107,33); color: rgb(87,93,94);");
341-
//// ui->label_f6->setStyleSheet("background-color: rgb(237,107,33); color: rgb(87,93,94);");
342-
//// ui->label_f7->setStyleSheet("background-color: rgb(237,107,33); color: rgb(87,93,94);");
343-
//// ui->label_f8->setStyleSheet("background-color: rgb(237,107,33); color: rgb(87,93,94);");
344-
//// ui->label_prtsc->setStyleSheet("background-color: rgb(237,107,33); color: rgb(87,93,94);");
345-
//// ui->label_scrolllock->setStyleSheet("background-color: rgb(237,107,33); color: rgb(87,93,94);");
346-
//// ui->label_pausebreak->setStyleSheet("background-color: rgb(237,107,33); color: rgb(87,93,94);");
347-
//// ui->label_up->setStyleSheet("background-color: rgb(237,107,33); color: rgb(87,93,94);");
348-
//// ui->label_down->setStyleSheet("background-color: rgb(237,107,33); color: rgb(87,93,94);");
349-
//// ui->label_left->setStyleSheet("background-color: rgb(237,107,33); color: rgb(87,93,94);");
350-
//// ui->label_right->setStyleSheet("background-color: rgb(237,107,33); color: rgb(87,93,94);");
351-
//// ui->label_enterl->setStyleSheet("background-color: rgb(237,107,33); color: rgb(87,93,94);"); //Enterl
352-
//// ui->label_enterr->setStyleSheet("background-color: rgb(237,107,33); color: rgb(87,93,94);"); //Enterr
353-
354-
//}
355-
356-
///**
357-
// * @brief GMK9009
358-
// */
359-
//void MainWindow::GMK9009()
360-
//{
361-
//// ui->centralWidget->setStyleSheet("background-color: rgb(172, 172, 168); font-size:9px;"); //背景色
362-
//// ui->widget_Keyboard->setStyleSheet("QWidget#widget_Keyboard{ border:none; border-radius:8px; background-color:rgb(219,219,217);} "
363-
//// "QLabel{ border:none; border-radius:5px; color: rgb(5, 5, 5); font-size:9px;}"); //键盘外壳色,字颜色
364-
//// for ( int i=0; i!=m_listKeysPartA.size(); ++i )
365-
//// {
366-
//// m_listKeysPartA.at(i)->setStyleSheet("background-color: rgb(254, 253, 248);"); //A区颜色
367-
//// }
368-
369-
//// for ( int i=0; i!=m_listKeysPartB.size(); ++i )
370-
//// {
371-
//// m_listKeysPartB.at(i)->setStyleSheet("background-color: rgb(188, 185, 173);"); //B区颜色
372-
//// }
373-
374-
//// ui->label_esc->setStyleSheet("background-color: rgb(230, 187, 197); color: rgb(5, 5, 5);"); //Esc
375-
//// ui->label_ins->setStyleSheet("background-color: rgb(230, 187, 197); color: rgb(5, 5, 5);");
376-
//// ui->label_enterr->setStyleSheet("background-color: rgb(230, 187, 197); color: rgb(5, 5, 5);"); //Enterr
377-
//// ui->label_enterl->setStyleSheet("background-color: rgb(146, 173, 154); color: rgb(5, 5, 5);"); //Enterl
378-
379-
//}
380-
381-
///**
382-
// * @brief GMK死灵
383-
// */
384-
//void MainWindow::Necro()
385-
//{
386-
//// ui->centralWidget->setStyleSheet("background-color: rgb(95, 95, 95); font-size:9px;"); //背景色
387-
//// ui->widget_Keyboard->setStyleSheet("QWidget#widget_Keyboard{ border:none; border-radius:8px; background-color:rgb(68,68,68);} "
388-
//// "QLabel{ border:none; border-radius:5px; color: rgb(113,125,131); font-size:9px;}"); //键盘外壳色,字颜色
389-
//// for ( int i=0; i!=m_listKeysPartA.size(); ++i )
390-
//// {
391-
//// m_listKeysPartA.at(i)->setStyleSheet("background-color: rgb(230,244,220); color:rgb(113,125,131);"); //A区颜色
392-
//// }
393-
394-
//// for ( int i=0; i!=m_listKeysPartB.size(); ++i )
395-
//// {
396-
//// m_listKeysPartB.at(i)->setStyleSheet("background-color: rgb(113,125,131); color:rgb(147,208,210);"); //B区颜色
397-
//// }
398-
399-
//// ui->label_esc->setStyleSheet("background-color: rgb(147,208,210); color: rgb(37,51,72);"); //Esc
400-
//// ui->label_up->setStyleSheet("background-color: rgb(147,208,210); color: rgb(37,51,72);");
401-
//// ui->label_down->setStyleSheet("background-color: rgb(147,208,210); color: rgb(37,51,72);");
402-
//// ui->label_left->setStyleSheet("background-color: rgb(147,208,210); color: rgb(37,51,72);");
403-
//// ui->label_right->setStyleSheet("background-color: rgb(147,208,210); color: rgb(37,51,72);");
404-
//// ui->label_enterl->setStyleSheet("background-color: rgb(147,208,210); color: rgb(37,51,72);"); //Enterl
405-
//// ui->label_enterr->setStyleSheet("background-color: rgb(147,208,210); color: rgb(37,51,72);"); //Enterr
406-
//}
407-
408-
///**
409-
// * @brief GMK DMG
410-
// */
411-
//void MainWindow::DMG()
412-
//{
413-
//// ui->centralWidget->setStyleSheet("background-color: rgb(145, 145, 145);"); //背景色
414-
//// ui->widget_Keyboard->setStyleSheet("QWidget#widget_Keyboard{ border:none; border-radius:8px; background-color:rgb(215,211,210);} "
415-
//// "QLabel{ border:none; border-radius:5px; color: rgb(5, 5, 5); font-size:9px;}"); //键盘外壳色,字颜色
416-
//// for ( int i=0; i!=m_listKeysPartA.size(); ++i )
417-
//// {
418-
//// m_listKeysPartA.at(i)->setStyleSheet("background-color: rgb(245,245,249); color:rgb(108,60,157);"); //A区颜色
419-
//// }
420-
421-
//// for ( int i=0; i!=m_listKeysPartB.size(); ++i )
422-
//// {
423-
//// m_listKeysPartB.at(i)->setStyleSheet("background-color: rgb(150,153,155); color:rgb(108,60,157);"); //B区颜色
424-
//// }
425-
426-
//// ui->label_esc->setStyleSheet("background-color: rgb(219,66,147); color: rgb(245,245,249);"); //Esc
427-
//// ui->label_enterl->setStyleSheet("background-color: rgb(219,66,147); color: rgb(245,245,249);"); //Enterl
428-
//// ui->label_enterr->setStyleSheet("background-color: rgb(219,66,147); color: rgb(245,245,249);"); //Enterr
429-
//// ui->label_ins->setStyleSheet("background-color: rgb(219,66,147); color: rgb(245,245,249);");
430-
//// ui->label_home->setStyleSheet("background-color: rgb(219,66,147); color: rgb(245,245,249);");
431-
// // ui->label_pageup->setStyleSheet("background-color: rgb(219,66,147); color: rgb(245,245,249);");
432-
//}
433-
434-
435-
436-
void MainWindow::keyPressedDisplay(QLabel* label)
437-
{
438-
label->setStyleSheet("background-color: rgb(255, 153, 0);");
439-
}
440-
441262
void MainWindow::keyReleasedDisplay(QLabel *label)
442263
{
443264
label->setStyleSheet("background-color: rgb(200, 215, 227);");
444265
}
445266

267+
//键盘配色显示方案
446268
void MainWindow::defaultColor()
447269
{
448270
//GMK Metropolis

mainwindow.ui

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
</size>
3030
</property>
3131
<property name="windowTitle">
32-
<string>KeyBoardTool V3.0 Designed By Santa</string>
32+
<string>KeyBoardTool V1.0 Designed By Santa</string>
3333
</property>
3434
<property name="windowIcon">
3535
<iconset resource="logo.qrc">
@@ -59,16 +59,16 @@
5959
</property>
6060
<layout class="QHBoxLayout" name="horizontalLayout_9">
6161
<property name="leftMargin">
62-
<number>5</number>
62+
<number>6</number>
6363
</property>
6464
<property name="topMargin">
65-
<number>5</number>
65+
<number>6</number>
6666
</property>
6767
<property name="rightMargin">
68-
<number>0</number>
68+
<number>6</number>
6969
</property>
7070
<property name="bottomMargin">
71-
<number>5</number>
71+
<number>6</number>
7272
</property>
7373
<item>
7474
<widget class="QWidget" name="widget_Keyboard" native="true">
@@ -3806,7 +3806,7 @@ Lock</string>
38063806
<number>6</number>
38073807
</property>
38083808
<property name="rightMargin">
3809-
<number>0</number>
3809+
<number>9</number>
38103810
</property>
38113811
<property name="bottomMargin">
38123812
<number>0</number>
@@ -4571,14 +4571,17 @@ background-color: rgb(255, 255, 255);
45714571
</property>
45724572
</widget>
45734573
</item>
4574-
<item>
4574+
<item alignment="Qt::AlignVCenter">
45754575
<widget class="QLabel" name="label">
45764576
<property name="font">
45774577
<font>
45784578
<family>微软雅黑</family>
45794579
<pointsize>6</pointsize>
45804580
</font>
45814581
</property>
4582+
<property name="styleSheet">
4583+
<string notr="true">color: rgb(223, 223, 228);</string>
4584+
</property>
45824585
<property name="text">
45834586
<string>Num Lock</string>
45844587
</property>
@@ -4628,14 +4631,17 @@ background-color: rgb(255, 255, 255);
46284631
</property>
46294632
</widget>
46304633
</item>
4631-
<item>
4634+
<item alignment="Qt::AlignVCenter">
46324635
<widget class="QLabel" name="label_2">
46334636
<property name="font">
46344637
<font>
46354638
<family>微软雅黑</family>
46364639
<pointsize>6</pointsize>
46374640
</font>
46384641
</property>
4642+
<property name="styleSheet">
4643+
<string notr="true">color: rgb(223, 223, 228);</string>
4644+
</property>
46394645
<property name="text">
46404646
<string>Caps Lock</string>
46414647
</property>
@@ -4685,14 +4691,17 @@ background-color: rgb(255, 255, 255);
46854691
</property>
46864692
</widget>
46874693
</item>
4688-
<item>
4694+
<item alignment="Qt::AlignVCenter">
46894695
<widget class="QLabel" name="label_3">
46904696
<property name="font">
46914697
<font>
46924698
<family>微软雅黑</family>
46934699
<pointsize>6</pointsize>
46944700
</font>
46954701
</property>
4702+
<property name="styleSheet">
4703+
<string notr="true">color: rgb(223, 223, 228);</string>
4704+
</property>
46964705
<property name="text">
46974706
<string>Scroll Lock</string>
46984707
</property>

0 commit comments

Comments
 (0)