teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

3

修正

2017/05/01 16:04

投稿

退会済みユーザー
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

修正

2017/05/01 16:04

投稿

退会済みユーザー
answer CHANGED
@@ -6,7 +6,7 @@
6
6
  class Notification < Qt::Widget
7
7
  def initialize
8
8
  super
9
- resize(200, 120)
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

修正

2017/05/01 15:57

投稿

退会済みユーザー
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.")