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
0
votes
1 answer

Widget hidden by default

I'm totally new to Qt framework. What I'm trying to get is to hide all widgets when I start my program, so when the MainWindow is opened. I'm not coding it. I was just editing the program in "Design" editor. I was looking for an option where I can…
Dawid Zbiński
  • 5,521
  • 8
  • 43
  • 70
0
votes
1 answer

How record Qt Widgets StyleSheet in a sepatated file

Is it possible to get the stylesheet from a separated file for a Qt Widgets application, like .CSS does to .HTML ?
Daniel Santos
  • 14,328
  • 21
  • 91
  • 174
0
votes
1 answer

How to clip a widget to a particular area on the screen?

Suppose I have an area on the screen defined with global screen coordinates. There is a widget (top level window) that moves into that area (using standard animation techniques). I'd like to clip out the part of the widget that happens to be outside…
pullo_van
  • 649
  • 6
  • 19
0
votes
1 answer

How to have unselectable portion of text in QTextEdit/QTextDocument?

Suppose I have text like this in QTextEdit: This is sample text The word "sample" should be treated as if it was 1 single character, i.e. when I try to select it either all the characters in the word should be selected or none. Same when I…
pullo_van
  • 649
  • 6
  • 19
0
votes
1 answer

Custom Qt widget example in Qt Creator errors

I'm a Qt beginner, I have the 5.2.1 version and I was trying to learn Qt/QML from a book on Github. However, this is one of the most basic examples: #ifndef CUSTOMWIDGET_H #define CUSTOMWIDGET_H #include class CustomWidget : public…
user112926
  • 51
  • 1
  • 2
  • 5
0
votes
1 answer

How can I enumerate layouts inside layout?

I can enumerate widgets inside layout but I need to enumerate widgets inside layouts inside layout... I'm trying: while (QHBoxLayout* currentLayout = m_Layout->findChild()) { while (QCheckBox* currentCheckbox =…
cnd
  • 32,616
  • 62
  • 183
  • 313
0
votes
1 answer

Qt WidgetTable. Generating multiple data in just a push of a button

This is my first time using qt creator and a newbie to C++ language. I'm creating a GUI that will generate data (in numbers) into a widgetTable. My initial value of x serves as the starting point and the terminal value is my end point. the increment…
0
votes
1 answer

Q_PROPERTY of type float on custom widget does not appear in the Property Editor

I'm working on a custom widget and wanted to make some float type properties. Unfortunately it doesn't seem that Qt Creator is a fan of those float type properties and isn't showing them in the property editor. All of my other properties work fine…
MildWolfie
  • 2,492
  • 1
  • 16
  • 27
0
votes
1 answer

Qt - change the text of QTextBrowser inside GridLayout

I've got a QGridLayout filled with QTextBrowser's. I am getting access to them using itemAtPosition(i,j), so I can eg. change to background using widget()->setStyleSheet. Is there any way to change the text inside those fields?
Skipper
  • 775
  • 6
  • 17
  • 32
0
votes
1 answer

When I dynamically add widgets on windows should I specify parent?

Should I do: auto btnDelete = new QPushButton(this); btnDelete->setText("Delete"); or is it safe to do: auto btnDelete = new QPushButton("Delete"); And why? I add it with: this->ui->formLayout->addRow(btnDelete, editForm);
cnd
  • 32,616
  • 62
  • 183
  • 313
0
votes
0 answers

Qt: drop down menu size

I have a drop down menu inside a QMenuBar, the menu contains many actions. How could I increase the size of these actions? Which is visually make the drop down menu appears larger?
Nyaruko
  • 4,329
  • 9
  • 54
  • 105
0
votes
1 answer

Qt android ndk - app crashes

I've been recently trying to make some very simple app in Qt, and yesterday it used to work correctly on both Desktop and Android (using android ndk, I know it's not good to make android apps in c++, but I just want to try). Today, out of nowhere,…
Skipper
  • 775
  • 6
  • 17
  • 32
0
votes
1 answer

Qt designer - generating UI dynamically / generating unique names?

I've recently started lerning Qt and I'm facing the following problem: I want to create sth like a chessboard (empty, doesn't have to do anything for now) - I've drawn a simple interface, but in the middle I need to make a chessboard itself (let's…
Skipper
  • 775
  • 6
  • 17
  • 32
0
votes
1 answer

Call parent class' paint event in derived class?

In a QDockWidget derived class I enable style sheet support as follows: void CDockWidget::paintEvent(QPaintEvent *event) { QStyleOption opt; opt.initFrom(this); QPainter p(this); …
Horst Walter
  • 13,663
  • 32
  • 126
  • 228
0
votes
1 answer

scrolless but draggable widget

I’m willing to create a widget that draw graphics using OpenGL that doesn’t have a scroll but you can drag it to show the rest of the graphic. This image describes more or less what I’m talking about: As you can see there’s an arrow which points…
yayuj
  • 2,194
  • 3
  • 17
  • 29
1 2 3
19
20