qt-designer

How to remove slot, created in Designer mode?

只谈情不闲聊 提交于 2019-12-05 11:56:12
问题 I've created the button cancelButton . Then I've created function-slot on_cancelButton_clicked() for it using context menu item Go to slot . But, after a while, I've deleted this button (it wasn't longer needed), and tried to delete that function, but compiler gives error undefined reference to <class_name>::on_cancelButton_clicked() . I've made cleanup of build folder (and removed it), checked for some lines in ui file that can point to this function, but i didn't found anything. 回答1:

Get focus (or tab) order

只谈情不闲聊 提交于 2019-12-05 09:57:15
I have designed a user interface by using Qt Designer, and I have set the tab order using the "edit tab order" mode. Now what I'd like to know (for an other reason, not so important) is how to get the tab order of a specific QWidget in the ui? I mean if I have several widgets, and say the tab order has been set, is there a way to do something like : int nb = widget1->getTabOrder(); Thomas McGuire There is no way to get the tab order as an integer. If you look into the C++ code that the uic tool creates from your ui file, it will call QWidget::setTabOrder() a few times, and that method just

how to use ui file for making a simple widget?

谁都会走 提交于 2019-12-05 08:08:35
i have a simple window with a quit button in qt.The working code is shown below #include <QApplication> #include <QDialog> #include <QPushButton> class MyWidget : public QWidget { public: MyWidget(QWidget *parent = 0); }; MyWidget::MyWidget(QWidget *parent) : QWidget(parent) { setFixedSize(200, 120); QPushButton *btquit = new QPushButton(tr("Quit"), this); btquit->setGeometry(62, 40, 75, 30); btquit->setFont(QFont("Times", 18, QFont::Bold)); connect(btquit, SIGNAL(clicked()), qApp, SLOT(quit())); } int main(int argc, char *argv[]) { QApplication app(argc, argv); MyWidget widget; widget.show();

Qt GUI doesnt change after compilation

匆匆过客 提交于 2019-12-05 02:11:19
I created a GUI using the Qt Designer compiled and run. Then I made a few changes in the GUI and recompiled again but the GUI remained the same. Even if I delete the widgets and recompile they appear... I tried Clean All and Clean Project but no success... What might be the problem? You can recompile your UI with the following command. It worked for me. uic mainwindow.ui>ui_mainwindow.h I know this is an old thread, but I guess it is still active. One reason for this buggy behavior is the Shadow build checkbox is enabled. Click on the "Project" icon in the Qt creator, under Build-> General,

Qt: add a file selection field on the form (QLineEdit and “browse” button)

风流意气都作罢 提交于 2019-12-04 22:37:35
I need to display QLineEdit with "Browse" button at my form. When user clicks button, QFileDialog should be opened, and so on. This is pretty common thing, but I can't find ready-made solution for that. I expected in Qt Designer some widget like QFileSelect , or something like that, but found nothing similar. Should I implement it by hand? Or, what is the correct way to do this? Should I implement it by hand? Or, what is the correct way to do this? Yes, I agree with you that it is a common thing, but unfortunately you will need to implement this yourself. The good news is that you can do this

pyqt: how to put a border frame around a widget

那年仲夏 提交于 2019-12-04 20:58:32
I'm making some changes to an existing PyQt project. The UI was created with Qt Designer. The relevant part is a QWidget that displays text. I'm trying to put margins around the text. I'd think the simplest way to do this would be to put a border around the QWidget whose background color is the same as the QWidget's background (white). The QWidget is on a QFrame. I'd like to put a white border inside the QFrame and around the edge of the QWidget. The closest I've come is to put short vertical and horizontal spacers around the QWidget, but that displays the underlying grey QFrame. I can't

Embed a pyqtgraph plot into a QT .ui?

走远了吗. 提交于 2019-12-04 20:09:52
first of all I hope you have me some patience since I'm new on these kind of projects and I also hope not to be asking dumb questions. That being said, my main objective is to create a UI for a raspberry pi 3 which will sense voltage, current, etc from a battery and from a solar panel. Since I'm working on a raspberry and have some knowledge on Python3, I decided to use QTCreator which as I understand can be translated into python3 through pyqt ( https://nikolak.com/pyqt-qt-designer-getting-started/ ). I installed it on my raspberry pi and made the following UI: after having a basic UI, I

qt how to know that a pushbutton is clicked?

让人想犯罪 __ 提交于 2019-12-04 16:36:23
I'm trying to do a program which makes some operations with sounds. My question is that I have 3 Play pushbutton and 3 label. I want that whichever I click on the Play button, the sound whose name is in the label that is near the pushbutton should play. I have a play slot without any parameter. So, how can I connect to every play button with every label respectively? Actually, I can write 3 different play function, but since I have some other functions, it will be too long and confusing. Also, I need 3 play button because I want to play 3 sounds simultaneously. For example by connecting the

Custom Qt Widgets with python for Qt Designer

怎甘沉沦 提交于 2019-12-04 09:31:16
问题 I am trying to write a custom widget for the Qt Designer using only Python. I was following a couple of tutorials I found online but none of them were working or anything close to what I would call to be a minimum working example. So my questions are: What steps are involved to make a a custom widget appear in the Widget Box of Qt Designer? If you can spare the time: Please provide a minimum working example (like a widget with a label in it saying "A truly minimal working Qt custom widget

Using QT Designer to create TableView to Postgres Database

▼魔方 西西 提交于 2019-12-04 06:24:19
问题 I'm creating a plugin in Quantum GIS that is using Postgres as the back end and QT Designer to make the GUI. I'm using psycopg2 to run scripts in the database and even fetch results of queries to set the values of labels in the GUI. This stuff is working fine for me. What I would like to do now after some queries are run by clicking a 'calculate' button is for the resulting table to be shown in the plugin as a TableView. I know there widget exists expressly for the purpose of viewing tables