qt-designer

Qt icons from resource file do not display

旧街凉风 提交于 2019-12-02 03:20:37
问题 I made a user interface using Qt Designer qith Qt 5.0.1, and I used icons from a resource file. After compiling, the executable runs perfectly fine, and the icons are displayed as expected. However, when I run the programme on a different computer, they mysteriously disappear, and I am not able to get them back. What can be the reason for this? I thought that the resources where hard-coded in the executable after compilation, but that may be wrong. In any case, I find it very peculiar that

Displaying 2nd Window Issue

不想你离开。 提交于 2019-12-02 02:51:15
I am dealing with 2 windows . One is created by Qt Designer and i import it on test.py program . what i did i make a Widget on the test program and than add a button to it and on click event I try to popup the other window(gui1.py) created by Qt Designer but it never pop ups and when i use break and do line by line debugging it shows me this message after running this command "myapp2 = MyForm()" on line number 35 test.py . QCoreApplication::exec: The event loop is already running and once i pressed enter on the terminal it pop up the other window . I am confuse where i am wrong . Thanks test

Qt icons from resource file do not display

断了今生、忘了曾经 提交于 2019-12-01 23:52:18
I made a user interface using Qt Designer qith Qt 5.0.1, and I used icons from a resource file. After compiling, the executable runs perfectly fine, and the icons are displayed as expected. However, when I run the programme on a different computer, they mysteriously disappear, and I am not able to get them back. What can be the reason for this? I thought that the resources where hard-coded in the executable after compilation, but that may be wrong. In any case, I find it very peculiar that wherever I move the executable, it displays the icons on my own computer, but not on another one's. I

pyqt button automatically binds to on_…_clicked function without connect or pyqtSlot

不想你离开。 提交于 2019-12-01 12:09:04
I've been using pyqt5 with qt-designer for some weeks now. I'm used to connect signals to handler functions with connect statements. Yesterday I made a piece of code that also automatically connected a button clicked signal to a handler function without a pyqtSlot decorator. Connecting the clicked signal to a function resulted in executing the function three times when clicking the button once. Deleting the connect statements resulted in twice executing the function when clicking the button once. Adding @pyqtSlot to the function resulted in normal one time execution. Renaming the handler

How to save a form from Qt Designer as a standalone app?

浪尽此生 提交于 2019-12-01 11:19:29
I have created a mock-up of a form in Qt Designer, and now I would like to save the form as a (exe?) file so that it can be run on the computer. Would I use 'Python to Exe' (if so, how)? I don't know much about programming yet. Qt Designer saves the files with a .ui extension. To create a standalone app with PyInstaller follow these steps: Save this code as your MyWidget.ui file: <?xml version="1.0" encoding="UTF-8"?> <ui version="4.0"> <class>MainWindow</class> <widget class="QMainWindow" name="MainWindow"> <property name="geometry"> <rect> <x>0</x> <y>0</y> <width>147</width> <height>125<

How to save a form from Qt Designer as a standalone app?

荒凉一梦 提交于 2019-12-01 09:29:03
问题 I have created a mock-up of a form in Qt Designer, and now I would like to save the form as a (exe?) file so that it can be run on the computer. Would I use 'Python to Exe' (if so, how)? I don't know much about programming yet. Qt Designer saves the files with a .ui extension. 回答1: To create a standalone app with PyInstaller follow these steps: Save this code as your MyWidget.ui file: <?xml version="1.0" encoding="UTF-8"?> <ui version="4.0"> <class>MainWindow</class> <widget class=

How to implement MousePressEvent for a Qt-Designer Widget in PyQt

你。 提交于 2019-12-01 08:46:47
问题 I've got a Widget (QTabeleWidget, QLabels and some QButtons). It was built in Qt-Designer, and now I have to implement some things. For that I need the mousePressEvent. Usually I would write a subclass and write something like this: def mousePressEvent(self, event): if event.button() == Qt.LeftButton: print "left" else: print 'right' But I don't know how to do that for a Widget created in the Designer. I need it for the QTabeleWidget. Hope someone can help me. I tried to solve the problem

QtDesigner & PySide: QTableWidget don't get accessible

人盡茶涼 提交于 2019-12-01 07:34:20
I made a form in QtDesigner. This form gets loaded from PySide with help of the function widget = loader.load(file, parent) However, the QTableWidget (with objectNname buffer_table) don't get accessible with widget.buffer_table If I use a QPushButton instead it works. How can I get this working. I'd like to fill up the table in Python. This is the ui-file i'd like to use: http://pastebin.com/6PZFrvmr EDIT: When I create a new table and try to load it, it seems to work. However, if I put it in a QTabWidget I can't access it. EDIT2: widget.findChild(QWidget, "buffer_table") : Search & find is

Qt Designer - How to connect a signal to a static function?

守給你的承諾、 提交于 2019-12-01 07:03:49
Okay I'm using Qt Designer to build a GUI. I've managed to figure out how to make the menuBar and I've added some actions to the bar, but now I need to connect the actions to make them do something. Specifically, on my file menu, I have the simple open action. I want this action to run a function that calls my QFileDialog and so on, but I don't know how to do this. So, how do I connect my actionOpen to my static function? I am using the latest Qt, 5.0.2 I'm a little frustrated here. This is obviously one of the most basic things someone might need to do, yet I cannot find any real solution to

Calling custom class in .ui file fails

前提是你 提交于 2019-12-01 06:40:51
问题 I get this error when I try to refer to my custom class from .ui file. What's wrong with what I do? "QFormBuilder was unable to create a custom widget of the class 'TimelinePane'; defaulting to base class 'QWidget'." QWidget pops up with the layout I'm specifying in .ui file. Problem is just the custom class. To add the custom class' description, I modified .ui file manually (added the entire <customwidgets> section), which is why I have to open a new question since I haven't found the same Q