Questions tagged [qtgui]

QtGui module extends QtCore with GUI functionality. It has collection of classes useful for creating Qt based GUI applications

Prior to , the Qt GUI module was the monolithic container for all things relating to graphical user interfaces in Qt, and included the Qt widget set, the item views, the graphics view framework and also printing. Starting Qt 5, these classes have been moved to the Qt Widgets module. Printing has been moved to the Qt Print Support module. Please note that these modules can be excluded from a Qt installation.

If you use qmake to build your projects, Qt Gui is included by default.

The official Qt documentation can be found here for Qt 4.8 and here for Qt 5.

539 questions
0
votes
1 answer

close event not working?

Ok, so why is this code not working?? void Jarvis::closeEvent(QCloseEvent *e) { if (m_doQuit) { e->accept(); } else { e->ignore(); hide(); } } m_doQuit is true, I checked that. For now I am using void…
graywolf
  • 7,092
  • 7
  • 53
  • 77
0
votes
1 answer

Qt: How to access an element dragged on the main window by its id?

I have created a Table View by dragging and dropping it on the main window of a Qt application. The objectName of this Table View is set to tableView which seems to be only defined in the mainwindow.ui xml file. How can I access and set some…
B Faley
  • 17,120
  • 43
  • 133
  • 223
0
votes
2 answers

How button onClick works

I am a bit confused with Qt's onClick handling. I have a class which looks like this: class DatabaseManager : public QObject { Q_OBJECT; private: QSqlDatabase db; public slots: bool openDB(const QString& path); }; And I have a class…
erbal
  • 727
  • 3
  • 12
  • 32
0
votes
1 answer

Button does not animate

I created a new QWidget with a single button in Qt Designer and i added this to the source code : void MainWindow::startAnimation() { QPropertyAnimation animation(ui->pushButton, "geometry"); animation.setDuration(3000); …
Alex L.
  • 813
  • 2
  • 17
  • 34
0
votes
1 answer

PyQt4 add label loadUi

import sys from PyQt4 import QtCore, QtGui, uic class MainWindow(QtGui.QMainWindow): def __init__(self): QtGui.QMainWindow.__init__(self) self.Dynamic_log = uic.loadUi("Dynamic_log.ui") self.Dynamic_log.show() …
Rhys
  • 4,926
  • 14
  • 41
  • 64
0
votes
2 answers

Implementing a GUI Shell in qt

I want to implement a simple graphical shell in Qt using a QTextEdit. I want to get user commands and print the results in that QTextEdit. The code below returns the whole content of the QTextEdit: text_editor.toPlainText().toAscii(); But I don't…
Babak Mehrabi
  • 2,155
  • 4
  • 23
  • 24
0
votes
1 answer

FileBrowser which shows files from different directories using python QtGUI

I have full path of some pdf files which are in different directories and I want to show those files in one Window from where user can click and open them by and document viewer. Since I'm new to python and QtGUI, I am unable to figure out how to do…
vaibhav1312
  • 863
  • 4
  • 13
  • 31
0
votes
2 answers

How to replace UI labels/tool-tips in Qt application run-time according to context?

We are developing a Qt Desktop application. Application can open multiple files one in each tab, and each tab (file) has its own context. User can open multiple files and switch among these tabs. e.g. : Like one tab is of Truck management for which…
Anwar Shaikh
  • 1,591
  • 3
  • 22
  • 43
0
votes
2 answers

Basic help needed in PyQt4

Basically I have a main window with a menu bar and a number of options . When I click on one of the options , my code should open another window. My code looks something like this now. All required libraries are imported. class subwindow(self): …
Manoj
  • 961
  • 4
  • 11
  • 37
0
votes
1 answer

Intercepting mousePressEvent on Child widget (qt)

I'm trying to implement the following functionality based on QPlainTextEdit - by default it should show a "please enter something here" message, on click, it would vanish and allow editing. To do so I need to intercept whether the widget has been…
qdot
  • 6,195
  • 5
  • 44
  • 95
0
votes
1 answer

Qt - confused on QDialog choice on main

I have the following Qt code: int main(int argc, char *argv[]) { QApplication app(argc, argv); ChoosingDialog cdlg; if(!startWin.exec()) { // nothing chosen return 0; } if(cdlg.firstWindowSelected) { …
Johnny Pauling
  • 12,701
  • 18
  • 65
  • 108
0
votes
2 answers

vertical header labels in QTreeWidget

I have a QTreeWidget with horizontal header labels at the moment and my intention is to draw only the headerLabels vertically and the rest horizontally. I don't want to reimplement everything in QTreeWidgets's paintEvent method, so I am thinking…
Arnab Datta
  • 5,356
  • 10
  • 41
  • 67
0
votes
1 answer

Qt QDialog with hide and WA_QuitOnClose

I have a problem, I'm calling my QDialog like this in the main(): app.setQuitOnLastWindowClosed(true); splashWin startWin; if(!startWin.exec()) { // Rejected return EXIT_SUCCESS; } // Accepted, retrieve the data startWin.myData... And in…
Johnny Pauling
  • 12,701
  • 18
  • 65
  • 108
0
votes
1 answer

Qt: Window size execution methods?

When trying to set a fixed window size why doesn't the following code work: window->setSizeIncrement(1024,600); window->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed); But this code…
Brandon Clark
  • 788
  • 1
  • 13
  • 26
0
votes
1 answer

Freeing allocated memory with Qt toolbars and actions

Do I need to free Qt toolbars and actions? I created them this way QToolBar *tb = new QToolBar(this); tb->setWindowTitle(tr("Edit Actions")); addToolBar(tb); QAction *a; a = actionUndo = new QAction(...ecc..); are these deallocated automatically…
Johnny Pauling
  • 12,701
  • 18
  • 65
  • 108