Skip to content
  • 0 Votes
    7 Posts
    173 Views
    C

    You have placed the radio buttons in the layout of the widget that contains the QLabel image. Widgets in a layout are positioned at run time by the layout logic and will not overlap. If you want to position a QRadiobutton visibly on top of another widget (i.e on top of the QLabel image of Puerto Rico beach) then:

    The parent widget of the QRadioButtons should be the QLabel. This ensures the on-top-of element but cannot easily be achieved in Designer because it does not consider QLabel a container. The QRadioButtons cannot be in a layout. Positioning the buttons is absolute and you are responsible for adjusting it if the label is resized.

    It can be achieved with a bit of code. Either:

    Put the QRadioButtions into the Designer UI layout then, in the form widget code after calling setupUI(), change their parentage and position (which will be relative to the label content area). Leave the QRadioButtons out of the Designer UI then create and position the radio buttons after setupUI() Build the whole UI in code.
  • 0 Votes
    9 Posts
    270 Views
    Christian EhrlicherC

    @jdent said in How to create a plugin for QtDesigner?:

    I had to do this by hand

    That's the way it is - you also have to link against QtWidgets by hand even you put a widget in your ui file from the widgets library. There is no way a designer plugin can modify the build system.

  • 0 Votes
    9 Posts
    306 Views
    JonBJ

    @Rangerguy128
    As @Christian-Ehrlicher says we don't know what "normal" size means to you. If you mean you have an original image file with a certain size picture in it and you don't want the user to resize it bigger than this you could set the maximum size to the original size. You were asking about resizing originally, now you don't want it to resize, resizing when small but not too large, what precisely do you want or not want?

  • 0 Votes
    5 Posts
    393 Views
    M

    @fokhagyma
    QDesigner is not the best/fancy app in the world.

  • 0 Votes
    2 Posts
    164 Views
    SGaistS

    Hi and welcome to devnet,

    If you positioned everything by hand then you either have to redo that or position your widgets in your code for example in the resizeEvent method.

    Otherwise, the recommended way to work is to use layouts which automatically adapts to the size of your widget.

  • 0 Votes
    12 Posts
    3k Views
    J

    @jsulm I used to believe that the only way to create a C++ GUI was through Qt Design Studio, as I had never created anything in C++ other than console programs. I've created a GUI in Python in the past with it. However, I stumbled upon examples in Qt Creator that use .ui files. I'm familiar with this approach, having worked with UI and widgets before. I believe I'll continue using widgets since they don't show any errors when the program is executed.
    I will close this conversation as I no longer require assistance with qml. If I encounter any further issues, I'll post on a forum if I'm unable to resolve them myself. Thank you to everyone who tried to help me.

  • 0 Votes
    3 Posts
    598 Views
    CJhaC

    @JKSH Couldn't find a bug report for this issue so I created a new bug report: link

  • 0 Votes
    4 Posts
    486 Views
    SGaistS

    Hi,

    Check the file content
    Check the file permissions
    Etc.

  • 0 Votes
    2 Posts
    347 Views
    SGaistS

    Hi and welcome to devnet,

    Without a minimal code example showing what you do it's not possible to see what might be wrong.

  • 0 Votes
    3 Posts
    425 Views
    EmrecpE

    @jsulm I think this is for C++, I don't know how to use it on Python?

  • 0 Votes
    3 Posts
    548 Views
    I

    @JonB Thank you for interactions. Would you please show me an exact code of for example a PushButton and where to implement it. I am advanced python coder, I just need to see exact steps. Thank you very much.

  • 0 Votes
    2 Posts
    1k Views
    T

    I've developed a hackish workaround - if you're frustrated by this issue too, this "fix" is ugly but might help in the short-term:

    I noticed that Qt Creator still recognizes the old qmlRegisterType function calls if they're invoked from main in a project. So naturally, I made a custom compiler step for qmake that generates a header file with all QML_ELEMENT-tagged classes registered in a function.

    First, make sure you've set up qmltypes in your project as usual - your QML_IMPORT_NAME and all that is set.

    Add to the bottom of MyProject.pro:

    type_registrar_unfucker.name = type_registrar_unfucker type_registrar_unfucker.input = TYPE_REGISTRAR_SOURCES type_registrar_unfucker.commands = python3 $$PWD/type_unfuck.py ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT} $$QML_IMPORT_NAME $$QML_IMPORT_MAJOR_VERSION type_registrar_unfucker.output = ${QMAKE_FILE_IN_BASE}.h type_registrar_unfucker.clean = ${QMAKE_FILE_IN_BASE}.h type_registrar_unfucker.variable_out = HEADERS QMAKE_EXTRA_COMPILERS += type_registrar_unfucker TYPE_REGISTRAR_SOURCES += $$OUT_PWD/myproject_metatypes.json

    Add as type_unfuck.py in your source directory:

    # type unfuck # ----------- # This python script deals with the issue of Qt Creator not being able to recognize element types # registered using 'QML_ELEMENT'. # # It does so by generating a header, 'myprojectname_metatypes.h'. # Include this header ONLY in main.cpp, and then call `registerTypes()` first thing in `main`. # Then, Qt Creator will stop whining. import sys import json source_path = sys.argv[1] dest_path = sys.argv[2] import_name = sys.argv[3] import_major = sys.argv[4] with open(source_path) as f: data = json.load(f) includes = ["QtQml"] types = [] for file in data: includes.append(file["inputFile"]) for type in file["classes"]: if "classInfos" in type and {"name":"QML.Element","value":"auto"} in type["classInfos"]: types.append(type["className"]) with open(dest_path, 'w') as f: for i in includes: f.write(f'#include <{i}>\n') f.write('void registerTypes() {\n') for t in types: f.write(f'\tqmlRegisterType<{t}>("{import_name}", {import_major}, 0, "{t}");\n') f.write('}\n')

    Then, just add #include <myproject_metatypes.h> to your project's main.cpp and invoke registerTypes(); immediately in your main function. Build your project, then click on Tools -> QML/JS -> Reset Code Model, and Qt Creator should now recognize your custom components correctly.

  • 0 Votes
    4 Posts
    1k Views
    A

    @jsulm Hello! Sorry, but that doesn't work. I tried to insert a loop in different places, but the result remains the same. I also tried to display the main widget.
    Снимок экрана от 2019-11-27 08-27-43.png

    @SGaist Hello. So the VideoWindow.h file (VideoWindow class) is my custom widget. This is the first piece of code that I presented.

  • 0 Votes
    1 Posts
    298 Views
    No one has replied
  • 0 Votes
    2 Posts
    2k Views
    I

    @anp405, my first guess would be that by setting PYTHONPATH you are losing the location of PyQt5 package. This depends on your Python and environment setup, but if there is some PYTHONPATH existing, you are overriding it completely instead of complementing. You can verify this by opening a new command line session, setting PYTHONPATH to wherever your code sets it, then running Python interpreter and trying to import PyQt5.

    Another guess would be that your child process uses different Python environment (e.g. built-in system Python 2), which does not have PyQt5 installed in its site-packages.

  • 0 Votes
    9 Posts
    4k Views
    S

    Thanks for your help with this. The Qt Creator editor is a good alternative. I did run Dependency Walker - long time since I have looked at the output from this and not sure what I am seeing right now, but I've pasted the an abreviated version of the output below (too long to paste the whole thing) if it tells you something. Thanks again.

    | System Information |

    | Search Order |

    * Legend: F File E Error (path not valid) * *

    Side-by-Side components (Windows 2000/XP/2003/Vista/+)
    [F ] c:\windows\winsxs\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.14393.2938_none_c58b03c797c07d8c\COMCTL32.DLL
    [F ] c:\windows\winsxs\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.14393.2969_none_f678e0c2f2505d00\GDIPLUS.DLL
    The system's "KnownDLLs" list
    [F ] c:\windows\system32\ADVAPI32.DLL
    [F ] c:\windows\system32\BCRYPTPRIMITIVES.DLL
    [F ] c:\windows\system32\CFGMGR32.DLL
    [F ] c:\windows\system32\CLBCATQ.DLL
    [F ] c:\windows\system32\COMBASE.DLL
    [F ] c:\windows\system32\COMCTL32.DLL
    [F ] c:\windows\system32\COMDLG32.DLL
    [F ] c:\windows\system32\COML2.DLL
    [F ] c:\windows\system32\CRYPT32.DLL
    [F ] c:\windows\system32\DIFXAPI.DLL
    [F ] c:\windows\system32\GDI32.DLL
    [F ] c:\windows\system32\GDI32FULL.DLL
    [F ] c:\windows\system32\GDIPLUS.DLL
    [F ] c:\windows\system32\IMAGEHLP.DLL
    [F ] c:\windows\system32\IMM32.DLL
    [F ] c:\windows\system32\KERNEL.APPCORE.DLL
    [F ] c:\windows\system32\KERNEL32.DLL
    [F ] c:\windows\system32\KERNELBASE.DLL
    [F ] c:\windows\system32\LPK.DLL
    [F ] c:\windows\system32\MSASN1.DLL
    [F ] c:\windows\system32\MSCTF.DLL
    [F ] c:\windows\system32\MSVCP_WIN.DLL
    [F ] c:\windows\system32\MSVCRT.DLL
    [F ] c:\windows\system32\NORMALIZ.DLL
    [F ] c:\windows\system32\NSI.DLL
    [F ] c:\windows\system32\NTDLL.DLL
    [F ] c:\windows\system32\NTDLL.DLL
    [F ] c:\windows\system32\OLE32.DLL
    [F ] c:\windows\system32\OLEAUT32.DLL
    [F ] c:\windows\system32\POWRPROF.DLL
    [F ] c:\windows\system32\PROFAPI.DLL
    [F ] c:\windows\system32\PSAPI.DLL
    [F ] c:\windows\system32\RPCRT4.DLL
    [F ] c:\windows\system32\SECHOST.DLL
    [F ] c:\windows\system32\SETUPAPI.DLL
    [F ] c:\windows\system32\SHCORE.DLL
    [F ] c:\windows\system32\SHELL32.DLL
    [F ] c:\windows\system32\SHLWAPI.DLL
    [F ] c:\windows\system32\UCRTBASE.DLL
    [F ] c:\windows\system32\USER32.DLL
    [F ] c:\windows\system32\WIN32U.DLL
    [F ] c:\windows\system32\WINDOWS.STORAGE.DLL
    [F ] c:\windows\system32\WINTRUST.DLL
    [F ] c:\windows\system32\WLDAP32.DLL
    [F ] c:\windows\system32\WOW64.DLL
    [F ] c:\windows\system32\WOW64CPU.DLL
    [F ] c:\windows\system32\WOW64WIN.DLL
    [F ] c:\windows\system32\WS2_32.DLL
    The application directory
    [ ] C:\Qt\5.12.3\msvc2015_64\bin
    The 32-bit system directory
    [ ] C:\Windows\system32
    The 16-bit system directory (Windows NT/2000/XP/2003/Vista/+)
    [ ] C:\Windows\system
    The system's root OS directory
    [ ] C:\Windows
    The application's registered "App Paths" directories
    The system's "PATH" environment variable directories
    [ ] C:\Program Files\Microsoft MPI\Bin
    [ ] C:\Windows\system32
    [ ] C:\Windows
    [ ] c:\Qt\5.12.3\bin\

    | Module Dependency Tree |

    * Legend: F Forwarded Module ? Missing Module 6 64-bit Module * D Delay Load Module ! Invalid Module * * Dynamic Module E Import/Export Mismatch or Load Failure * ^ Duplicate Module * *

    [ 6] DESIGNER.EXE
    [ 6] QT5DESIGNERCOMPONENTS.DLL
    [ ^6] QT5DESIGNER.DLL
    [ ^6] QT5WIDGETS.DLL
    [ ^6] QT5GUI.DLL
    [ ^6] QT5XML.DLL
    [ ^6] QT5CORE.DLL
    [ E ] KERNEL32.DLL
    [FE ] NTDLL.DLL
    [ E ] VCRUNTIME140.DLL
    [ ^6] API-MS-WIN-CRT-RUNTIME-L1-1-0.DLL
    [FE ] UCRTBASE.DLL
    [ ^6] API-MS-WIN-CRT-STRING-L1-1-0.DLL
    [FE ] UCRTBASE.DLL
    [ ^6] API-MS-WIN-CRT-HEAP-L1-1-0.DLL
    [FE ] UCRTBASE.DLL
    [ 6] QT5DESIGNER.DLL
    [ ^6] QT5WIDGETS.DLL
    [ ^6] QT5GUI.DLL
    [ ^6] QT5XML.DLL
    [ ^6] QT5CORE.DLL
    [ E ] MSVCP140.DLL
    [ E ] VCRUNTIME140.DLL
    [ ^6] API-MS-WIN-CRT-HEAP-L1-1-0.DLL
    [FE ] UCRTBASE.DLL
    [ ^6] API-MS-WIN-CRT-LOCALE-L1-1-0.DLL
    [FE ] UCRTBASE.DLL
    [ ^6] API-MS-WIN-CRT-STRING-L1-1-0.DLL
    [FE ] UCRTBASE.DLL
    [ ^6] API-MS-WIN-CRT-RUNTIME-L1-1-0.DLL
    [FE ] UCRTBASE.DLL
    [ ^6] API-MS-WIN-CRT-STDIO-L1-1-0.DLL
    [FE ] UCRTBASE.DLL
    [ E6] API-MS-WIN-CRT-MATH-L1-1-0.DLL
    [FE ] UCRTBASE.DLL
    [ ^6] API-MS-WIN-CRT-CONVERT-L1-1-0.DLL
    [FE ] UCRTBASE.DLL
    [ ^6] API-MS-WIN-CRT-FILESYSTEM-L1-1-0.DLL
    [FE ] UCRTBASE.DLL
    [ ^6] API-MS-WIN-CRT-TIME-L1-1-0.DLL
    [FE ] UCRTBASE.DLL
    [ ^6] API-MS-WIN-CRT-ENVIRONMENT-L1-1-0.DLL
    [FE ] UCRTBASE.DLL
    [ ^6] API-MS-WIN-CRT-UTILITY-L1-1-0.DLL
    [FE ] UCRTBASE.DLL
    [ E ] KERNEL32.DLL
    [FE ] NTDLL.DLL
    [DE ] CONCRT140.DLL
    [ E ] MSVCP140.DLL
    [ E ] VCRUNTIME140.DLL
    [ ^6] API-MS-WIN-CRT-RUNTIME-L1-1-0.DLL
    [FE ] UCRTBASE.DLL
    [ ^6] API-MS-WIN-CRT-HEAP-L1-1-0.DLL
    [FE ] UCRTBASE.DLL
    [ E6] API-MS-WIN-CRT-MATH-L1-1-0.DLL
    [ ^6] API-MS-WIN-CRT-STRING-L1-1-0.DLL
    [FE ] UCRTBASE.DLL
    [ ^6] API-MS-WIN-CRT-STDIO-L1-1-0.DLL
    [FE ] UCRTBASE.DLL
    [ E ] KERNEL32.DLL
    [FE ] NTDLL.DLL
    [ E ] KERNEL32.DLL
    [FE ] NTDLL.DLL
    [ E ] VCRUNTIME140.DLL
    [ ^6] API-MS-WIN-CRT-MATH-L1-1-0.DLL
    [FE ] UCRTBASE.DLL
    [ ^6] API-MS-WIN-CRT-RUNTIME-L1-1-0.DLL
    [FE ] UCRTBASE.DLL
    [ ^6] API-MS-WIN-CRT-STRING-L1-1-0.DLL
    [FE ] UCRTBASE.DLL
    [ ^6] API-MS-WIN-CRT-STDIO-L1-1-0.DLL
    [FE ] UCRTBASE.DLL
    [ ^6] API-MS-WIN-CRT-HEAP-L1-1-0.DLL
    [FE ] UCRTBASE.DLL
    [ 6] QT5PRINTSUPPORT.DLL
    [ ^6] QT5WIDGETS.DLL
    [ ^6] QT5GUI.DLL
    [ ^6] QT5CORE.DLL
    [ E ] WINSPOOL.DRV
    [ E ] COMDLG32.DLL
    [ E ] GDI32.DLL
    [ E ] USER32.DLL
    [ E ] KERNEL32.DLL
    [FE ] NTDLL.DLL
    [ E ] VCRUNTIME140.DLL
    [ ^6] API-MS-WIN-CRT-STDIO-L1-1-0.DLL
    [FE ] UCRTBASE.DLL
    [ ^6] API-MS-WIN-CRT-HEAP-L1-1-0.DLL
    [FE ] UCRTBASE.DLL
    [ ^6] API-MS-WIN-CRT-MATH-L1-1-0.DLL
    [FE ] UCRTBASE.DLL
    [ ^6] API-MS-WIN-CRT-RUNTIME-L1-1-0.DLL
    [FE ] UCRTBASE.DLL
    [ 6] QT5WIDGETS.DLL
    [ ^6] QT5GUI.DLL
    [ ^6] QT5CORE.DLL
    [ E ] UXTHEME.DLL
    [ E ] MSVCRT.DLL
    [ ? ] API-MS-WIN-CORE-LIBRARYLOADER-L1-2-0.DLL
    [ E6] API-MS-WIN-CORE-SYNCH-L1-2-0.DLL
    [FE ] KERNEL32.DLL
    [FE6] API-MS-WIN-CORE-SYNCH-L1-1-0.DLL
    [ ? ] API-MS-WIN-CORE-HEAP-L1-2-0.DLL
    [ ? ] API-MS-WIN-CORE-ERRORHANDLING-L1-1-1.DLL
    [ ? ] API-MS-WIN-CORE-PROCESSTHREADS-L1-1-2.DLL
    [ ? ] API-MS-WIN-CORE-LOCALIZATION-L1-2-1.DLL
    [ ? ] API-MS-WIN-CORE-DEBUG-L1-1-1.DLL
    [ ^6] API-MS-WIN-CORE-HANDLE-L1-1-0.DLL
    [FE ] KERNEL32.DLL
    [ ? ] API-MS-WIN-CORE-SYSINFO-L1-2-1.DLL
    [ ? ] API-MS-WIN-CORE-LIBRARYLOADER-L1-2-2.DLL
    [ ? ] API-MS-WIN-CORE-FILE-L1-2-1.DLL
    [ ^6] API-MS-WIN-CORE-STRING-L1-1-0.DLL
    [FE ] KERNEL32.DLL
    [ ^6] API-MS-WIN-CORE-UTIL-L1-1-0.DLL
    [FE ] KERNEL32.DLL
    [FE ] NTDLL.DLL
    [ ? ] API-MS-WIN-CORE-WINRT-ERROR-L1-1-1.DLL
    [ ? ] API-MS-WIN-CORE-REGISTRY-L1-1-0.DLL
    [ ? ] API-MS-WIN-SECURITY-BASE-L1-2-0.DLL
    [ ? ] API-MS-WIN-CORE-HEAP-L2-1-0.DLL
    [ ? ] API-MS-WIN-CORE-MEMORY-L1-1-2.DLL
    [ ^6] API-MS-WIN-CORE-PROFILE-L1-1-0.DLL
    [FE ] KERNEL32.DLL
    [ ? ] API-MS-WIN-CORE-STRING-L2-1-0.DLL
    [ ? ] API-MS-WIN-CORE-PROCESSENVIRONMENT-L1-2-0.DLL
    [ ^6] API-MS-WIN-CORE-TIMEZONE-L1-1-0.DLL
    [FE ] KERNEL32.DLL
    [ ? ] API-MS-WIN-CORE-SIDEBYSIDE-L1-1-0.DLL
    [ ? ] API-MS-WIN-CORE-ATOMS-L1-1-0.DLL
    [ ? ] API-MS-WIN-CORE-KERNEL32-LEGACY-L1-1-1.DLL
    [ ? ] API-MS-WIN-CORE-STRING-OBSOLETE-L1-1-0.DLL
    [ ? ] API-MS-WIN-CORE-SHLWAPI-OBSOLETE-L1-2-0.DLL
    [ ? ] API-MS-WIN-CORE-LOCALIZATION-OBSOLETE-L1-3-0.DLL
    [ E ] NTDLL.DLL
    [ E ] GDI32.DLL
    [ E ] USER32.DLL
    [FE ] NTDLL.DLL
    [ ? ] API-MS-WIN-CORE-DELAYLOAD-L1-1-1.DLL
    [D? ] API-MS-WIN-CORE-COM-L1-1-1.DLL
    [DE ] OLEAUT32.DLL
    [D? ] API-MS-WIN-CORE-WINRT-STRING-L1-1-0.DLL
    [D? ] API-MS-WIN-SECURITY-SDDL-L1-1-0.DLL
    [DE ] CRYPTSP.DLL
    [DE ] DWMAPI.DLL
    [DE ] WINDOWSCODECS.DLL

    ...

    | Module List |*

    * Legend: D Delay Load Module ? Missing Module 6 64-bit Module * * Dynamic Module ! Invalid Module * E Import/Export Mismatch or Load Failure * * Module File Time Stamp Link Time Stamp File Size Attr. Link Checksum Real Checksum CPU Subsystem Symbols Preferred Base Actual Base Virtual Size Load Order File Ver Product Ver Image Ver Linker Ver OS Ver Subsystem Ver

    [ ? ] API-MS-WIN-CORE-APIQUERY-L1-1-0.DLL Error opening file. The system cannot find the file specified (2).
    [ ? ] API-MS-WIN-CORE-APPCOMPAT-L1-1-1.DLL Error opening file. The system cannot find the file specified (2).
    [ ? ] API-MS-WIN-CORE-APPINIT-L1-1-0.DLL Error opening file. The system cannot find the file specified (2).
    [ ? ] API-MS-WIN-CORE-ATOMS-L1-1-0.DLL Error opening file. The system cannot find the file specified (2).
    [ ? ] API-MS-WIN-CORE-CALENDAR-L1-1-0.DLL Error opening file. The system cannot find the file specified (2).
    [ ? ] API-MS-WIN-CORE-COM-L1-1-0 Error opening file. The system cannot find the file specified (2).
    [ ? ] API-MS-WIN-CORE-COM-L1-1-1.DLL Error opening file. The system cannot find the file specified (2).
    [ ? ] API-MS-WIN-CORE-COM-MIDLPROXYSTUB-L1-1-0.DLL Error opening file. The system cannot find the file specified (2).

    | Log |*

    Error: At least one required implicit or forwarded dependency was not found.
    Error: At least one module has an unresolved import due to a missing export function in an implicitly dependent module.
    Error: Modules with different CPU types were found.
    Error: A circular dependency was detected.
    Warning: At least one delay-load dependency module was not found.
    Warning: At least one module has an unresolved import due to a missing export function in a delay-load dependent module.

  • 0 Votes
    1 Posts
    379 Views
    No one has replied
  • 0 Votes
    2 Posts
    791 Views
    mrjjM

    Hi
    the include in the ui_ comes from
    QString WorldTimeClockPlugin::includeFile() const
    {
    return QStringLiteral("worldtimeclock.h");
    }

    but it seems the error contains no filename ??

  • 0 Votes
    10 Posts
    4k Views
    G

    Well, I found the problem.
    The menu command for Designer has this syntax:

    /usr/bin/qtchooser -run-tool=assistant -qt=qt5

    I replace it with the path where is located designer:

    /home/glafauci/Programmi/Qt/5.10.0/gcc_64/bin/designer

    Now it work fine.

    Thanks to all.

  • 0 Votes
    2 Posts
    1k Views
    Pablo J. RoginaP

    @Ilan

    My question is what method of the widget does the Qt designer use for showing

    If you mean Qt Designer showing your custom widget in the toolbox along default widgets (i.e. QLabel, QLineEdit, etc.) I guess you may need to create a plugin for Qt Designer from your custom widget. Qt Designer used a plugin based approach, see here.