» Stylesheets, widgets hidden and sizes in Qt
Stylesheets, widgets hidden and sizes in Qt
|January 23, 2014
Posted by forumadmin
There is a big problem with styleheets.
If you set the sizes through the style sheet by setting max and min values the same (fixed size) or whatever, and then you try to fetch them using size() on the widget, if the widget has never been shown the sizes you get are weird.
But you can’t fetch them from the styleheet neither, so you have to show all widgets before resizing or fetching the positions.
In my case, i start with a window. But the widgets under this window will appear later, and they have to be positioned in the correct positions before appearing. i have floating widgets, they are not integrated as children of a QMainWindow, so i move them by hand, and position them… but how can i do it, if i don’t know how they are?
Do you know any other way to fetch the sizes stored in the styleheet?.
More Related Questions
- Auto resizing qt application. (main window) I've recently started development in qt and so far it's going good. Now my question is : can I auto re-size qt application as per my screen resolution ? Say, I 've a main window designed […]
- How to link the window close (red x) to a function to close all threads in PyQt? Currently I am working on a GUI application that is developed in PyQt.
The functionality of this GUI contains several threads. I assume this is the reason that when I simply click the […]
- QNativeImage: Unable to attach to shared memory segment. I saw there is one same thread: OpenCv Error in C Wrapper for imread: QNativeImage: Unable to attach to shared memory segment That thread was posted about 4 months ago. No any answer. […]
- Windows 7 64bit, Qt 4: glGetVersion returns "1.1.0", nvogl32v.dll gets unloaded situation
I'm developing 32bit application that uses Qt 4, and I"m working on Windows 7 64bit.
My program has main non-OpenGL widget, and QGLWidget which is optionally opened by the […]
- playing created Audio-Data has noise and periodical clicking in sound I write an application, which plays a sound getting from Hardware (like a ring buffer filled with a sinus wave with certain frequency). Everything works fine, and I can playback the […]
- How to set cellpadding and cellspacing in CSS? In inline HTML, the table styles cellpadding and cellspacing can be set
<table cellspacing="1" cellpadding="1">
How would this be accomplished using a CSS styleheet? Asked […]
- QTreeWidget vertical scrollbar jumps too far I have a QTreeWidget in my application that is populated by a user selection elsewhere. The contents of the first column of treewidget is other custom qt widgets based on the users […]
- How do I apply a style to all buttons of an Android application I have a style applied to my whole application:
<application android:theme="@style/ApplicationStyle" android:icon="@drawable/icon" […]
- Single huge .css file vs. multiple smaller specific .css files? Is there any advantage to having a single monster .css file that contains style elements that will be used on almost every page?
I'm thinking that for ease of management, I'd like to pull […]