回答編集履歴
3
修正
answer
CHANGED
@@ -35,4 +35,9 @@
|
|
35
35
|
をほとんどそのまま使っています。
|
36
36
|
RubyのQtの場合はtray.showの位置がtray.showMessageよりも
|
37
37
|
下だと通知が表示されなくなりました。
|
38
|
-
setIconでiconを指定しておかないとエラーが発生します。
|
38
|
+
setIconでiconを指定しておかないとエラーが発生します。
|
39
|
+
|
40
|
+
私はQt初心者なので私の言っていることを信じてはいけませんが
|
41
|
+
Qtは言語が違っても似ているところがあるのでC++以外の言語の
|
42
|
+
sampleも漁ってみると良いかもしれません。
|
43
|
+
私もよくPythonやC++のQtのサンプルをRubyのコードに使っています。
|
2
修正
answer
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
class Notification < Qt::Widget
|
7
7
|
def initialize
|
8
8
|
super
|
9
|
-
|
9
|
+
setFixedSize(Qt::Size.new(200, 120))
|
10
10
|
notification = Qt::PushButton.new("Start", self)
|
11
11
|
notification.setGeometry(10, 40, 180, 40)
|
12
12
|
connect(notification, SIGNAL("clicked()"), self, SLOT("notification()"))
|
1
修正
answer
CHANGED
@@ -16,7 +16,6 @@
|
|
16
16
|
|
17
17
|
def notification()
|
18
18
|
tray = Qt::SystemTrayIcon.new
|
19
|
-
tray.setContextMenu(Qt::Menu.new)
|
20
19
|
tray.setIcon(Qt::Icon.new("icon.png"))
|
21
20
|
tray.show
|
22
21
|
tray.showMessage("Notification", "This is sample.")
|