Navigation

    Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    • Unsolved
    1. Home
    2. Tags
    3. qwidget
    Log in to post

    • UNSOLVED startSystemMove() and FramelessWindowHint on a QWidget: Can't trigger Windows Features like aerosnap
      General and Desktop • qwidget framelesswindow title bar aero startsystemmove • • KKiranbay  

      1
      0
      Votes
      1
      Posts
      15
      Views

      No one has replied

    • UNSOLVED QWidget size in designer form is not respected.
      General and Desktop • qwidget qtablewidget • • ozcanay  

      2
      0
      Votes
      2
      Posts
      52
      Views

      According your first picture you're missing a layout on the widget.
    • SOLVED QCameraImageCapture captures an overexposed image
      General and Desktop • qwidget multimedia qcamera qcameraimagecap • • fama_lab3d  

      4
      0
      Votes
      4
      Posts
      66
      Views

      @SGaist looking at the QCamera example gave me a lot of info to fix my issue. I was using the QCamera wrongly. Too many start/stop followed by lock/unlock etc. Now the image is captured correctly.
    • UNSOLVED How to include freeglut in a QWidget?
      General and Desktop • opengl qwidget freeglut • • timob256  

      1
      0
      Votes
      1
      Posts
      80
      Views

      No one has replied

    • UNSOLVED How to style widgets inside a scrollArea?
      General and Desktop • qwidget qscrollarea • • candidaj  

      8
      0
      Votes
      8
      Posts
      241
      Views

      Check the generated code to see what it does differently than yours.
    • UNSOLVED How to use hamburger menu widget in my project?
      General and Desktop • qwidget widget menu ui design side menu • • BigBen  

      7
      0
      Votes
      7
      Posts
      273
      Views

      Since applications using burger menus usually have a very distinctive style I didn't want to make any assumptions. The look of the menu is up to you to style, it only implements the functionality. Same goes for the burger icon, you can set it to whatever you want, either the one included in the project or your own. There's an example in the repo showing how to style it. As for actions - you can add an existing QAction or let the widget create one for you using any of the overloads of addMenuAction. In any case it returns a QAction* and you can connect to its triggered signal just as you would with any other action in the built-in Qt menus. Alternatively you can tag these actions in any way you want and only make a single connection to the BurgerMenu::triggered signal. You will get an action that was triggered as a parameter. One way to tag an action is by using QAction::setData or you can just store the action pointers somewhere when creating them and identify the action by the pointer, text, some property or whatever fits you. on_actionName_triggered() looks like a slot name created for the the auto-connection feature. If you want to use it you can do that too (although I wouldn't reccomend it). Just create your actions in the designer via its action editor and make your slots names match, just like you would with any normal menus/actions. The only caveat is that you need to manually add these actions to the menu from code, as there's no way to do that in the designer, but that's not a huge problem. So those are a couple of the most straightforward options out of couple more. It's deliberately left very flexible so you can use it however fits your overall application design best.
    • SOLVED Genericity, extensibility and reuse: QWidgets Vs QML
      General and Desktop • qml qwidget performance template qml c++ • • genner  

      7
      0
      Votes
      7
      Posts
      175
      Views

      @sierdzio Ok now it's much clearer, thank you again. It looks like there is a lot of documentation to read, but apparently most things I have in mind should work. Still, for some reason, I feel QWidgets will perform faster. I'll try to make some tests and get back here. Thank you again!
    • UNSOLVED Styling all of QtreeView...
      General and Desktop • qwidget qtreeview qstyle qstylesheet qproxystyle • • Dariusz  

      3
      0
      Votes
      3
      Posts
      147
      Views

      @VRonin I want to do some heavy changes/customisations... stuff I cant do in CSS... Like moving expand button to opposite of tree, changing location of checkbox, changing indentation of child items. How can I control indentation of child items? I need it now :/ I keep getting "invisible" hitboxes as my child item is moved to left visually but hitboxes are drawn in original places :/// Ideas? I just realized there is "setIndentation"... sigh............ Ok that kinda works, how can I set indentation per row? :D
    • SOLVED QListWidget Custom Widget, has more space on right side & Limit widget count for each line
      General and Desktop • qwidget pyqt5 qlistwidget pyqt pyqt6 • • Emrecp  

      4
      0
      Votes
      4
      Posts
      231
      Views

      @VRonin Yeah you are right. Usually my custom widget has another widgets (like another label for text, button for submit etc.) so I used setItemWidget. But your way better for only images.
    • UNSOLVED QOpenGLWindow Stacking Order
      General and Desktop • qwidget qopenglwidget qopengl qopenglwindowqw • • rtavakko  

      1
      0
      Votes
      1
      Posts
      127
      Views

      No one has replied

    • UNSOLVED QOpenGLWidget with shared context
      General and Desktop • opengl qwidget qopenglwidget qopenglcontext • • rtavakko  

      3
      0
      Votes
      3
      Posts
      167
      Views

      @Chris-Kawa That would work for multiple QOpenGLWidgets in the same application. My use case involves sharing the context of one QOpenGLWidget with that of a QOffscreenSurface
    • UNSOLVED How to make offical qml material style like interface in qwidget c++
      General and Desktop • qml c++ qwidget qss • • Puppy Bear  

      1
      0
      Votes
      1
      Posts
      115
      Views

      No one has replied

    • UNSOLVED Widgets with SizePolicy there is no effects
      General and Desktop • qwidget pyqt5 qsizepolicy • • Pythonic person  

      5
      0
      Votes
      5
      Posts
      262
      Views

      @Pythonic-person said in Widgets with SizePolicy there is no effects: Do you mean taking the main window size and then change the widget size with the code? You either use one of the provided layout mechanisms, develop you your only layout implementation, or you do all the resizing of contained widgets yourself 1990's style. If you wish to do it yourself then you need to override the resizeEvent() of the container widget and resize the contained widgets yourself using whatever logic you see fit.
    • SOLVED QTDesigner Widget crashs, when trying to do anything with its Widgets.
      General and Desktop • qwidget cpp constructor crash app qvboxlayout • • BDC_Patrick  

      3
      0
      Votes
      3
      Posts
      138
      Views

      @JonB Thanks.. found out, that i needed to create a new Pointer in the Declaration of the .h File.. Means.. TGS_Widget_AssetList * _assetList; Wasn´t enough... I needed to do: TGS_Widget_AssetList *_assetList = new TGS_Widget_AssetList(this); or auto *_assetList = new TGS_Widget_AssetList(this); Now it works.. i will update my initial post here
    • UNSOLVED Customizing tab created with QTabWidget.
      General and Desktop • qml qwidget qtabwidget custom • • Asimo  

      7
      0
      Votes
      7
      Posts
      285
      Views

      @ChrisW67 Thank you so much for your recommendations! I will try.
    • SOLVED How can I place a qlabel over qwidget placed in a window container?
      General and Desktop • qwidget qlabel window • • new.qt_user-2022  

      6
      0
      Votes
      6
      Posts
      478
      Views

      @new-qt_user-2022 All the best! Feel free to post new questions if you'd like further help.
    • SOLVED Comment permettre l'utilisation de tous les fichiers de classe dans un projet à partir de l'inclusion de QtGui ?
      French • qt creator qwidget • • gouneken  

      5
      0
      Votes
      5
      Posts
      288
      Views

      @SGaist Merci pour vos conseils à l'avenir , j'éviterai de faire ce genre d'erreur . Bonne fin de journée.
    • UNSOLVED How to embed Ogre3d in qt5 as a widget
      General and Desktop • qwidget qt5.11 ogre • • timob256  

      6
      0
      Votes
      6
      Posts
      297
      Views

      @timob256 said in How to embed Ogre3d in qt5 as a widget: QWindows not unit setLayout ? install in element, not posible. Don't know what this means. this->setLayout(gl_layaout[3]); // this not work !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Don't know what this means. All your widgets are created with parent as their parent, instead of this. Since I wrote earlier But why are you using parent here? Shouldn't it be this? do you not think this applies to your case? Why? You are creating your widgets with a parent of parent of QTOgreWindow, and then this->setLayout(gl_layaout[3]); setting the layout on this. I don't get what you are trying to do or why. UPDATE I see you have now taken this question to https://forum.qt.io/topic/132674/how-do-i-put-a-qlayout-in-a-qwindow. It's always helpful to others if you cross-reference posts like this. I see now that my "But why are you using parent here? Shouldn't it be this?" is not applicable to QWindow. I will post into your other thread.
    • SOLVED problem opening one instance of every Widget(form) and deleting it ...
      General and Desktop • qwidget qt5.6 release deletelater form • • Proton Phoenix  

      9
      0
      Votes
      9
      Posts
      268
      Views

      @JonB it works bro thank you problem fixed when i tried this before it doesn't open the window at all ... just flashing but now i understand why it's working Thank you <3
    • UNSOLVED How to update entire window on change in QProxyStyle?
      General and Desktop • qwidget qpushbutton qproxystyle painting issues • • CJha  

      16
      0
      Votes
      16
      Posts
      357
      Views

      @Christian-Ehrlicher Hi Seems to call it from QPushButton::sizeHint() but I failed to find way to trigger it without altering text. I guess for full disclosure the source is needed and single step :9 I use wobog for it.
    • SOLVED QMenuBar in QWidget windows
      General and Desktop • qwidget qmenubar • • artwaw  

      5
      0
      Votes
      5
      Posts
      366
      Views

      @JoeCFD Thank you, will investigate this avenue too!
    • SOLVED [QtDesigner] Can't set layout for Widget under a QGridLayout
      Tools • qwidget layout qtdesigner layout issues • • Aramir  

      3
      0
      Votes
      3
      Posts
      278
      Views

      Thank you for the answer. Setting a child did enable the layout selection. I don't understand the logic behind that at all but ok. QcmEntryGuess are QWidget I've created on the side. They're only a QLabel nested in two layout Althought my QGridLayout is still only consisted of one row. I'm probably missunderstanding one of its property
    • UNSOLVED StyleSheet not applying when a child is declared
      General and Desktop • qwidget stylesheet inheritance • • Dzious  

      1
      0
      Votes
      1
      Posts
      128
      Views

      No one has replied

    • SOLVED Using template on a QWidget constructor
      General and Desktop • qwidget template constructor meta-objects • • raphasauer  

      10
      0
      Votes
      10
      Posts
      362
      Views

      Correct.
    • UNSOLVED Get all Widgets of Type <Type> ?
      General and Desktop • qwidget cpp qaction • • BDC_Patrick  

      7
      0
      Votes
      7
      Posts
      266
      Views

      @BDC_Patrick said in Get all Widgets of Type <Type> ?: But, this only works, if i put the code directly into the construct function of the Window itself (after ui->setupUi...). Why? It's QObject::findChilden(), you can use it for any widget. But, i thought more of a Function in a seperated file, that all Windows can make use of. If you really want it in a separate file then pass the parent widget as a parameter. Are you using Qt's support for cross-language?
    • UNSOLVED Customed QWidget can't get the size after layout by calling adjustSize()
      General and Desktop • qwidget qgraphicsview pyqt5 pyqt custom qwidget • • darrenleeleelee1  

      5
      0
      Votes
      5
      Posts
      263
      Views

      @Pl45m4 no but I don't know how to do that sizeHint() can return the right size in a layout.and I have a valid parent.
    • UNSOLVED 自訂的QWidget無法用adjustSize取的在layout裡的size
      Chinese • qwidget pyqt5 pyqt sizehint adjustsize • • darrenleeleelee1  

      1
      0
      Votes
      1
      Posts
      208
      Views

      No one has replied

    • UNSOLVED Is there a better method than calling polish recursively on all children of a QWidget?
      General and Desktop • qwidget stylesheet property propertychanges polish • • letop  

      3
      0
      Votes
      3
      Posts
      704
      Views

      @JonB Thank you for your feedback. Going thorugh the existing children lists and filter the widgets in specific code is surely a bit more efficient with regards to speed, but that's not the kind of optimisation I was looking for. Some frameworks have a dirty flag for instance that triggers an evalution by the graphics system when it is due for evaluation (on 20ms ticks for instance). The polish/unpolish functions could benefit from a better documentation. I have a stylesheet only at the QApplication level, I empty all other stylesheets that are set by QtDesigner - I use the only for that. I use the same "style()" because it works and it probably is a small performance gain. I haven't tried polishing the application itself, and I suppose that is an overkill for just updating a few widgets. The default implementation of (un)polish does nothing, but QStylesheetStyle does. It seems to wrap the baseStyle(), which is likely something like QWindowsStyle or QFusionStyle which do nothing. But that's doing exactly what is needed then, only the stylesheet impacts the layout and the QStylesheetStyle handles that. QWidget::ensurePolished works recursively, but polishes only "unpolished" QWidgets in the end. Upon examination of the QStylesheetStyle code, it seems that unpolishing may not be needed. So I am removing that from the "recursive" implementation and I'll see if it's ok. It seems to avoid quite a few unnecessary operations! Update: polishing "recursively" is just enough.
    • SOLVED Problem with data visualization in QCharts and multithreading
      General and Desktop • qwidget qthread qchartview • • Davide87  

      3
      0
      Votes
      3
      Posts
      235
      Views

      Thank you for your advice. I did as you said and it seems it's working well.
    • UNSOLVED Setting minimum size on a widget triggers a resizing to content
      General and Desktop • qwidget qlayout size the qdockw • • dporobic  

      1
      0
      Votes
      1
      Posts
      251
      Views

      No one has replied

    • UNSOLVED How to properly delete threads& objects in them ?
      General and Desktop • qwidget qthread qtcpsocket qobject • • Dariusz  

      4
      0
      Votes
      4
      Posts
      190
      Views

      @Dariusz said in How to properly delete threads& objects in them ?: So in general, moving object to another thread does not set the thread as it parent does it. No because the function is called moveToThread and not moveToThreadAndDoOtherStuffLikeSettingaParent
    • UNSOLVED I am not getting promoted widget on the sceen
      General and Desktop • qwidget promote • • Thank You  

      3
      0
      Votes
      3
      Posts
      239
      Views

      @Christian-Ehrlicher Now I got it It does not have size for the contents of window and if we put layout to it then it will try to keep content inside it It is shown in ui file and because it has no content on given portion so it wont display anything Thank You
    • SOLVED Updating QTablWidget correctly
      General and Desktop • qwidget qtablewidget • • TUStudi  

      9
      0
      Votes
      9
      Posts
      361
      Views

      @TUStudi Well, it's not necessarily that: you can create an item via void QTableWidget::setItem(int row, int column, QTableWidgetItem *item) instead.
    • SOLVED How to avoid bringing QMainWindow to the front when clicking on independent QWidget on MacOS
      General and Desktop • qt5 qwidget qmainwindow mac os activate • • RaulSanchez  

      8
      0
      Votes
      8
      Posts
      543
      Views

      I made it work by removing this flag: Qt::WindowDoesNotAcceptFocus
    • UNSOLVED Customizing a QPLainText widget or creating a new one
      General and Desktop • qwidget qplaintextedit qtextdocument qtextcursor datastructures • • kaliy23  

      3
      0
      Votes
      3
      Posts
      272
      Views

      @jsulm, I apologize, I should've mentioned it in the original post: one of the requirements of the project is that we can not use any 3rd party library for the text editor, except for Qt. From what I see in the QScintilla github, it is ported to Qt on top of the TextEdit widget, so I will look further into their implementation to figure out how they've done it.
    • UNSOLVED Too many widgets breaks window management
      General and Desktop • qwidget qframe qsplitter window geometry • • Eric Singer  

      7
      0
      Votes
      7
      Posts
      466
      Views

      @Eric-Singer Because my suggestion is not to limit the size of the parent but rather to limit what the layout reports as the minimum size required. minimumSize() returns the minimum amount of space the widget needs to provide so that the layout can fit all the widgets inside it. maximumSize() is the size beyond which the layout can't reasonable grow the widgets inside. Maximum size is not useful for this case. Your problem is that the parent widget grows too much and it grows because the minimum size of the layout grows i.e. the minimum amount of space required to lay out the widgets inside grows. If you return a fake limit, one that is smaller than the sum of all the widgets inside, the parent will be able to keep its size despite all the children in the layout not fitting (visually they will be cropped). You could, for example, return the minimum of the base implementation's value that calculates it based on the content size and some constant value of yours, beyond which you don't want to grow. To be honest that's pretty much what a scroll area does and I think the suggestion given by @SGaist is a better one as it already does that work for you.
    • UNSOLVED How to properly close a widget
      General and Desktop • c++ qwidget close qt 5.9.5 • • Daniel_Contro  

      6
      0
      Votes
      6
      Posts
      902
      Views

      Hi, How are these widget managed from a data saving point of view ?
    • UNSOLVED What library should I use for animation in Qt Widgets Application?
      General and Desktop • qt creator qwidget animation application • • ricardovaras_99  

      4
      0
      Votes
      4
      Posts
      341
      Views

      @ricardovaras_99 said in What library should I use for animation in Qt Widgets Application?: And I want to simulate water level increasing on a tank. Do you want to animate the water level (in other words, make the level rise or fall at a specific speed in real time)? Or do you just want to display the water level? (in other words, make the picture show the latest level)? If you want the latter, have a look at the Qt Quick Coffee Machine demo: Video: https://resources.qt.io/videos/built-with-qt-qt-quick-coffee-machine-demo-qtws17 Code: https://doc.qt.io/qt-5/qtdoc-demos-coffee-example.html
    • UNSOLVED Enable or Disable High DPI scaling on a specific Widget
      General and Desktop • qt5 qwidget scaling highdpi • • johnyang  

      3
      0
      Votes
      3
      Posts
      979
      Views

      In one of my project, a bit of resolution seems to be lost when scaling (150%). It is plotting a complicated graph for signal processing. We are thinking whether we can just plot the graph according to the scaling factor (e.g. running the math calculation ourslef and generate a graph double the size for high resolution etc) and not to scale this part of the widget by using the high dpi setting.