qtbindings 4.6.3.1 → 4.6.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG.txt +14 -0
- data/KNOWN_ISSUES.txt +5 -11
- data/examples/itemviews/chart/pieview.rb +1 -1
- data/examples/network/ftp/ftpwindow.rb +8 -3
- data/examples/network/http/httpwindow.rb +1 -1
- data/examples/painting/fontsampler/mainwindow.rb +14 -13
- data/examples/painting/fontsampler/previewdialog.rb +40 -39
- data/examples/painting/fontsampler/previewlabel.rb +2 -2
- data/examples/painting/svgviewer/svgwindow.rb +2 -2
- data/ext/cmake/modules/FindQt4.cmake +1 -0
- data/ext/generator/generatorpreprocessor.cpp +43 -1
- data/ext/generator/generators/smoke/generator_smoke.cpp +8 -1
- data/ext/generator/generators/smoke/helpers.cpp +5 -5
- data/ext/generator/generators/smoke/writeClasses.cpp +1 -1
- data/ext/generator/parser/lexer.cpp +1 -0
- data/ext/generator/parser/parser.cpp +4 -2
- data/ext/generator/parser/rpp/chartools.cpp +20 -0
- data/ext/generator/parser/rpp/chartools.h +7 -0
- data/ext/generator/parser/rpp/pp-macro-expander.cpp +3 -3
- data/ext/generator/parser/tokens.cpp +3 -0
- data/ext/generator/parser/tokens.h +1 -0
- data/ext/generator/type_compiler.cpp +1 -1
- data/ext/ruby/qtruby/src/handlers.cpp +13 -3
- data/ext/smoke/CMakeLists.txt +1 -0
- data/ext/smoke/qtcore/smokeconfig.xml +2 -0
- data/ext/smoke/qtdeclarative/smokeconfig.xml +1 -0
- data/ext/smoke/qthelp/CMakeLists.txt +45 -0
- data/ext/smoke/qthelp/config.xml.cmake +13 -0
- data/ext/smoke/qthelp/qthelp_includes.h +3 -0
- data/ext/smoke/qthelp/smokeconfig.xml +53 -0
- data/ext/smoke/qthelp_smoke.h +16 -0
- data/ext/smoke/qtopengl/config.xml.cmake +1 -0
- data/ext/smoke/qtxmlpatterns/smokeconfig.xml +1 -1
- data/extconf.rb +60 -58
- data/lib/Qt/qtruby4.rb +12 -15
- data/lib/qtbindings_version.rb +2 -2
- metadata +8 -8
- data/examples/textedit/textedit.rb +0 -150
- data/ext/ruby/qtruby/src/extconf.rb +0 -11
data/lib/Qt/qtruby4.rb
CHANGED
@@ -2533,14 +2533,13 @@ module Qt
|
|
2533
2533
|
end
|
2534
2534
|
|
2535
2535
|
def Internal.checkarg(argtype, typename)
|
2536
|
-
puts " #{typename} (#{argtype})" if debug_level >= DebugLevel::High
|
2537
2536
|
const_point = typename =~ /^const\s+/ ? -1 : 0
|
2538
2537
|
if argtype == 'i'
|
2539
2538
|
if typename =~ /^int&?$|^signed int&?$|^signed$|^qint32&?$/
|
2540
2539
|
return 6 + const_point
|
2541
2540
|
elsif typename =~ /^quint32&?$/
|
2542
2541
|
return 4 + const_point
|
2543
|
-
elsif typename =~ /^(?:short|ushort|unsigned short int|unsigned short|uchar
|
2542
|
+
elsif typename =~ /^(?:short|ushort|unsigned short int|unsigned short|uchar|char|unsigned char|uint|long|ulong|unsigned long int|unsigned|float|double|WId|HBITMAP__\*|HDC__\*|HFONT__\*|HICON__\*|HINSTANCE__\*|HPALETTE__\*|HRGN__\*|HWND__\*|Q_PID|^quint16&?$|^qint16&?$)$/
|
2544
2543
|
return 4 + const_point
|
2545
2544
|
elsif typename =~ /^(quint|qint|qulong|qlong|qreal)/
|
2546
2545
|
return 4 + const_point
|
@@ -2741,11 +2740,9 @@ module Qt
|
|
2741
2740
|
|
2742
2741
|
# Debugging output for method lookup
|
2743
2742
|
if debug_level >= DebugLevel::High
|
2744
|
-
puts "
|
2745
|
-
puts ":: method == #{method}"
|
2743
|
+
puts "Searching for #{classname}##{method}"
|
2746
2744
|
puts "Munged method names:"
|
2747
|
-
methods.each {|meth| puts "
|
2748
|
-
puts "-> methodIds == #{methodIds.inspect}"
|
2745
|
+
methods.each {|meth| puts " #{meth}"}
|
2749
2746
|
puts "candidate list:"
|
2750
2747
|
prototypes = dumpCandidates(methodIds).split("\n")
|
2751
2748
|
line_len = (prototypes.collect { |p| p.length }).max
|
@@ -2764,24 +2761,24 @@ module Qt
|
|
2764
2761
|
current_match = (isConstMethod(id) ? 1 : 0)
|
2765
2762
|
(0...args.length).each do
|
2766
2763
|
|i|
|
2767
|
-
|
2764
|
+
typename = get_arg_type_name(id, i)
|
2765
|
+
argtype = get_value_type(args[i])
|
2766
|
+
score = checkarg(argtype, typename)
|
2767
|
+
current_match += score
|
2768
|
+
puts " #{typename} (#{argtype}) score: #{score}" if debug_level >= DebugLevel::High
|
2768
2769
|
end
|
2769
2770
|
|
2770
2771
|
# Note that if current_match > best_match, then chosen must be nil
|
2771
2772
|
if current_match > best_match
|
2772
2773
|
best_match = current_match
|
2773
2774
|
chosen = id
|
2774
|
-
#
|
2775
|
-
# If ambiguous matches occur the problem must be fixed be adjusting the relative
|
2776
|
-
# ranking of the arg types involved in checkarg().
|
2775
|
+
# Ties are bad - but it is better to chose something than to fail
|
2777
2776
|
elsif current_match == best_match && id.smoke == chosen.smoke
|
2778
|
-
puts "multiple methods
|
2779
|
-
chosen =
|
2777
|
+
puts " ****** warning: multiple methods with the same score of #{current_match}: #{chosen.index} and #{id.index}" if debug_level >= DebugLevel::Minimal
|
2778
|
+
chosen = id
|
2780
2779
|
end
|
2781
|
-
puts "match => #{id.index} score: #{current_match} chosen: #{chosen}" if debug_level >= DebugLevel::High
|
2780
|
+
puts " match => smoke: #{id.smoke} index: #{id.index} score: #{current_match} chosen: #{chosen ? chosen.index : nil}" if debug_level >= DebugLevel::High
|
2782
2781
|
end
|
2783
|
-
|
2784
|
-
puts "Resolved to id: #{chosen.index}" if !chosen.nil? && debug_level >= DebugLevel::High
|
2785
2782
|
end
|
2786
2783
|
|
2787
2784
|
# Additional debugging output
|
data/lib/qtbindings_version.rb
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
QTBINDINGS_VERSION = '4.6.3.
|
2
|
-
QTBINDINGS_RELEASE_DATE = '
|
1
|
+
QTBINDINGS_VERSION = '4.6.3.2'
|
2
|
+
QTBINDINGS_RELEASE_DATE = '2010-12-06 07:43:59 -0700'
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: qtbindings
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash: 49
|
5
4
|
prerelease: false
|
6
5
|
segments:
|
7
6
|
- 4
|
8
7
|
- 6
|
9
8
|
- 3
|
10
|
-
-
|
11
|
-
version: 4.6.3.
|
9
|
+
- 2
|
10
|
+
version: 4.6.3.2
|
12
11
|
platform: ruby
|
13
12
|
authors:
|
14
13
|
- Richard Dale
|
@@ -18,7 +17,7 @@ autorequire:
|
|
18
17
|
bindir: bin
|
19
18
|
cert_chain: []
|
20
19
|
|
21
|
-
date: 2010-
|
20
|
+
date: 2010-12-06 00:00:00 -07:00
|
22
21
|
default_executable:
|
23
22
|
dependencies: []
|
24
23
|
|
@@ -325,7 +324,6 @@ files:
|
|
325
324
|
- examples/ruboids/ruboids/WorldWindow.rb
|
326
325
|
- examples/ruboids/TODO
|
327
326
|
- examples/run_all.rb
|
328
|
-
- examples/textedit/textedit.rb
|
329
327
|
- examples/tutorial/t1/t1.rb
|
330
328
|
- examples/tutorial/t10/cannon.rb
|
331
329
|
- examples/tutorial/t10/lcdrange.rb
|
@@ -598,7 +596,6 @@ files:
|
|
598
596
|
- ext/ruby/qtruby/rails_support/CMakeLists.txt
|
599
597
|
- ext/ruby/qtruby/README
|
600
598
|
- ext/ruby/qtruby/src/CMakeLists.txt
|
601
|
-
- ext/ruby/qtruby/src/extconf.rb
|
602
599
|
- ext/ruby/qtruby/src/handlers.cpp
|
603
600
|
- ext/ruby/qtruby/src/marshall.h
|
604
601
|
- ext/ruby/qtruby/src/marshall_basetypes.h
|
@@ -705,6 +702,11 @@ files:
|
|
705
702
|
- ext/smoke/qtgui/qtgui_includes.h
|
706
703
|
- ext/smoke/qtgui/smokeconfig.xml
|
707
704
|
- ext/smoke/qtgui_smoke.h
|
705
|
+
- ext/smoke/qthelp/CMakeLists.txt
|
706
|
+
- ext/smoke/qthelp/config.xml.cmake
|
707
|
+
- ext/smoke/qthelp/qthelp_includes.h
|
708
|
+
- ext/smoke/qthelp/smokeconfig.xml
|
709
|
+
- ext/smoke/qthelp_smoke.h
|
708
710
|
- ext/smoke/qtmultimedia/CMakeLists.txt
|
709
711
|
- ext/smoke/qtmultimedia/config.xml.cmake
|
710
712
|
- ext/smoke/qtmultimedia/qtmultimedia_includes.h
|
@@ -791,7 +793,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
791
793
|
requirements:
|
792
794
|
- - ">="
|
793
795
|
- !ruby/object:Gem::Version
|
794
|
-
hash: 3
|
795
796
|
segments:
|
796
797
|
- 0
|
797
798
|
version: "0"
|
@@ -800,7 +801,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
800
801
|
requirements:
|
801
802
|
- - ">="
|
802
803
|
- !ruby/object:Gem::Version
|
803
|
-
hash: 3
|
804
804
|
segments:
|
805
805
|
- 0
|
806
806
|
version: "0"
|
@@ -1,150 +0,0 @@
|
|
1
|
-
#!/usr/bin/ruby -w
|
2
|
-
|
3
|
-
require 'Qt'
|
4
|
-
require 'rexml/document'
|
5
|
-
|
6
|
-
require '../base/rui.rb'
|
7
|
-
|
8
|
-
class MyTextEditor < Qt::TextEdit
|
9
|
-
signals 'saved()'
|
10
|
-
slots 'insert_icon()', 'new()', 'open()', 'save_as()'
|
11
|
-
def initialize(w = nil)
|
12
|
-
super(w)
|
13
|
-
@images = {}
|
14
|
-
@@next_image_id = 0
|
15
|
-
self.setTextFormat(Qt::RichText)
|
16
|
-
end
|
17
|
-
def insert_richtext(richtext)
|
18
|
-
# todo, use a rand string
|
19
|
-
unique_string = '000___xxx123456789xxx___xxx123456789xxx___000'
|
20
|
-
insert(unique_string)
|
21
|
-
txt = self.text().gsub(unique_string, richtext)
|
22
|
-
self.setText(txt)
|
23
|
-
end
|
24
|
-
def next_image_id
|
25
|
-
@@next_image_id += 1
|
26
|
-
end
|
27
|
-
def load_image(fname, image_id)
|
28
|
-
pixmap = Qt::Pixmap.new(fname)
|
29
|
-
msfactory = Qt::MimeSourceFactory.defaultFactory
|
30
|
-
msfactory.setPixmap(image_id, pixmap)
|
31
|
-
@images[image_id] = fname
|
32
|
-
image_id
|
33
|
-
end
|
34
|
-
def insert_icon
|
35
|
-
fname = Qt::FileDialog.getOpenFileName
|
36
|
-
return if fname.nil?
|
37
|
-
image_id = "image_#{next_image_id}"
|
38
|
-
load_image(fname, image_id)
|
39
|
-
insert_richtext('<qt><img source="'+image_id+'"></qt>')
|
40
|
-
end
|
41
|
-
def createPopupMenu(pos) # virtual
|
42
|
-
pm = Qt::PopupMenu.new
|
43
|
-
pm.insertItem("Insert Image!", self, SLOT('insert_icon()'))
|
44
|
-
pm
|
45
|
-
end
|
46
|
-
def has_metadata
|
47
|
-
!@images.empty?
|
48
|
-
end
|
49
|
-
def metadata_fname(fname)
|
50
|
-
"#{fname}.metadata.xml"
|
51
|
-
end
|
52
|
-
def attempt_metadata_load(fname)
|
53
|
-
return unless File.exists?(metadata_fname(fname))
|
54
|
-
file = File.open(metadata_fname(fname))
|
55
|
-
@xmldoc = REXML::Document.new file
|
56
|
-
@xmldoc.root.elements.each("image") {
|
57
|
-
|image|
|
58
|
-
image_id = image.attributes["ident"]
|
59
|
-
img_fname = image.attributes["filename"]
|
60
|
-
load_image(img_fname, image_id)
|
61
|
-
}
|
62
|
-
end
|
63
|
-
def metadata_save_if_has(fname)
|
64
|
-
return if not has_metadata
|
65
|
-
metadata_doc = REXML::Document.new '<metadata/>'
|
66
|
-
@images.each {
|
67
|
-
|id, img_fname|
|
68
|
-
metadata_doc.root.add_element("image", {"filename"=>img_fname, "ident"=>id})
|
69
|
-
}
|
70
|
-
file = File.new(metadata_fname(fname), "w")
|
71
|
-
file.puts(metadata_doc)
|
72
|
-
file.close
|
73
|
-
end
|
74
|
-
def metadata_clear
|
75
|
-
@images = {}
|
76
|
-
end
|
77
|
-
def new(txt = "")
|
78
|
-
metadata_clear
|
79
|
-
self.setText(txt)
|
80
|
-
end
|
81
|
-
def open
|
82
|
-
fname = Qt::FileDialog.getOpenFileName
|
83
|
-
return if fname.nil?
|
84
|
-
unless File.exists?(fname)
|
85
|
-
Qt::MessageBox.critical(self, "File Does Not Exist", "Sorry, unable to find the requested file!")
|
86
|
-
return
|
87
|
-
end
|
88
|
-
return if fname.nil?
|
89
|
-
txt = File.open(fname).gets(nil)
|
90
|
-
metadata_clear
|
91
|
-
attempt_metadata_load(fname)
|
92
|
-
self.setText(txt)
|
93
|
-
end
|
94
|
-
def save_as
|
95
|
-
fname = Qt::FileDialog.getSaveFileName
|
96
|
-
return if fname.nil?
|
97
|
-
if File.exists?(fname)
|
98
|
-
Qt::MessageBox.critical(self, "File Already Exists", "Sorry, file already exists. Please choose a non-existing filename!")
|
99
|
-
return save_as
|
100
|
-
end
|
101
|
-
file = File.new(fname, "w")
|
102
|
-
file.puts(text())
|
103
|
-
file.close
|
104
|
-
metadata_save_if_has(fname)
|
105
|
-
emit saved()
|
106
|
-
end
|
107
|
-
end
|
108
|
-
|
109
|
-
class MyWidget < Qt::MainWindow
|
110
|
-
slots 'text_changed()', 'saved()'
|
111
|
-
def initialize()
|
112
|
-
super
|
113
|
-
@editor = MyTextEditor.new(self)
|
114
|
-
connect(@editor, SIGNAL('textChanged()'), self, SLOT('text_changed()'))
|
115
|
-
connect(@editor, SIGNAL('saved()'), self, SLOT('saved()'))
|
116
|
-
|
117
|
-
fileTools = Qt::ToolBar.new(self, "file operations")
|
118
|
-
fileMenu = Qt::PopupMenu.new(self)
|
119
|
-
|
120
|
-
actions = [
|
121
|
-
RAction.new("&New", Icons::FILE_NEW, @editor, SLOT('new()'), [fileTools, fileMenu]),
|
122
|
-
RAction.new("&Open...", Icons::FILE_OPEN, @editor, SLOT('open()'), [fileTools, fileMenu]),
|
123
|
-
@save = RAction.new("Save &As...", Icons::FILE_SAVE_AS, @editor, SLOT('save_as()'), [fileTools, fileMenu]),
|
124
|
-
RSeperator.new([fileMenu]),
|
125
|
-
RAction.new("E&xit", Icons::EXIT, $qApp, SLOT('quit()'), [fileMenu])
|
126
|
-
]
|
127
|
-
|
128
|
-
build_actions(actions)
|
129
|
-
|
130
|
-
menubar = Qt::MenuBar.new(self)
|
131
|
-
menubar.insertItem("&File", fileMenu)
|
132
|
-
|
133
|
-
self.setCentralWidget(@editor)
|
134
|
-
end
|
135
|
-
def saved
|
136
|
-
@save.action.setEnabled(false)
|
137
|
-
end
|
138
|
-
def text_changed
|
139
|
-
@save.action.setEnabled(true)
|
140
|
-
end
|
141
|
-
end
|
142
|
-
|
143
|
-
a = Qt::Application.new(ARGV)
|
144
|
-
|
145
|
-
w = MyWidget.new
|
146
|
-
w.show
|
147
|
-
|
148
|
-
a.setMainWidget(w)
|
149
|
-
a.exec()
|
150
|
-
exit
|
@@ -1,11 +0,0 @@
|
|
1
|
-
require 'mkmf'
|
2
|
-
dir_config('smoke')
|
3
|
-
dir_config('qt')
|
4
|
-
|
5
|
-
# For Linux, BSD*, Mac OS X etc:
|
6
|
-
$LOCAL_LIBS += '-lsmokeqt -lQtCore -lQtGui -lQtNetwork -lQtOpenGL -lQtSql -lQtXml -lstdc++'
|
7
|
-
|
8
|
-
# For Windows the Qt library names end in '4':
|
9
|
-
# $LOCAL_LIBS += '-lsmokeqt -lQtCore4 -lQtGui4 -lQtNetwork4 -lQtOpenGL4 -lQtSql4 -lQtXml4 -lstdc++'
|
10
|
-
|
11
|
-
create_makefile("qtruby4")
|