Questions tagged [qtwidgets]

Questions related to the QtWidgets module in Qt 5 that provides a set of UI elements to create classic desktop-style user interfaces.

The widget set of UI elements was put into its own module to keep Qt Gui modularized and less cluttered for GUI application using Qt Quick and so on.

The official documentation of this module can be found here.

Tagging recommendation:

You will often see questions tagged specifically as for QWidget, et cetera because the question is Qt 4 related even though it is about widget classes. From Qt 5 onwards, please try to use this tag for those cases. Make sure that you only tag questions with that contain questions about the core part of Qt Gui.

300 questions
2
votes
1 answer

Qt GUI for UDP packet reception

I am developing a GUI using Qt for a test UDP server application i wrote in C using the sockets interface available in unix. I aim of the GUI is to display all the messages (perror and fprintf) in either a "text edit box" or "text browser box". Here…
2
votes
1 answer

QCheckbox name access

I generate checkboxes as follows: foreach(QString filt, types){ QCheckBox *checkbox = new QCheckBox(filt, this); checkbox->setChecked(true); vbox->addWidget(checkbox); } I need to get access to these checkboxes by name but they are all…
sark9012
  • 5,485
  • 18
  • 61
  • 99
2
votes
1 answer

How can I add more than one QAction to same QMenu?

I'm trying to implement Qt Menus customization, and I'm giving a feature to add same QAction more than once in the same RMB context menu. But when I try to do: myMenu->addAction( myAction ); myMenu->addAction( myAction ); Adding QAction twice,…
Maverick33
  • 337
  • 3
  • 15
2
votes
1 answer

Paradigmatic way to layout QTableView vertically

I have a QTableView that shows a model with many columns. The model contains something like vector; for most applications the size of vector is below 5. For aesthetic reasons, the model would look better flipped so that…
Mikhail
  • 7,749
  • 11
  • 62
  • 136
2
votes
1 answer

How to avoid text clipping for QPushButton with borderimage

I am styling a QPushButton with a border image with 28px border (for really round corners) Like so: #MyApp QPushButton { margin:0; padding: 0; border:0; border-image: url(:/graphics/button_brand_up.png) 28 28 28 28 stretch stretch; …
Mr. Developerdude
  • 9,118
  • 10
  • 57
  • 95
2
votes
2 answers

Qt - controlling drag behaviour

Suppose I want my draggable widget to move differently than just staying under my cursor while being dragged. For instance, having the widget move only in one axis, or have the widget move double the distance between the cursor and the drag starting…
liewl
  • 4,021
  • 13
  • 46
  • 65
2
votes
1 answer

QML running with Qt for Embedded System on uclinux?

I only write QML app with Qt 5.1.1 running on Mac & Windows. Anyone know what's the version of Qt for Embedded System integrated in the uclinux? Do the Qt on uclinux support QML? Do I need to re-implement the UI with Qt widgets in C++ to run it on…
Robert
  • 1,660
  • 22
  • 39
2
votes
1 answer

Using Qtwidgets with Qmake

I am building my Qt Application with qmake -project and qmake Prog.pro. When I run the Makefile I get this error: mainwindow.h:11:21: fatal error: QtWidgets: No such file or directory #include I have to add the line QT += widgets To…
Quaxton Hale
  • 2,460
  • 5
  • 40
  • 71
2
votes
1 answer

PyQt5 - Error import QtWidgets QtGui

I'm running Ubuntu 13.10 (python-3.3.2+) . I've installed Qt5.2.1 (linux installer) , SIP 4.15.5 & PyQt5 both from source of the official site. PyQt5 build : The Qt qmake is located here jeby6372@mercure:~$ ls /opt/Qt/5.2.1/gcc_64/bin assistant …
Emmanuel BRUNET
  • 1,286
  • 3
  • 19
  • 46
2
votes
1 answer

Compiling C++ code with Qt components

I'm trying to build a GUI for a set of C++ files that I've been writing, and I decided to try Qt. However, trying to compile the files that I have added Qt components to has proven to be difficult. I'm using clang, with the invocation clang++…
kip.price
  • 33
  • 5
1
vote
1 answer

Coupling slider and dial widgets in PyQt5. Solving inconsistent results

I am working on a small widget. It has a dial and a slider and both modify the same number, although I want the slider to have a higher changing rate than the dial. Think of it as the dial being the fine tuning. For example, the slider changes in…
bajotupie
  • 165
  • 1
  • 2
  • 11
1
vote
0 answers

How to create a SlotOfQImage in QT Rust?

I'm trying to define a custom QT Slot/Signal for passing a QImage. I'm using qt_widgets crate which has many predefined slot types like SlotOfQIcon. However it doesn't have one for QImage. I've looked at the source code which is generated with this…
1
vote
1 answer

How to integrate a cursor in a QtWidgets app

I am new to QtWidgets and trying to build an app in QtWidgets and Python (3.x). the end goal of the app is to show images and a superposed cursor (to be exact, a "plus" sign of 2cm) that can be moved along the image reacting to mouse events. I…
Josh.h
  • 71
  • 1
  • 13
1
vote
1 answer

QT - Draw a point at a user specified location in a 3D surface

I was going through the Surface example here When the user clicks anywhere it draws a point image surface what i'd like to know is how to do this programatically,like, if a user gives 3 coordinates x, y, and z. How do I go about plotting such point?
Slava
  • 73
  • 5
1
vote
1 answer

Remove border from QComboBox item

I'm trying to style a QtComboxBox and ListView but i'm not sure how to remove this annoying border when an item of the combobox is hovered. Here's what I have QListView: /*-----QListView-----*/ QListView { background-color:…