qt-designer

How can I draw inside existing QGraphicsVIew?

孤者浪人 提交于 2019-12-18 17:32:11
问题 just like the title says i'm trying to draw inside an existing QGraphicsView. The window I generated using QT Designer, and I would like to draw a matrix of 16x16 squares inside the QGraphicsView . This is the code I have as of right now: Window: # -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'untitled.ui' # # Created by: PyQt5 UI code generator 5.8.2 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui

PyQt: how to load multiple .ui Files from Qt Designer

偶尔善良 提交于 2019-12-18 17:26:08
问题 I want to add startup window that when I click button, it will open another window and close current window. For each window, it has seperated UI which created from Qt Designer in .ui form. I load both .ui file via uic.loadUiType() . The first window(first UI) can normally show its UI but when I click button to go to another window, another UI (second UI) doesn't work. It likes open blank window. Another problem is if I load first UI and then change to second UI (delete that Class and change

Change rectangular Qt button to round

戏子无情 提交于 2019-12-18 12:26:46
问题 I'm trying to create a round button in Qt. A simple form with a single button QPushButton was created in designer. I'm attempting to turn this into a round button using setMask() . As soon as setMask() is applied the button disappeares. Does a custom widget need to be created to make a round button? #include "mainwindow.h" #include "ui_mainwindow.h" #include <QMessageBox> #include <QtGui/QPushButton> MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui-

Using QTDesigner with PyQT and Python 2.6

China☆狼群 提交于 2019-12-18 10:16:13
问题 I'm new to Python and am starting to teach myself GUI programming (hopefully) using PyQT4.7 and Python 2.6 I just downloaded the whole PyQT/QT4 package (including QTDesigner) from the PyQT website, however it seems QTDesigner, which looks amazing to use as a newbie (since you can see all the attributes/properties/defaults etc) of each widget and visually edit the properties is great, but PyQT seems not to set QTDesigner to integrate directly with with PyQT and PyQTs python code generation

How to reconstruct a .ui file from pyuic .py file

a 夏天 提交于 2019-12-18 05:17:09
问题 A while back I made a project using PyQt. I created some .ui files and generated the corresponding .py files using pyuic4. I want to start work on it again, but I have lost the .ui files (I formatted my PC and took a backup, but the .ui files were residing in the Qt designer folder and got lost). Is there any way I can restore those .ui files from the .py files generated? 回答1: It is possible to do this using QFormBuilder: from PyQt4 import QtCore, QtGui, QtDesigner from myui import Ui_Dialog

Displaying pop-up windows in Python (PyQt4)

China☆狼群 提交于 2019-12-18 04:25:15
问题 I need to know how to be able to make a dialog pop-up when a user clicks a button. I'm relatively new to both Python and PyQt/QtDesigner. I've only been using in them for about a month, but I think I have a good grasp. Here's what I have: A main dialog (which is the main part of the application), which I designed in QtDesigner. I converted the .ui to .py using pyuic4easy. Here's what I want to do: design a new dialog box in the QtDesigner and somehow make it pop up when a user clicks a button

Clear QLineEdit on click event

你离开我真会死。 提交于 2019-12-17 16:51:42
问题 I am very new to Python and Qt Designer. Using the given code, I want the user to enter text in the QLineEdit widget, press the Copy! button and see the inputted text replace the 'N/A' label. My questions is: following this procedure, how can I clear the text inputted in the QLineEdit widget with a simple mouse click? From what I read (this, this and this) it seems like I need to reimplement focusInEvent() in a new class extending QLineEdit. My problem is that the code for my GUI has been

QtDesigner changes will be lost after redesign User Interface

≡放荡痞女 提交于 2019-12-16 19:45:35
问题 I'm using QtDesinger for design GUI to use in python, after designing my desired UI in QtDesigner, convert it to python code and then I changed generated code to do some action in my python code, but if I changed the UI with QtDesigner and convert it to python code again, I lost my previous changes on my code. how can I solve the problem? can we Spreading a Class Over Multiple Files in python to write code in other files? 回答1: To avoid having these problems it is advisable not to modify this

QtDesigner changes will be lost after redesign User Interface

北慕城南 提交于 2019-12-16 19:44:17
问题 I'm using QtDesinger for design GUI to use in python, after designing my desired UI in QtDesigner, convert it to python code and then I changed generated code to do some action in my python code, but if I changed the UI with QtDesigner and convert it to python code again, I lost my previous changes on my code. how can I solve the problem? can we Spreading a Class Over Multiple Files in python to write code in other files? 回答1: To avoid having these problems it is advisable not to modify this

QDockWidget starting size

时光怂恿深爱的人放手 提交于 2019-12-13 19:04:30
问题 I'm somewhat stuck on what feels like it should be a simple problem. I've got QMainWindow with several QDockWidgets. The QDockWidget (_tree_dock in my code) starts in the LeftDockWidgetArea. It contains a QWidget (dockWidgetContents_2) which contains a QTreeWidget (_tree_view). I can resize/move around the QDockWidget at runtime without any problems, however, when the program starts up the QDockWidget is slightly too small. I'm able to shrink the QDockWidget quite a bit so I know it isn't at