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
52
votes
5 answers

Display QImage with QtGui

I am new to Qt, and I am trying to create a simple GUI Application that displays an image once a button has been clicked on. I can read the image in a QImage object, but is there any simple way to call a Qt function that takes the QImage as an…
Karim
  • 1,526
  • 4
  • 13
  • 16
28
votes
4 answers

How to check the selected version of Qt in a .pro file?

I have multiple versions of Qt installed, and I need to compile my project with all of them. Using a pro file, I could not find in the documentation how to do a conditional compilation. Ideally, this is what I would like to do: QT_VERSION = 5 …
Pietro
  • 12,086
  • 26
  • 100
  • 193
27
votes
1 answer

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

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…
Dmitry Frank
  • 10,417
  • 10
  • 64
  • 114
19
votes
2 answers

How to change IconSize of QToolButton

How to change the IconSize of QToolButton. button1->setIcon(QIcon("download.jpg")); button1->setFixedSize(100,100); By using above code button size is getting change but icon inside the button is not changing.
Suresh
  • 745
  • 4
  • 11
  • 25
18
votes
1 answer

What does the "Global include" checkbox mean in the Promoted Widgets dialog?

I never check it when promoting widgets, and everything works, but I've always wondered what it is for. Does anyone know?
sashoalm
  • 75,001
  • 122
  • 434
  • 781
16
votes
3 answers

How to override QApplication::notify in Qt

I am trying to handle exception in my Qt application, I went through a couple of posts which indicated of overriding the QApplication::notify method to handle exceptions in a efficient way in Qt. I am not sure where should I add this overriden…
Valla
  • 2,414
  • 11
  • 42
  • 73
16
votes
4 answers

QT5 QPlatformNativeInterface and HWND

In one of the answers to Get HWND on windows with Qt5 (from WId) it is suggested to employ QPlatformNativeInterface in order to recover the native window handler. To access the QT header though the example uses its full path: #include…
Pierluigi
  • 2,212
  • 1
  • 25
  • 39
16
votes
3 answers

Binding model to Qt TableView

Im very new in Qt programming i want to display data with Qt TableView which im getting from XML file. I Cannot find any useful tutorial about how to create custom model and then bind it to TableView. Please provide some help or if anybody have some…
user525717
  • 1,612
  • 5
  • 28
  • 40
15
votes
3 answers

Qt slider widget with tick text labels

I'm searching for Qt widget like QSlider, but with text tick labels support like this: This widget I'll use as mode switcher. Have you met something like that?
BiTOk
  • 716
  • 1
  • 6
  • 15
14
votes
2 answers

QMenu item text disappears when icon added

I am attempting to add an icon to my QMenu using Qt Designer, however I realized that my text disappears when my icon is added. Is there any way for me to show my icon next to my text?
MistyD
  • 16,373
  • 40
  • 138
  • 240
13
votes
3 answers

How to convert QImage to QByteArray?

I am trying to create QByteArray from QImage, however although I tried lots of varient, I couldn't handle it. What I am doing is : QImage img_enrll; // <--- There is an image coming from another function. QByteArray…
goGud
  • 4,163
  • 11
  • 39
  • 63
13
votes
2 answers

How to check if QImage is valid?

I wanted to know if there was a way to determine if a QImage is valid. I am displaying that image as a pixmap in QLabel and sometimes when the image is not valid. It is not displayed in the QLabel, then. The reason for not being valid sometimes is…
MistyD
  • 16,373
  • 40
  • 138
  • 240
11
votes
6 answers

PyQt5 and QtGui module not found

Is there some reason that QtGui is packaged with PyQt5??? I am using Mark Summerfield's Rapid GUI programming book. Obviously this book was written with Qt4 in mind, but I have been recommended to use Qt5, and PyQt5. I want to run the first example…
ADB
  • 1,210
  • 4
  • 15
  • 23
9
votes
1 answer

Custom QIcon using QIconEngine and transparency

I'm trying to implement something like "composed icon" in Qt. Target: I need to dynamicaly set color just for the portion of icon. My idea: Compose this icon by two other. One icon that will be coloured as desired (perhaps by ColorizeEffect) and…
GPUquant
  • 245
  • 2
  • 7
9
votes
5 answers

How to set Input Mask and QValidator to a QLineEdit at a time in Qt?

I want a line edit which accepts an ip address. If I give input mask as: ui->lineEdit->setInputMask("000.000.000.000"); It is accepting values greater than 255. If I give a validator then we have to give a dot(.) after every three digits. What…
QtUser
  • 185
  • 2
  • 2
  • 12
1
2 3
35 36