qt-designer

Unable to build GUI from the code from PyQt Designer

非 Y 不嫁゛ 提交于 2019-11-28 11:30:17
I made a GUI file from pyqt designer,which i converted to .py file.but when i load that .py code in my IDE (Pycharm and sublime text),and i try to run it,it runs without errors,but the physical aspect of GUI isn't loaded,i tried a custom code from the internet,which worked great,GUI shows up when i run that code. i will give simpler code than the one i'm currently working on,as it seems all of the code generated from pyqt designer doesn't work at all for me regarding its physical aspect. from PyQt5 import QtCore, QtGui, QtWidgets class Ui_Form(object): def setupUi(self, Form): Form

Issue when loading an ico from a Qt resource file

落花浮王杯 提交于 2019-11-28 09:05:47
问题 I am using Qt Designer 4.8.4 and I include two files in the QMainWindow resource file: a .ico file and a .gif file. When loading from code using: QPixmap p; p.load(":/MyApp/media/logo.gif"); // does work p.load(":/MyApp/media/logo.ico"); // does not work The gif file works, but not the ico file. Is there any reason? I am using the ico file as the window icon and it is not showing when running the application. And, YES, I am successfully compiling the qrc file since the GIF file is working .

C++ over Qt : Controlling transparency of Labels and Buttons

别说谁变了你拦得住时间么 提交于 2019-11-28 08:44:08
Well, I was again trying my hands on a Linux GUI app on Qt Creator, I added couple of images in a Qt resource file of my project. And I tried to have a nice background in my main window and other windows and dialogs. I was using from the stylesheets option (no coding). I am unable to set the transparency level of labels and pushbuttons. Any ideas on how to do it from Qt creator GUI itself ??? ! I am attaching a snap of how my application looks. You can set transparency of QLabel or QPushbutton by setting the stylesheet : ui->label->setStyleSheet("background-color: rgba(255, 255, 255, 0);"); ui

Qt Designer, missing “go to slot” in context menu?

隐身守侯 提交于 2019-11-28 04:39:26
问题 I've been watching a Qt tutorial series on YouTube, in which the author shows how to call a function, when a button is pressed. He right-clicked on the button in Qt Creator IDE and chose "Go to slot", from where he chose the signal which would fire the generated function. Since I am used to develop with Netbeans, I simply tried to follow his example using the embedded Qt Designer. Unfortunately, there is no "Go to slot..." entry when I right-click on my button or any widget. I could, of

Hand Coded GUI Versus Qt Designer GUI [closed]

三世轮回 提交于 2019-11-28 02:48:10
I'm spending these holidays learning to write Qt applications. I was reading about Qt Designer just a few hours ago, which made me wonder : what do people writing real world applications in Qt use to design their GUIs? In fact, how do people design GUIs in general? I, for one, found that writing the code by hand was conceptually simpler than using Qt Designer, although for complex GUIs Designer might make sense. Large GUIs might be possible using Designer, but with time they might become very difficult to manage as complexity increases (this is just my opinion). I also downloaded the AmaroK

How to insert QChartView in form with Qt Designer?

南楼画角 提交于 2019-11-28 02:39:47
问题 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. 回答1: 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

How to manage QSplitter in Qt Designer

我只是一个虾纸丫 提交于 2019-11-27 22:58:36
问题 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

Controls insist on being too large, and won't resize, in QtDesigner

醉酒当歌 提交于 2019-11-27 21:03:31
问题 I made a "widget" in Qt Designer with about a dozen controls organized into horiz. and vert. layouts. Oddly, every horizontal layout wants to be some large size, about 400 px wide, when the whole form is set to be 275px wide. Buttons etc contained within are too wide for the form. When I resize the widget form vertically or horizontally (sometimes with the max width turned off) the various layouts won't resize. Manually setting widths (or min widths, or max widths) may affect the sizes of the

Style sheets / Qt Designer support for high dpi screens?

早过忘川 提交于 2019-11-27 20:34:40
问题 Today I have ported my application from Qt5.5 to Qt5.6RC. Running it on my high dpi screen the widgets appeared tiny. After reading this and setting QT_AUTO_SCREEN_SCALE_FACTOR to "1" at least it is usable again. However they say: In the longer term, the application should be adapted to run unmodified: 1) Always use the qreal versions of the QPainter drawing API. 2) Size windows and dialogs in relation to the screen size. 3) Replace hard-coded sizes in layouts and drawing code by values

Best way to display logs in pyqt?

江枫思渺然 提交于 2019-11-27 19:31:47
I am currently working on a GUI using qt designer. I am wondering how I should go about printing strings on the GUI that acts like a logger window. I am using pyqt5. If you are using the Python logging module to can easily create a custom logging handler that passes the log messages through to a QPlainTextEdit instance (as described by Christopher). To do this you first subclass logging.Handler . In this __init__ we create the QPlainTextEdit that will contain the logs. The key bit here is that the handle will be receiving messages via the emit() function. So we overload this function and pass