qt-designer

Generate .h and .cpp from .ui file

左心房为你撑大大i 提交于 2019-11-30 05:12:29
Suppose I have the file about.ui . How can I make the "about.h" and the "about.cpp" from my .ui file? I have to create a .moc file too? How can I compile this after the creaton to see if all ocurred correctly? If automatic generation does not work (like in my case) you can use uic to generate the header file manually. uic file.ui > file.h You don't. The about.ui generates a ui_about.h which you include in your own about.h You then create you own class deriving from this class class about : public QDialog, public Ui::about { Q_OBJECT; .... } Short answer: In QtCreator there are two ways of

Python Win 3.6.0 x64 issue, missing qt designer exe after pip3 install pyqt5

╄→尐↘猪︶ㄣ 提交于 2019-11-30 04:50:30
问题 I'm a Python newbie and trying to start my first application and am struggling to workout how to use Qt Designer with pyQT5. I've been using the next command which installs pyqt5.7.1: pip3 install pyqt5 After the install, I have a C:\Python36\Lib\site-packages\PyQt5\Qt\bin\Qt5Designer.dll file but no Qt Designer exe as far as i can tell. id really appreciate the help if anyone has any idea what i'm missing? Do I have to install the full Qt5 framework to be able to use Qt Designer and pyQT5?

How to change the caption of a button in a QDialogButtonBox?

流过昼夜 提交于 2019-11-30 00:43:45
问题 I have added a QDialogButtonBox button with the default Cancel and OK buttons. Is there a way to change the caption of these buttons? For example, OK should become Run . 回答1: You will have to do some slight coding in your cpp file: ui->buttonBox->button(QDialogButtonBox::Ok)->setText("Run"); ui->buttonBox->button(QDialogButtonBox::Cancel)->setText("Exit"); Note that you may also need to include the QPushButton header: #include <QPushButton> Update: Did not notice the pyqt tag. I'm not

Using QTDesigner with PyQT and Python 2.6

眉间皱痕 提交于 2019-11-29 19:54:59
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 scripts: i.e.: Hitting "View Code", tries to run the Designer->C++ script called (uic) instead of the

MVC design with Qt Designer and PyQt / PySide

南笙酒味 提交于 2019-11-29 19:46:16
Python newbie coming from Java (+SWT/Windowbuilder) and am having difficulty working out how to properly code a large desktop app in Python/Qt4(QtDesigner)/PySide. I would like to keep any view logic in a controller class outside the .ui file (and it's .py conversion). Firstly as then the logic is independent of GUI framework and secondly as the .ui and resultant .py file get overwritten on any changes!. Only examples I've found add action code to a monolithic MainWindow.py (generated from ui) or a MyForm.py (also generated from .ui). I can't see any way to link a POPO controller class to

Inserting an image in GUI using QT Designer

人盡茶涼 提交于 2019-11-29 16:58:36
问题 I am new to QtDesigner. I wanted to know how to insert an image in the GUI using QT Designer. I am trying to add a logo. Help would be appreciated. 回答1: You can start inserting a label. Next, you right click on it an then click "change rich text...". A new window will pop-up. Click on the figure Icon "Insert figure". Now, you have to create a resource file. Click on the Pencil button. Next, click on the "New resource file" button. Choose a name and a folder (your working directory would be a

A .py file which compiled from .qrc file( using pyside-rcc ) does not work

不羁岁月 提交于 2019-11-29 14:07:05
I am working on python project and I have a problem with my .py file which complied from .qrc file. First, let I explain briefly about my project. I created my project GUI in QtDesigner and also use the image in the GUI. Then, I generate .py from .ui file using pyside-uic and generate .py file from .qrc file using pyside-rcc. The problem is when I use the .py file (an image file), images does not show in my GUI. Is anybody knows how to solve this problem? Thank you for all your answer. :) Ps. I use PySide as my GUI language. Have you actually added the resource to your GUI project? Starting

How to insert QChartView in form with Qt Designer?

谁说我不能喝 提交于 2019-11-29 09:20:21
I want to add QChart to the form. But I can't find it in the Widget Box. So I created it in the code. How can I insert it in QWidget or QFrame or something else? I want to set area of that widget in QtDesigner. Option 1: Promoted I suppose you mean inserting a QChartView, because QChartView inherits from QGraphicsView, this would be a good option, for this we do the following: first add QT += charts in the .pro place the QGraphicsView to the design. Right click on the QGraphicsView and select Promote to... When doing the above, a menu appears, in the menu it should be set in QChartView in

How to manage QSplitter in Qt Designer

假装没事ソ 提交于 2019-11-29 05:27:47
When I press a button, I bring up a dialog where user select things and press 'Ok' at the end. I want a splitter in this dialog. Left pane will show tree and right will show something else. How do I do that right? From Qt example itself: QSplitter *splitter = new QSplitter(parent); QListView *listview = new QListView; QTreeView *treeview = new QTreeView; QTextEdit *textedit = new QTextEdit; splitter->addWidget(listview); splitter->addWidget(treeview); splitter->addWidget(textedit); So in this example, splitter is created without any dialog resource. If I have to create this way, that would

How to create new PyQt4 windows from an existing window?

杀马特。学长 韩版系。学妹 提交于 2019-11-29 03:42:38
问题 I've been trying to call a new window from an existing one using python3 and Qt4. I've created two windows using Qt Designer (the main application and another one), and I've converted the .ui files generated by Qt Designer into .py scripts - but I can't seem to create new windows from the main application. I tried doing this: ############### MAIN APPLICATION SCRIPT ################ from PyQt4 import QtCore, QtGui import v2 try: _fromUtf8 = QtCore.QString.fromUtf8 except AttributeError: