diff --git a/src/doc/doc/programming/qt_binding.xml b/src/doc/doc/programming/qt_binding.xml index 4d298d922..8ee752745 100644 --- a/src/doc/doc/programming/qt_binding.xml +++ b/src/doc/doc/programming/qt_binding.xml @@ -29,7 +29,6 @@
This sample tries to locate a designer file called "MyDialog.ui" relative to the
- macro's path (in $0). It uses the
@@ -312,7 +311,7 @@ end
b = dialog.button -# this will not render true, if the button was created by QFormBuilder for example +# this will not render true, if the button was created by QUiLoader for example b.is_a?(QPushButton) # this is correct: b.is_a?(QPushButton_Native)diff --git a/src/lay/lay/macro_templates/qt_designer.lym b/src/lay/lay/macro_templates/qt_designer.lym index d26b3a01b..4e1933695 100644 --- a/src/lay/lay/macro_templates/qt_designer.lym +++ b/src/lay/lay/macro_templates/qt_designer.lym @@ -20,7 +20,7 @@ # Initially we use the sample file provided as resource ui_file = QFile::new(":/macro-templates/qt_designer.ui") ui_file.open(QIODevice::ReadOnly) - dialog = QFormBuilder::new.load(ui_file, Application::instance.main_window) + dialog = QUiLoader::new.load(ui_file, Application::instance.main_window) ui_file.close def dialog.setup diff --git a/src/lay/lay/macro_templates/qt_designer_python.lym b/src/lay/lay/macro_templates/qt_designer_python.lym index 2d9f46eb5..dffd41731 100644 --- a/src/lay/lay/macro_templates/qt_designer_python.lym +++ b/src/lay/lay/macro_templates/qt_designer_python.lym @@ -17,7 +17,7 @@ import types ui_file = pya.QFile(":/macro-templates/qt_designer.ui") ui_file.open(pya.QIODevice.ReadOnly) -form = pya.QFormBuilder().load(ui_file, pya.Application.instance().main_window()) +form = pya.QUiLoader().load(ui_file, pya.Application.instance().main_window()) ui_file.close() # Install an event handler for the button clicked event diff --git a/src/lay/lay/macro_templates/qt_dialog.lym b/src/lay/lay/macro_templates/qt_dialog.lym index a97c7f8e1..681ce4701 100644 --- a/src/lay/lay/macro_templates/qt_dialog.lym +++ b/src/lay/lay/macro_templates/qt_dialog.lym @@ -32,7 +32,7 @@ layout.addWidget(@image) button = QPushButton.new('Screenshot', self) - button.setFont(QFont.new('Times', 18, QFont::Bold)) + button.setFont(QFont.new('Times', 18, QFont::Bold.to_i)) layout.addWidget(button) button.clicked do diff --git a/src/lay/lay/macro_templates/qt_dialog_python.lym b/src/lay/lay/macro_templates/qt_dialog_python.lym index 2291e0787..3e4cee917 100644 --- a/src/lay/lay/macro_templates/qt_dialog_python.lym +++ b/src/lay/lay/macro_templates/qt_dialog_python.lym @@ -49,7 +49,7 @@ class ScreenshotDialog(pya.QDialog): layout.addWidget(self.image) button = pya.QPushButton('Screenshot', self) - button.setFont(pya.QFont('Times', 18, pya.QFont.Bold)) + button.setFont(pya.QFont('Times', 18, int(pya.QFont.Bold))) layout.addWidget(button) # attach the event handler