我使用编译并运行的Qt Designer创建了一个GUI.
然后我在GUI中做了一些更改并重新编译,但GUI保持不变.
即使我删除小部件并重新编译它们也会出现......
我试过Clean All和Clean Project,但没有成功......
可能是什么问题?
这可能是一个非常愚蠢的问题,但我在Qt Designer中找不到QTabBar."容器"组中有QTabWidged,但它不一样 - 我不需要不同的页面,我只需要标签栏.
(我在debian上使用KDE4下的Qt Designer 4.7.2版本.)
我仍然在为我的数据库的GUI工作,现在我有一个不同的错误:
Traceback (most recent call last):
File "G:\Python\Database Kast Thuis\PyQt Test\MainMenu_ui.py", line 84, in <module>
ex = Ui_MainWindow()
File "G:\Python\Database Kast Thuis\PyQt Test\MainMenu_ui.py", line 16, in __init__
self.setupUi(self)
File "G:\Python\Database Kast Thuis\PyQt Test\MainMenu_ui.py", line 55, in setupUi
MainWindow.setCentralWidget(self.centralwidget)
AttributeError: 'Ui_MainWindow' object has no attribute 'setCentralWidget'
Run Code Online (Sandbox Code Playgroud)
我不了解PyQt的事情,所以我不明白问题是什么.
代码是:(这是编辑版本,原始版本发布如下)
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'Main_Menu.ui'
#
# Created by: PyQt5 UI code generator 5.5.1
#
# WARNING! All changes made in this file will …Run Code Online (Sandbox Code Playgroud) 我正在尝试集成pydev,pyqt,python和eclipse.现在代码可以正常运行而不会出错.我知道在Qt Designer中制作GUI.然后在Eclipse中修改它.
现在我想将PyQt的Qt Designer集成到Eclipse中.就像Qt Eclipse Integration for C++一样.在Eclipse中使用PyQt Designer.任何人都可以教我怎么做吗?非常感谢!
顺便说一下,我试着在Eclipse中设置qt项目的首选项.
但是当我添加新的qt版本时.我不知道如何借用bin路径.因为PyQt中没有bin路径.并且没有qmake,uic,rcc等我输入的版本名称是PyQt-Py2.7-x64-gpl-4.8.5-1.exe.我借用了包含C:\ python27\Lib\site-packages\PyQt4\Sib\PyQt4的包含路径.
我的操作系统是win7.谢谢你的回答!上帝祝福你!
我试图将按钮的click()信号连接到我自己的函数.该按钮位于我使用QT Designer创建的小部件中.我用QUiLoader加载.ui文件,如下所示:
class MyWidget(QtGui.QMainWindow):
def __init__(self, *args):
QtGui.QMainWindow.__init__(self, *args)
loader = QtUiTools.QUiLoader()
file = QtCore.QFile("pyside_ui_qtdesigner_form_test.ui")
file.open(QtCore.QFile.ReadOnly)
self.myWidget = loader.load(file, self)
file.close()
self.setCentralWidget(self.myWidget)
btn = self.myWidget.findChild(QtGui.QPushButton, "HelloWorldButton")
btn.clicked.connect(self.slot1)
def slot1(self):
print "Received"
Run Code Online (Sandbox Code Playgroud)
这是连接按钮clicked()信号的正确方法吗?我看到我可以直接在Qt Designer中连接信号和插槽,但是我如何准备并在代码中进行这样的连接?附带问题:上面的代码有效,但主窗口显示错误的大小.如何确保尺寸合适?我应该用最小的高度/宽度限制来做到这一点吗?
在标签页中,我在垂直布局中有一个树视图小部件和一个标签小部件,我想将60%的屏幕空间设置为树视图,将40%设置为标签小部件.我怎么能在Qt Designer中做到这一点?
平台:Qt Creator 2.4.1/Win 7.
我正在尝试仅使用Python为Qt Designer编写自定义小部件.我正在关注我在网上找到的几个教程,但是没有一个是在工作或者我认为最接近工作的例子.
所以我的问题是:
我有一个Qt4应用程序,菜单条目有快捷方式(没有什么花哨的东西,比如Ctrl+ O 打开文件,Ctrl+ S保存......).使用Qt5编译时,虽然操作附加到菜单栏,但快捷方式不起作用.
如果我将它们添加到工具栏中,它们会再次工作.
有一种简单的方法可以使它工作吗?我还可以将所有这些操作添加到附加到主窗口的操作列表中,但这很容易出错.
Ivan做了这个 - 请参阅http://ivan.fomentgroup.org/blog/2009/03/29/instant-chrome/ - 但我不知道自从我是Qt的新手以来.有没有人有想法如何实现这一目标?

我是Python的初学者。我试图开发简单的货币程序,但是我有问题。有人可以帮我吗?当我单击“Çevir”时,程序应计算货币(如兑换)。但是我做不到。当我单击“Çevir”时,PyCharm会写“进程以退出代码1完成”
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtGui import QIcon
from PyQt5.QtWidgets import qApp
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
....(qtdesigner codes . i skip this part)
self.pushButton.clicked.connect(self.cevirici)
self.pushButton_2.clicked.connect(self.cikis)
self.retranslateUi(MainWindow)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
def retranslateUi(self, MainWindow):
_translate = QtCore.QCoreApplication.translate
MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
self.label_2.setText(_translate("MainWindow", "Birinci Döviz"))
self.label.setText(_translate("MainWindow", "?kinci Döviz"))
self.label_3.setText(_translate("MainWindow", "Miktar"))
self.label_4.setText(_translate("MainWindow", "Sonuç :"))
self.pushButton.setText(_translate("MainWindow", "Çevir"))
self.pushButton_2.setText(_translate("MainWindow", "Ç?k?? Yap"))
def cevirici(self):
import requests
import sys
url = "http://api.fixer.io/latest?base="
birinci_doviz = self.comboBox.currentText()
ikinci_doviz = self.comboBox_2.currentText()
miktar = int(self.lineEdit.currentText())
response = requests.get(url + birinci_doviz)
json_verisi = …Run Code Online (Sandbox Code Playgroud) qt-designer ×10
qt ×5
python ×4
pyqt ×3
pyqt5 ×2
pyside ×2
qt-creator ×2
c++ ×1
eclipse ×1
integrate ×1
pyqt4 ×1
python-3.x ×1
qmainwindow ×1
qt4 ×1
qt5 ×1