Questions tagged [uic]

UIC is the User Interface Compiler for Qt. The uic reads an XML format user interface definition (.ui) file and creates a C++ header file.

UIC is the User Interface Compiler for Qt. The uic reads an XML format user interface definition (.ui) file and creates a C++ header file.

45 questions
6
votes
3 answers

How to purge QMainWindow's geometry tag in Qt Designer UI files

Qt Designer adds a geometry tag that contains the widget's default size in absolute units (pixels). This is really annoying because if you edit a ui file on a 4k monitor all of your uis will (by default) display with massive white space on a lower…
Mikhail
  • 7,749
  • 11
  • 62
  • 136
4
votes
1 answer

Customising code of Qt designer widget?

I need to add some features to a graphics widget in a form I created using the Qt Designer. For example I would normally do something like this: class custom_gv(QGraphicsView): def __init__(self): super().__init__() def…
John O'Neil
  • 355
  • 1
  • 5
  • 15
3
votes
0 answers

How to load Qt Designer UI file

import sys from PyQt5.uic import loadUi from PyQt5 import QtWidgets from PyQt5.QtWidgets import QDialog, QApplication, QWidget from PyQt5.QtGui import QPixmap from PyQt5 import uic class WelcomeScreen(QDialog): def __init__(self): …
pirateSteel
  • 39
  • 1
  • 4
3
votes
1 answer

CMake Qt5 and AUTOUIC not rebuilding when .ui file touched

I have a Qt5 project, using CMake with AUTOUIC, AUTOMOC, and AUTORCC. My problem is that if I change one of the .ui files, I expect UIC to run and produce the corresponding ui_XXX.h file. It doesn't. I have the .ui files listed in my add_library(...…
James
  • 148
  • 1
  • 7
3
votes
1 answer

how to make GUI Qt project with cmake in Qt Creator with .ui files

I want to created a project that uses cmake as it's build system sn QTCreator . ├── CMakeLists.txt ├── CMakeLists.txt.user ├── main.cpp ├── notepad.cpp ├── notepad.h └── notepad.ui here is my cmake file:- cmake_minimum_required(VERSION…
user9074174
3
votes
1 answer

CMake Qt UIC failed

I'm currently porting my project from qmake to CMake and I'm facing a problem with Qt UIC which tries to process a UI file that does not exist instead of the actual file I want it to process. I have the following file hierarchy: . |___…
Nico
  • 168
  • 2
  • 12
3
votes
1 answer

QT creator how to make an UI generated class inherit other class?

We know that, when use QT creator to build a project with a ui file (eg. mainwindow.ui), it will automatically generate a .h file with a class definition (eg. ui_mainwindow.h) for that .ui file. The generated class in the .h will be as follow: My…
ricky
  • 2,058
  • 4
  • 23
  • 49
3
votes
1 answer

How do I load children from .ui file in PySide?

For now I'm loading them like this: if __name__ == '__main__': app = QApplication(sys.argv) loader = QUiLoader() file = QFile('main.ui') file.open(QFile.ReadOnly) window = loader.load(file) file.close() window.show() …
Necronomicron
  • 1,150
  • 4
  • 24
  • 47
1
vote
1 answer

Why does Qt complain about invalid XML version in ui file

I'm trying to port an application from PyQt5 to PySide6 because it's the official bindings (for now I guess). I have a .ui file designed in Qt Designer. It loads fine using PyQt5 uic, but PySide6 gives me the following error: Designer: An error has…
noel
  • 2,257
  • 3
  • 24
  • 39
1
vote
1 answer

How to fix missing resource imports when using pyside2-uic

The tool offers no help whatsoever what the argument does and a colleague of mine is facing the issue of having to add the Python module generated by processing a QRC file (pyside2-rcc) to the Python module generated by processing the UI file…
rbaleksandar
  • 8,713
  • 7
  • 76
  • 161
1
vote
1 answer

PyQt5: using loadUi with promoted widgets from Qt Designer

Complete newbie to Qt and Qt Designer. I tried following some tutorials online to figure a way to embed matplotlib graph in Qt. Apparently the approach is to use subclass of QWidget which is done by "promoting" the QWidget. I tried the approach…
XYZ
  • 310
  • 2
  • 12
1
vote
0 answers

Can Qt's `moc` and/or `uic` be made to treat warnings as errors?

As we've worked to move more and more of our codebase to a warnings-as-errors model, one thing I've noticed is that warnings spit out by uic and moc still slip through uncaught. Things like: foo.ui: Warning: The name 'widget' (QWidget) is already in…
Parker Coates
  • 8,520
  • 3
  • 31
  • 37
1
vote
1 answer

Pyqt5 uic module not found

I am trying to import loadui library in pycharm.I have already pip install pyqt5 and pyqt5-tools.But when I try to import loadui with from PyQt5.uic import loadUi this code it is giving me Unresolved reference 'LoadUi' and Cannot find reference…
1
vote
2 answers

Qt6 migration - UIC generated code fails to compile (connect slots) - updated

I'm trying to port my project from Qt5 to Qt6. My problem is that UIC generated code looks like this: QObject::connect(SelectHome, &QToolButton::clicked, toQPSQLSettingUI, qOverload<>(&QWidget::selectHome)); MSVC2019 compilations fails…
ibre5041
  • 4,903
  • 1
  • 20
  • 35
1
vote
2 answers

python generator missing in uic while trying to convert .ui file to .py

I'm trying to convert a .ui file into a python file using uic file.ui -o file.py and other combinations of that, but even though the generated file is a .py file, the code that's in it is c++. After some googling and researching some uic prefixes I…
starGazer
  • 84
  • 1
  • 1
  • 5
1
2 3