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
1
vote
1 answer

Edit multiple QT widgets (GUI) in QT Creator

I have a general GUI editing question using QT. We can create GUI applications using the QT form view where we can edit the layout graphically. And then we can swtich to the code to fine tune. Problem is i can Edit only the main window GUI. Now if i…
1
vote
0 answers

pyqt5 dynamically generate QCheckBox and connect an action to the new element

I am currently using PyQt5 to develop a GUI for my application. I have not used PyQt for very long and I am currently still learning more about it. I have discovered a way to dynamically create a QCheckBox for every element in a specified list and…
1
vote
0 answers

Specific shortcut key does not work in Mac in Qt

I am using shortcut keys with QActions and specific key shortcuts(like F1, Command+A) does not respond in Mac . Seems like Mac is reserving those shortcut keys for OS specific shortcuts. Is it possible to override those and use the qt defined…
Rubina
  • 123
  • 1
  • 17
1
vote
1 answer

calling a Qt widget main window function in my main

I'm trying call a Qt Mainwindow function in my main function but unfortunately it does not work some info: I've written a simple log in application. here's the code for it: void MainWindow::on_pushButton_Login_clicked() { QString username =…
skdadle
  • 155
  • 1
  • 2
  • 17
1
vote
1 answer

Is it possible to disable Saturdays and Sundays in QCalendarWidget?

I want the user to be able to select Monday, Tuesday, Wednesday, Thursday or Friday (weekdays) in a QCalendarWidget. But not Saturday or Sunday. (weekend) Is this feature available for QCalendarWidget? If not, how do I disable a date on the…
ukll
  • 204
  • 2
  • 12
1
vote
1 answer

Qt How to add custom widgets to a vertical layout to occupy the least amount of vertical space (no space between custom widgets)

I've created a custom widget containing a few widgets in a horizontal layout: And the goal is to display several of these in a list so I've added them dynamically to a parent vertical layout. The problem I'm having is that there's too much space…
bananamana
  • 485
  • 1
  • 9
  • 19
1
vote
1 answer

Qt subclassing a ui form shows a blank window

I have a qt .ui form and I am trying to use the subclassing approach described on their website to use it in a program. However, when I run the program, i just get an empty window. subclass header: #ifndef HOMEPAGE_H #define HOMEPAGE_H #include…
callum perks
  • 77
  • 2
  • 8
1
vote
3 answers

QTWidgets QTableWidget crash with segfault

I have this signal on QPushButton: void MainWindow::on_addNode_clicked() { ui->nodesTable->insertRow(ui->nodesTable->rowCount()); if(ui->nodesTable->rowCount()>1) { ui->nodesTable->item(ui->nodesTable->rowCount()-1,…
dimas
  • 13
  • 7
1
vote
2 answers

Can i use quick controls in a qt widgets application?

I need material styled replacements of standard widgets and it's kind of hard to implement them by using custom widgets. I was wondering if there's any way to include widgets from quick control module and use them as regular widgets?
Chechen Itza
  • 111
  • 8
1
vote
1 answer

Running a QT MainWindow method on a separate thread

I am writing a C++ QT5 Widget Desktop Application and I need to run a time consuming operation MainWindow::performLengthyOperation(bool) on a separate thread when a start/stop button is pressed. This time consuming operation is a rather lengthy…
johnco3
  • 2,401
  • 4
  • 35
  • 67
1
vote
1 answer

Qt TabWidget corner widget size

Have some problem with corner widget due using non-standard font size in app, screenshot to be clear: code: QToolButton* m_exit = new QToolButton(m_tab); m_exit->setIcon(QIcon(":/Resources/exit.png")); m_exit->setSizePolicy(QSizePolicy::Maximum,…
goldstar
  • 327
  • 4
  • 15
1
vote
2 answers

How can I return a value from SLOT in Qt5?

I have been new to the Qt environment. I recently started with a QtCreator project for a simple chat application (QMainWindow). I have nearly completed the project but stuck with the SIGNAL/SLOT problem. Let me explain my problem in brief : Due to…
Panther Coder
  • 1,058
  • 1
  • 16
  • 43
1
vote
1 answer

Reuse qt c++ widgets in qml

I plan to create an application with QML. I have implemented a lot of qt widgets in c++. The c++ widgets should be used in QML. How to integrate them? - path to dlls - does some qml container exist? I didn't found good documentation for this problem
Toemmes
  • 11
  • 3
1
vote
1 answer

How to get the QGraphicsLayoutItem clicked in a QGraphicsWidget with QGraphicsLinearLayout

I have QGraphicsLayoutItem placed inside a QGraphicsLinearLayout. This is added to my QGraphicsWidget. void MyCustomQGraphicsWidget::mousePressEvent(QGraphicsSceneMouseEvent * mouseEvent) { if (mouseEvent->button() == Qt::LeftButton) { …
ovg
  • 1,486
  • 1
  • 18
  • 30
1
vote
1 answer

‘virtual bool QAbstractScrollArea::eventFilter(QObject*, QEvent*)’ is protected

I tried to find the answer to this one with google but nothing has born fruit. I'm in the process of converting an app from Qt4 to Qt5. This application compiled perfectly in Qt4 but when I try to compile against Qt5 now it's giving me this…
crcrewso
  • 71
  • 5