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

Using QTeeView instead of QTreeWidget

I am a total noob in QT and C++. Sorry if I have asked something very fundamental. I have designed a QTreeWidget that looks something like this. The values inside of this TreeWidget are shown for a particular device 'X'. The functionality I am…
Shreesha N
  • 892
  • 2
  • 8
  • 20
1
vote
1 answer

How to get QTableWidget + QComboBox together and how to access perticular row if value is changed from QComboBox of same row

I am stucked at the combination of QTableWidget + QComboBox. As showing in the screenshot, what I want is that, whenever I want insert new item inside table after hitting ADD button, new row should be inserted into the table and at the end I want…
Omkar
  • 343
  • 3
  • 12
1
vote
1 answer

How does a QCloseEvent propagate?

I have a MainWindow derived from QMainWindow and I re-implemented the closeEvent() handler. void MainWindow::closeEvent(QCloseEvent *event) { if (this->okToContinue()) { this->writeSettings(); //event->accept(); …
rencedm112
  • 397
  • 3
  • 11
1
vote
0 answers

Qt3DWindow crash trying to transform into QWidget

Trying to create a 3D Render of my object and put it into QWidget app, but I got some problem with transforming Q3DWidget into QWidget. I'm a novice in Qt and I'm sorry in advance for some ridiculous mistakes, if I have em. There is how I attempted…
Anatoly
  • 25
  • 5
1
vote
1 answer

Qt3D qSceneLoader error when try to load .gltf

I try to load gltf by using qSceneLoader auto sceneObject = new Qt3DRender::QSceneLoader(); sceneObject->setSource(QUrl::fromLocalFile("3D/test.gltf")); auto sceneTransform = new…
Tobbor
  • 110
  • 7
1
vote
1 answer

Qt3D QAbstractTextureImage pixelated

I use Qt3D in my project, I need to change texture of the plane dynamicly. For this I use my implementation of QAbstractTextureImage. I do: auto planeMaterial = new Qt3DExtras::QTextureMaterial(); Qt3DRender::QTexture2D *planeTexture = new…
Tobbor
  • 110
  • 7
1
vote
1 answer

Qt custom widget background transparent but I want that we can use objects that behind of the widget

I created a CustomWidget class: CustomWidget.h: #include #include class CustomWidget : public QWidget { Q_OBJECT public: explicit CustomWidget(QWidget *parent = nullptr); void paintEvent(QPaintEvent*…
İbrahim
  • 991
  • 1
  • 10
  • 32
1
vote
1 answer

How to refresh in tray menu after add new

I need to refresh list on tray menu after add new item. what I need to do class SystemTrayIcon(QtWidgets.QSystemTrayIcon): def __init__(self, icon, parent=None): QtWidgets.QSystemTrayIcon.__init__(self, icon, parent) menu =…
Herick
  • 217
  • 1
  • 3
  • 13
1
vote
1 answer

Add a scrolabble window with buttons into my scene

I am trying to add a box(position:1140, 485 and size:225, 365) with a scroll-able layout with buttons inside the layout. I do NOT want the box to move/resize. I want the box to have a scroll bar with which we can scroll through all the buttons in…
Dennis Vymer
  • 119
  • 1
  • 1
  • 9
1
vote
0 answers

Right side border of Qml chartview shift's little towards left by some pixel after some time

My chartview's right border is shifting towards left by some pixels after some time, don't know why, i tried everything !! I have attached Images to get the better idea, also i have added code, i have not done anything wrong, don't know why it is…
1
vote
1 answer

What is the proper way of communicating data between data classes (model) and the View/Controller classes in Qt?

I am implementing an application that is like Facebook in Qt5. For now in my App I just want to view profiles of people, add new ones and view detailed info of a profile. I decided on a MVC archetecture for my app. I want to know how the…
rjasi
  • 11
  • 2
1
vote
1 answer

Using Controller and QT Worker in a working GUI example

I created a minimal QT GUI example to update widgets from a worker thread based on the recommended approach in the The QThread 5.12 documentation. As described in the QThread 5.12 documentation, the Worker class (with a potentially long void…
johnco3
  • 2,401
  • 4
  • 35
  • 67
1
vote
0 answers

How do I read a csv file in a Qt Desktop App (widget) and render into a widget table?

I normaly read a csv file with lib and save that info in a vector lib but on this kind of project we have to use something call and and I don't really know how to use it, even that freaky vector QStringList…
vivi-ramji
  • 71
  • 8
1
vote
2 answers

How to create one side rounded and other side flat rectangle using QPainter?

I want to achieve something like this using QPainter I tried using 2 rounded rectangles in QPainter side by side but I was unable to achieve the image above. QPainter painter(this); painter.setRenderHint(QPainter::Antialiasing); QRectF…
Rubina
  • 123
  • 1
  • 17
1
vote
1 answer

Access QT Widget child members from QT Widget Object Instance

Consider this QWidget initialized as: QWidget *Logger; Logger = new QWidget(); QPushButton *btn; btn= new QPushButton(Logger); btn->setObjectName(QStringLiteral("pushButton")); Logger->show(); It display the Logger with a button with text…