qtbindings 4.6.3.1 → 4.6.3.2
Sign up to get free protection for your applications and to get access to all the features.
- 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/CHANGELOG.txt
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
qtbindings Changelog:
|
2
2
|
-----------------
|
3
|
+
v4.6.3.0
|
3
4
|
2010/07/27 - Apply Ryan Melton's patches to build on Windows
|
4
5
|
2010/07/27 - Apply Ryan Melton's patch to fix ExtraSelection
|
5
6
|
2010/07/28 - Sync with kde-bindings trunk rev 1156258
|
@@ -7,6 +8,19 @@ qtbindings Changelog:
|
|
7
8
|
2010/07/28 - Apply Paolo Capriotti's patch for deferred objects
|
8
9
|
2010/07/28 - Apply Paolo Capriotti's patch for marking QGraphicsEffect
|
9
10
|
2010/07/28 - Sync with kde-bindings trunk rev 1156329
|
11
|
+
|
12
|
+
v4.6.3.1
|
10
13
|
2010/09/21 - Update examples to work with Ruby 1.9.2
|
11
14
|
2010/09/21 - Fix 4 examples
|
12
15
|
2010/09/21 - Sync with kde-bindings trunk rev 1178034
|
16
|
+
|
17
|
+
v4.6.3.2
|
18
|
+
2010/10/14 - Handle ambiguous results with method lookup
|
19
|
+
2010/10/15 - Fix bug with UTF-8 support
|
20
|
+
2010/10/17 - Sync with kde-bindings trunk rev 1186952
|
21
|
+
2010/10/19 - Fix Http example
|
22
|
+
2010/11/04 - Fix chart example and all methods returning QFlags&
|
23
|
+
2010/12/03 - Add framework support on Mac OSX which also fixes the OpenGl example
|
24
|
+
2010/12/05 - Make smokegen not parse stdio.h as a workaround for FreeBSD based systems
|
25
|
+
2010/12/05 - Minor changes to support Qt 4.7 on various platforms including Ubuntu 10.10
|
26
|
+
|
data/KNOWN_ISSUES.txt
CHANGED
@@ -1,11 +1,5 @@
|
|
1
|
-
1.
|
2
|
-
2.
|
3
|
-
3.
|
4
|
-
4.
|
5
|
-
5.
|
6
|
-
6. textures example fails - Cannot handle Gluint
|
7
|
-
7. fontsample example fails - undefined method checkState for nil
|
8
|
-
8. svgviewer example fails - undefined method rx= for Qt::Point
|
9
|
-
9. passivepopup example fails - seg fault
|
10
|
-
10. textedit example fails - undefined method setTextFormat
|
11
|
-
11. digitalclock example fails - unresolved constructor call DigitalClock
|
1
|
+
1. broadcastsender example fails - undefined method writeDatagram
|
2
|
+
2. fortuneserver example fails - undefined method seek
|
3
|
+
3. ftp example fails - undefined method icon=
|
4
|
+
4. fontsampler example fails - undefined method checkState for nil
|
5
|
+
5. passivepopup example fails - seg fault
|
@@ -261,7 +261,7 @@ class PieView < Qt::AbstractItemView
|
|
261
261
|
selections = selectionModel()
|
262
262
|
option = viewOptions()
|
263
263
|
state = option.state
|
264
|
-
|
264
|
+
|
265
265
|
background = option.palette.base()
|
266
266
|
foreground = Qt::Pen.new(option.palette.color(Qt::Palette::Foreground))
|
267
267
|
textPen = Qt::Pen.new(option.palette.color(Qt::Palette::Text))
|
@@ -38,6 +38,7 @@ class FtpWindow < Qt::Dialog
|
|
38
38
|
super(parent)
|
39
39
|
@ftp = nil
|
40
40
|
@isDirectory = {}
|
41
|
+
@currentPath = ""
|
41
42
|
@ftpServerLabel = Qt::Label.new(tr("Ftp &server:"))
|
42
43
|
@ftpServerLineEdit = Qt::LineEdit.new("ftp.trolltech.com")
|
43
44
|
@ftpServerLabel.buddy = @ftpServerLineEdit
|
@@ -95,6 +96,9 @@ class FtpWindow < Qt::Dialog
|
|
95
96
|
end
|
96
97
|
|
97
98
|
def connectOrDisconnect()
|
99
|
+
@currentPath = ""
|
100
|
+
@isDirectory = {}
|
101
|
+
|
98
102
|
if !@ftp.nil?
|
99
103
|
@ftp.abort
|
100
104
|
@ftp.deleteLater
|
@@ -134,7 +138,7 @@ class FtpWindow < Qt::Dialog
|
|
134
138
|
return
|
135
139
|
end
|
136
140
|
|
137
|
-
@file = Qt::File.new(fileName)
|
141
|
+
@file = Qt::File.new(@fileName)
|
138
142
|
if !@file.open(Qt::IODevice::WriteOnly)
|
139
143
|
Qt::MessageBox.information(self, tr("FTP"),
|
140
144
|
tr("Unable to save the @file %s: %s." %
|
@@ -143,7 +147,7 @@ class FtpWindow < Qt::Dialog
|
|
143
147
|
return
|
144
148
|
end
|
145
149
|
|
146
|
-
@ftp.get(@fileList.currentItem.text, file)
|
150
|
+
@ftp.get(@fileList.currentItem.text, @file)
|
147
151
|
|
148
152
|
@progressDialog.labelText = tr("Downloading %s..." % @fileName)
|
149
153
|
@progressDialog.show()
|
@@ -199,7 +203,8 @@ class FtpWindow < Qt::Dialog
|
|
199
203
|
item = Qt::ListWidgetItem.new
|
200
204
|
item.text = urlInfo.name()
|
201
205
|
pixmap = Qt::Pixmap.new(urlInfo.dir? ? "images/dir.png" : "images/file.png")
|
202
|
-
|
206
|
+
|
207
|
+
item.icon = Qt::Icon.new(pixmap)
|
203
208
|
|
204
209
|
@isDirectory[urlInfo.name()] = urlInfo.isDir()
|
205
210
|
@fileList.addItem(item)
|
@@ -34,7 +34,7 @@ class MainWindow < Qt::MainWindow
|
|
34
34
|
'on_printAction_triggered()',
|
35
35
|
'on_printPreviewAction_triggered()',
|
36
36
|
'on_unmarkAction_triggered()',
|
37
|
-
'printPage(int, QPainter
|
37
|
+
'printPage(int, QPainter*, QPrinter*)',
|
38
38
|
'showFont(QTreeWidgetItem *)',
|
39
39
|
'updateStyles(QTreeWidgetItem *, int)'
|
40
40
|
|
@@ -88,7 +88,7 @@ class MainWindow < Qt::MainWindow
|
|
88
88
|
def on_clearAction_triggered()
|
89
89
|
currentItem = @ui.fontTree.currentItem()
|
90
90
|
@ui.fontTree.selectedItems.each do |item|
|
91
|
-
fontTree.setItemSelected(item, false)
|
91
|
+
@ui.fontTree.setItemSelected(item, false)
|
92
92
|
end
|
93
93
|
@ui.fontTree.setItemSelected(currentItem, true)
|
94
94
|
end
|
@@ -169,7 +169,7 @@ class MainWindow < Qt::MainWindow
|
|
169
169
|
elsif state == Qt::Unchecked &&
|
170
170
|
parent.checkState(0) == Qt::Checked
|
171
171
|
marked = false
|
172
|
-
for row in 0..parent.childCount
|
172
|
+
for row in 0..(parent.childCount - 1)
|
173
173
|
if parent.child(row).checkState(0) == Qt::Checked
|
174
174
|
marked = true
|
175
175
|
break
|
@@ -183,7 +183,7 @@ class MainWindow < Qt::MainWindow
|
|
183
183
|
else
|
184
184
|
row
|
185
185
|
number = 0
|
186
|
-
for row in 0..item.childCount
|
186
|
+
for row in 0..(item.childCount - 1)
|
187
187
|
if item.child(row).checkState(0) == Qt::Checked
|
188
188
|
number += 1
|
189
189
|
end
|
@@ -192,13 +192,13 @@ class MainWindow < Qt::MainWindow
|
|
192
192
|
# Mark/unmark all child items when marking/unmarking top-level
|
193
193
|
# items.
|
194
194
|
if state == Qt::Checked && number == 0
|
195
|
-
for row in 0..item.childCount
|
195
|
+
for row in 0..(item.childCount - 1)
|
196
196
|
if item.child(row).checkState(0) == Qt::Unchecked
|
197
197
|
item.child(row).setCheckState(0, Qt::Checked)
|
198
198
|
end
|
199
199
|
end
|
200
200
|
elsif state == Qt::Unchecked && number > 0
|
201
|
-
for row in 0..item.childCount
|
201
|
+
for row in 0..(item.childCount - 1)
|
202
202
|
if item.child(row).checkState(0) == Qt::Checked
|
203
203
|
item.child(row).setCheckState(0, Qt::Unchecked)
|
204
204
|
end
|
@@ -268,18 +268,18 @@ class MainWindow < Qt::MainWindow
|
|
268
268
|
|
269
269
|
preview = PreviewDialog.new(printer, self)
|
270
270
|
connect(preview,
|
271
|
-
SIGNAL('pageRequested(int, QPainter
|
272
|
-
self, SLOT('printPage(int, QPainter
|
271
|
+
SIGNAL('pageRequested(int, QPainter*, QPrinter*)'),
|
272
|
+
self, SLOT('printPage(int, QPainter*, QPrinter*)'),
|
273
273
|
Qt::DirectConnection)
|
274
274
|
|
275
|
-
preview.
|
275
|
+
preview.setNumberOfPages = @pageMap.length
|
276
276
|
preview.exec()
|
277
277
|
end
|
278
278
|
|
279
279
|
def currentPageMap()
|
280
280
|
pageMap = {}
|
281
281
|
|
282
|
-
for row in 0
|
282
|
+
for row in 0..(@ui.fontTree.topLevelItemCount - 1)
|
283
283
|
familyItem = @ui.fontTree.topLevelItem(row)
|
284
284
|
|
285
285
|
if familyItem.checkState(0) == Qt::Checked
|
@@ -287,10 +287,10 @@ class MainWindow < Qt::MainWindow
|
|
287
287
|
pageMap[family] = []
|
288
288
|
end
|
289
289
|
|
290
|
-
for childRow in 0..familyItem.childCount
|
290
|
+
for childRow in 0..(familyItem.childCount - 1)
|
291
291
|
styleItem = familyItem.child(childRow)
|
292
292
|
if styleItem.checkState(0) == Qt::Checked
|
293
|
-
pageMap[family]
|
293
|
+
pageMap[family] << styleItem
|
294
294
|
end
|
295
295
|
end
|
296
296
|
end
|
@@ -304,6 +304,7 @@ class MainWindow < Qt::MainWindow
|
|
304
304
|
end
|
305
305
|
|
306
306
|
def printPage(index, painter, printer)
|
307
|
+
pageMap = currentPageMap()
|
307
308
|
family = pageMap.keys()[index]
|
308
309
|
items = pageMap[family]
|
309
310
|
|
@@ -356,7 +357,7 @@ class MainWindow < Qt::MainWindow
|
|
356
357
|
rect = fontMetrics.boundingRect("%s %s" % [font.family(), style])
|
357
358
|
y += rect.height()
|
358
359
|
painter.font = font
|
359
|
-
painter.drawText(Qt::PointF.
|
360
|
+
painter.drawText(Qt::PointF.new(x, y),
|
360
361
|
"%s %s" % [family, style])
|
361
362
|
y += interLineHeight
|
362
363
|
end
|
@@ -31,7 +31,7 @@ class PreviewDialog < Qt::Dialog
|
|
31
31
|
SmallPreviewLength = 200
|
32
32
|
LargePreviewLength = 400
|
33
33
|
|
34
|
-
signals 'pageRequested(int, QPainter
|
34
|
+
signals 'pageRequested(int, QPainter*, QPrinter*)'
|
35
35
|
|
36
36
|
slots 'accept()',
|
37
37
|
'addPage()',
|
@@ -49,7 +49,7 @@ class PreviewDialog < Qt::Dialog
|
|
49
49
|
|
50
50
|
@currentPage = 0
|
51
51
|
@pageCount = 0
|
52
|
-
@ui.pageList.setIconSize(Qt::Size(SmallPreviewLength, SmallPreviewLength))
|
52
|
+
@ui.pageList.setIconSize(Qt::Size.new(SmallPreviewLength, SmallPreviewLength))
|
53
53
|
@ui.pageList.header().hide()
|
54
54
|
@previewLabel = PreviewLabel.new
|
55
55
|
@printer = Qt::Printer.new
|
@@ -60,40 +60,40 @@ class PreviewDialog < Qt::Dialog
|
|
60
60
|
end
|
61
61
|
|
62
62
|
def setupComboBoxes()
|
63
|
-
@ui.paperSizeCombo.addItem(tr("A0 (841 x 1189 mm)"), Qt::Printer::A0)
|
64
|
-
@ui.paperSizeCombo.addItem(tr("A1 (594 x 841 mm)"), Qt::Printer::A1)
|
65
|
-
@ui.paperSizeCombo.addItem(tr("A2 (420 x 594 mm)"), Qt::Printer::A2)
|
66
|
-
@ui.paperSizeCombo.addItem(tr("A3 (297 x 420 mm)"), Qt::Printer::A3)
|
67
|
-
@ui.paperSizeCombo.addItem(tr("A4 (210 x 297 mm, 8.26 x 11.7 inches)"), Qt::Printer::A4)
|
68
|
-
@ui.paperSizeCombo.addItem(tr("A5 (148 x 210 mm)"), Qt::Printer::A5)
|
69
|
-
@ui.paperSizeCombo.addItem(tr("A6 (105 x 148 mm)"), Qt::Printer::A6)
|
70
|
-
@ui.paperSizeCombo.addItem(tr("A7 (74 x 105 mm)"), Qt::Printer::A7)
|
71
|
-
@ui.paperSizeCombo.addItem(tr("A8 (52 x 74 mm)"), Qt::Printer::A8)
|
72
|
-
@ui.paperSizeCombo.addItem(tr("A9 (37 x 52 mm)"), Qt::Printer::A9)
|
73
|
-
@ui.paperSizeCombo.addItem(tr("B0 (1000 x 1414 mm)"), Qt::Printer::B0)
|
74
|
-
@ui.paperSizeCombo.addItem(tr("B1 (707 x 1000 mm)"), Qt::Printer::B1)
|
75
|
-
@ui.paperSizeCombo.addItem(tr("B2 (500 x 707 mm)"), Qt::Printer::B2)
|
76
|
-
@ui.paperSizeCombo.addItem(tr("B3 (353 x 500 mm)"), Qt::Printer::B3)
|
77
|
-
@ui.paperSizeCombo.addItem(tr("B4 (250 x 353 mm)"), Qt::Printer::B4)
|
78
|
-
@ui.paperSizeCombo.addItem(tr("B5 (176 x 250 mm, 6.93 x 9.84 inches)"), Qt::Printer::B5)
|
79
|
-
@ui.paperSizeCombo.addItem(tr("B6 (125 x 176 mm)"), Qt::Printer::B6)
|
80
|
-
@ui.paperSizeCombo.addItem(tr("B7 (88 x 125 mm)"), Qt::Printer::B7)
|
81
|
-
@ui.paperSizeCombo.addItem(tr("B8 (62 x 88 mm)"), Qt::Printer::B8)
|
82
|
-
@ui.paperSizeCombo.addItem(tr("B9 (44 x 62 mm)"), Qt::Printer::B9)
|
83
|
-
@ui.paperSizeCombo.addItem(tr("B10 (31 x 44 mm)"), Qt::Printer::B10)
|
84
|
-
@ui.paperSizeCombo.addItem(tr("C5E (163 x 229 mm)"), Qt::Printer::C5E)
|
85
|
-
@ui.paperSizeCombo.addItem(tr("DLE (110 x 220 mm)"), Qt::Printer::DLE)
|
86
|
-
@ui.paperSizeCombo.addItem(tr("Executive (7.5 x 10 inches, 191 x 254 mm)"), Qt::Printer::Executive)
|
87
|
-
@ui.paperSizeCombo.addItem(tr("Folio (210 x 330 mm)"), Qt::Printer::Folio)
|
88
|
-
@ui.paperSizeCombo.addItem(tr("Ledger (432 x 279 mm)"), Qt::Printer::Ledger)
|
89
|
-
@ui.paperSizeCombo.addItem(tr("Legal (8.5 x 14 inches, 216 x 356 mm)"), Qt::Printer::Legal)
|
90
|
-
@ui.paperSizeCombo.addItem(tr("Letter (8.5 x 11 inches, 216 x 279 mm)"), Qt::Printer::Letter)
|
91
|
-
@ui.paperSizeCombo.addItem(tr("Tabloid (279 x 432 mm)"), Qt::Printer::Tabloid)
|
92
|
-
@ui.paperSizeCombo.addItem(tr("US Common #10 Envelope (105 x 241 mm)"), Qt::Printer::Comm10E)
|
93
|
-
@ui.paperSizeCombo.currentIndex = @ui.paperSizeCombo.findData(Qt::Printer::A4)
|
94
|
-
|
95
|
-
@ui.paperOrientationCombo.addItem(tr("Portrait"), Qt::Printer::Portrait)
|
96
|
-
@ui.paperOrientationCombo.addItem(tr("Landscape"), Qt::Printer::Landscape)
|
63
|
+
@ui.paperSizeCombo.addItem(tr("A0 (841 x 1189 mm)"), Qt::Variant.new(Qt::Printer::A0))
|
64
|
+
@ui.paperSizeCombo.addItem(tr("A1 (594 x 841 mm)"), Qt::Variant.new(Qt::Printer::A1))
|
65
|
+
@ui.paperSizeCombo.addItem(tr("A2 (420 x 594 mm)"), Qt::Variant.new(Qt::Printer::A2))
|
66
|
+
@ui.paperSizeCombo.addItem(tr("A3 (297 x 420 mm)"), Qt::Variant.new(Qt::Printer::A3))
|
67
|
+
@ui.paperSizeCombo.addItem(tr("A4 (210 x 297 mm, 8.26 x 11.7 inches)"), Qt::Variant.new(Qt::Printer::A4))
|
68
|
+
@ui.paperSizeCombo.addItem(tr("A5 (148 x 210 mm)"), Qt::Variant.new(Qt::Printer::A5))
|
69
|
+
@ui.paperSizeCombo.addItem(tr("A6 (105 x 148 mm)"), Qt::Variant.new(Qt::Printer::A6))
|
70
|
+
@ui.paperSizeCombo.addItem(tr("A7 (74 x 105 mm)"), Qt::Variant.new(Qt::Printer::A7))
|
71
|
+
@ui.paperSizeCombo.addItem(tr("A8 (52 x 74 mm)"), Qt::Variant.new(Qt::Printer::A8))
|
72
|
+
@ui.paperSizeCombo.addItem(tr("A9 (37 x 52 mm)"), Qt::Variant.new(Qt::Printer::A9))
|
73
|
+
@ui.paperSizeCombo.addItem(tr("B0 (1000 x 1414 mm)"), Qt::Variant.new(Qt::Printer::B0))
|
74
|
+
@ui.paperSizeCombo.addItem(tr("B1 (707 x 1000 mm)"), Qt::Variant.new(Qt::Printer::B1))
|
75
|
+
@ui.paperSizeCombo.addItem(tr("B2 (500 x 707 mm)"), Qt::Variant.new(Qt::Printer::B2))
|
76
|
+
@ui.paperSizeCombo.addItem(tr("B3 (353 x 500 mm)"), Qt::Variant.new(Qt::Printer::B3))
|
77
|
+
@ui.paperSizeCombo.addItem(tr("B4 (250 x 353 mm)"), Qt::Variant.new(Qt::Printer::B4))
|
78
|
+
@ui.paperSizeCombo.addItem(tr("B5 (176 x 250 mm, 6.93 x 9.84 inches)"), Qt::Variant.new(Qt::Printer::B5))
|
79
|
+
@ui.paperSizeCombo.addItem(tr("B6 (125 x 176 mm)"), Qt::Variant.new(Qt::Printer::B6))
|
80
|
+
@ui.paperSizeCombo.addItem(tr("B7 (88 x 125 mm)"), Qt::Variant.new(Qt::Printer::B7))
|
81
|
+
@ui.paperSizeCombo.addItem(tr("B8 (62 x 88 mm)"), Qt::Variant.new(Qt::Printer::B8))
|
82
|
+
@ui.paperSizeCombo.addItem(tr("B9 (44 x 62 mm)"), Qt::Variant.new(Qt::Printer::B9))
|
83
|
+
@ui.paperSizeCombo.addItem(tr("B10 (31 x 44 mm)"), Qt::Variant.new(Qt::Printer::B10))
|
84
|
+
@ui.paperSizeCombo.addItem(tr("C5E (163 x 229 mm)"), Qt::Variant.new(Qt::Printer::C5E))
|
85
|
+
@ui.paperSizeCombo.addItem(tr("DLE (110 x 220 mm)"), Qt::Variant.new(Qt::Printer::DLE))
|
86
|
+
@ui.paperSizeCombo.addItem(tr("Executive (7.5 x 10 inches, 191 x 254 mm)"), Qt::Variant.new(Qt::Printer::Executive))
|
87
|
+
@ui.paperSizeCombo.addItem(tr("Folio (210 x 330 mm)"), Qt::Variant.new(Qt::Printer::Folio))
|
88
|
+
@ui.paperSizeCombo.addItem(tr("Ledger (432 x 279 mm)"), Qt::Variant.new(Qt::Printer::Ledger))
|
89
|
+
@ui.paperSizeCombo.addItem(tr("Legal (8.5 x 14 inches, 216 x 356 mm)"), Qt::Variant.new(Qt::Printer::Legal))
|
90
|
+
@ui.paperSizeCombo.addItem(tr("Letter (8.5 x 11 inches, 216 x 279 mm)"), Qt::Variant.new(Qt::Printer::Letter))
|
91
|
+
@ui.paperSizeCombo.addItem(tr("Tabloid (279 x 432 mm)"), Qt::Variant.new(Qt::Printer::Tabloid))
|
92
|
+
@ui.paperSizeCombo.addItem(tr("US Common #10 Envelope (105 x 241 mm)"), Qt::Variant.new(Qt::Printer::Comm10E))
|
93
|
+
@ui.paperSizeCombo.currentIndex = @ui.paperSizeCombo.findData(Qt::Variant.new(Qt::Printer::A4))
|
94
|
+
|
95
|
+
@ui.paperOrientationCombo.addItem(tr("Portrait"), Qt::Variant.new(Qt::Printer::Portrait))
|
96
|
+
@ui.paperOrientationCombo.addItem(tr("Landscape"), Qt::Variant.new(Qt::Printer::Landscape))
|
97
97
|
end
|
98
98
|
|
99
99
|
def addPage()
|
@@ -131,8 +131,8 @@ class PreviewDialog < Qt::Dialog
|
|
131
131
|
@printer.paperRect().height()].max
|
132
132
|
width = pixmap.width() * @printer.paperRect().width() / longestSide
|
133
133
|
height = pixmap.height() * @printer.paperRect().height() / longestSide
|
134
|
-
|
135
|
-
pixmap.fill(qRgb(224,224,224))
|
134
|
+
|
135
|
+
pixmap.fill(Qt::Color.new(qRgb(224,224,224)))
|
136
136
|
painter = Qt::Painter.new
|
137
137
|
painter.begin(pixmap)
|
138
138
|
painter.renderHint = Qt::Painter::Antialiasing
|
@@ -235,7 +235,8 @@ class PreviewDialog < Qt::Dialog
|
|
235
235
|
end
|
236
236
|
|
237
237
|
def on_paperSizeCombo_activated(index)
|
238
|
-
|
238
|
+
Qt.debug_level = 100
|
239
|
+
@printer.paperSize = @ui.paperSizeCombo.itemData(index.to_i).value
|
239
240
|
|
240
241
|
for index in 0..@ui.pageList.topLevelItemCount
|
241
242
|
paintItem(@ui.pageList.topLevelItem(index), index)
|
@@ -25,7 +25,7 @@
|
|
25
25
|
|
26
26
|
class PreviewLabel < Qt::Widget
|
27
27
|
|
28
|
-
def initialize(parent)
|
28
|
+
def initialize(parent = nil)
|
29
29
|
super(parent)
|
30
30
|
end
|
31
31
|
|
@@ -33,7 +33,7 @@ class PreviewLabel < Qt::Widget
|
|
33
33
|
painter = Qt::Painter.new
|
34
34
|
painter.begin(self)
|
35
35
|
painter.fillRect(event.rect(), Qt::Color.new(224,224,224))
|
36
|
-
painter.drawPixmap(0, 0, @pixmap)
|
36
|
+
painter.drawPixmap(0, 0, @pixmap) if @pixmap
|
37
37
|
painter.end()
|
38
38
|
end
|
39
39
|
|
@@ -62,8 +62,8 @@ class SvgWindow < Qt::ScrollArea
|
|
62
62
|
|
63
63
|
def mousePressEvent(event)
|
64
64
|
@mousePressPos = event.pos
|
65
|
-
@scrollBarValuesOnMousePress.
|
66
|
-
@scrollBarValuesOnMousePress.
|
65
|
+
@scrollBarValuesOnMousePress.x = horizontalScrollBar.value
|
66
|
+
@scrollBarValuesOnMousePress.y = verticalScrollBar.value
|
67
67
|
event.accept
|
68
68
|
end
|
69
69
|
|
@@ -201,16 +201,58 @@ rpp::Stream* Preprocessor::sourceNeeded(QString& fileName, rpp::Preprocessor::In
|
|
201
201
|
}
|
202
202
|
if (path.isEmpty()) {
|
203
203
|
foreach (QDir dir, m_includeDirs) {
|
204
|
+
#if 0
|
205
|
+
if (dir.absolutePath().endsWith(".framework"))
|
206
|
+
{
|
207
|
+
dir.setPath(dir.absolutePath() + "/Headers");
|
208
|
+
}
|
209
|
+
#endif
|
210
|
+
// qWarning("Searching in %s", qPrintable(dir.absolutePath()));
|
204
211
|
info.setFile(dir, fileName);
|
205
212
|
if (info.isFile()) {
|
206
213
|
path = info.absoluteFilePath();
|
214
|
+
// qWarning("Found #include<%s>", qPrintable(fileName));
|
207
215
|
break;
|
208
216
|
}
|
209
217
|
}
|
210
218
|
}
|
211
|
-
|
219
|
+
|
220
|
+
#if defined(Q_OS_DARWIN)
|
221
|
+
/* Try searching for frameworks in default locations */
|
222
|
+
if (path.isEmpty()) {
|
223
|
+
QStringList splitString = fileName.split("/");
|
224
|
+
if (splitString.size() >= 2) {
|
225
|
+
QString frameworkName = splitString.takeFirst();
|
226
|
+
QString remainingFileName = splitString.join("/");
|
227
|
+
QDir dir1 = QDir(("/System/Library/Frameworks/" + frameworkName) + ".framework/Headers");
|
228
|
+
QDir dir2 = QDir(("/Library/Frameworks/" + frameworkName) + ".framework/Headers");
|
229
|
+
info.setFile(dir1, remainingFileName);
|
230
|
+
if (info.isFile()) {
|
231
|
+
path = info.absoluteFilePath();
|
232
|
+
// qWarning("Found #include<%s>", qPrintable(fileName));
|
233
|
+
}
|
234
|
+
else {
|
235
|
+
info.setFile(dir2, remainingFileName);
|
236
|
+
if (info.isFile()) {
|
237
|
+
path = info.absoluteFilePath();
|
238
|
+
// qWarning("Found #include<%s>", qPrintable(fileName));
|
239
|
+
}
|
240
|
+
}
|
241
|
+
}
|
242
|
+
}
|
243
|
+
#endif
|
244
|
+
|
245
|
+
if (fileName == "stdio.h")
|
246
|
+
{
|
247
|
+
qWarning("Not parsing stdio.h because it is not handled correctly by smokegen on FreeBSD based systems");
|
248
|
+
return 0;
|
249
|
+
}
|
250
|
+
|
212
251
|
if (path.isEmpty())
|
252
|
+
{
|
253
|
+
qWarning("Couldn't find file for #include<%s>", qPrintable(fileName));
|
213
254
|
return 0;
|
255
|
+
}
|
214
256
|
|
215
257
|
QFile file(path);
|
216
258
|
file.open(QFile::ReadOnly);
|
@@ -213,13 +213,20 @@ int generate()
|
|
213
213
|
Options::qtMode = ParserOptions::qtMode;
|
214
214
|
|
215
215
|
Options::voidpTypes << "long long" << "long long int" << "unsigned long long" << "unsigned long long int";
|
216
|
+
Options::scalarTypes << "long long" << "long long int" << "unsigned long long" << "unsigned long long int";
|
216
217
|
|
217
218
|
// Fill the type map. It maps some long integral types to shorter forms as used in SMOKE.
|
218
219
|
Util::typeMap["long int"] = "long";
|
219
220
|
Util::typeMap["short int"] = "short";
|
220
221
|
Util::typeMap["long double"] = "double";
|
221
222
|
Util::typeMap["wchar_t"] = "int"; // correct?
|
222
|
-
|
223
|
+
|
224
|
+
if (sizeof(unsigned int) == sizeof(size_t)) {
|
225
|
+
Util::typeMap["size_t"] = "uint";
|
226
|
+
} else if (sizeof(unsigned long) == sizeof(size_t)) {
|
227
|
+
Util::typeMap["size_t"] = "ulong";
|
228
|
+
}
|
229
|
+
|
223
230
|
qDebug() << "Generating SMOKE sources...";
|
224
231
|
|
225
232
|
SmokeDataFile smokeData;
|