qwidget

pyQt4: QWidget subclass not responding to new setStyleSheet() background colour

I am having an issue with PyQt4. I want to create a new widget within a window, and I want this widget to have a custom color. When i create a subclass of the QWidget class, and instantiate it, I am not able to change its background color through the setStyleSheet() function. When I instantiate a new QWidget object, I have no problem...

Help Qt Widgets for creating Accessories Bar on my device

Hi Geeks, For a handheld device I want to put a vertical Bar which will contain widgets that show the battery status of device, network connectivity status, Date and Time etc. For this Bar I have chosen a GroupBox and for the widgets inside that (lets say batter status) I am planning to use QPushButton. Is it correct I am doing or there...

Make qwidget in new window in PyQt4

I'm trying to make a class that extends qwidget, that pops up a new window, I must be missing something fundamental, class NewQuery(QtGui.QWidget): def __init__(self, parent): QtGui.QMainWindow.__init__(self,parent) self.setWindowTitle('Add New Query') grid = QtGui.QGridLayout() label = QtGui.QLabel('blah') grid.addWidget(la...

How to Redirect a Python Console output to a QTextBox

Hello, I'm working on developing a GUI for the recompilation of Linux kernel. For this I need to implement 4-5 Linux commands from Python. I use Qt as GUI designer. I have successfully implemented the commands using os.system() call. But the output is obtained at the console. The real problem is the output of command is a listing that ...

QT4 Designer - Implement Widget

I'm currently trying to get into QT4 and figure out a workflow for myself. While trying to create a widget which allows the user to connect to a hostname:port some questions appeared. The widget itself contains a LineEdit for entering the hostname, a SpinBox for entering the port and a PushButton which should emit a connect(QString host...

Qt- how to set QWidget width

How to set QWidget width? I know setGeometry(QRect& rect) function to do that, but in that case I should use geometry() function to get former parameters of my QWidget, then I should increment the width and use setGeometry(..). Is there any ditect way to say QWidget aa; aa.setWidth(165); //something like this? ...

Qt - change QWidget layout

Let's consider we have a QWidget and a layout named general_layout that contains other widgets and layouts. general_layout is set as the QWidget layout (setLayout(general_layout)). Now I should to change the content of QWidget. How should I do? I have tried to delete and create a new layout for QWidget and that new layout set as a layou...

QWidget - resize animation

Say I have a QHBoxLayout where there are 2 QTextEdits and between them a button with an arrow to the right. So when you click on the button, the right-side QTextEdit gradually closes by moving the lift borther untill it meats the right one. Simulutaniously, the right border of the left QTextEdit thakes the place which the right QTextEdit...

Why it is not possible to animate the "maximumWidth" parameter of the QWidget?

I wanted to animate the QWidget maximumWidth in order to change thd widgets size in a layout with animation, but it does not work. I have tried to do the following: QPropertyAnimation *animation1 = new QPropertyAnimation(m_textEditor2, "maximumWidth"); animation1->setStartValue(0); animation1->setEndValue(100); animation1->start(); ED...

How to know that widget is currently is running in Qt Designer

How can I in code of the custom Qt widget know that it is currently instantiated in Qt designer? Use case: I build a complex custom widget that has several child widgets like QPushButton, QLabel etc. As application logic require, when widget is created most of those sub component are not visible but in design time when I put it on a ...

QT 4.6: Animating widgets within a QStackedLayout

I am designing a GUI interface in QT Designer. Part of this interface involves two custom widgets stacked on top of each other via a QStackedLayout. When certain actions are performed elsewhere in the GUI, I want the top stacked widget to slide upwards, revealing the widget beneath it and covering whatever happens to be above it. I am c...

How can I prevent Gnome from showing two windows when doing alt-tab? (c++ qt app)

(see edits) I'm developing a QT/c++ application under gnome. The application a main window and QListBox child window. Both of these windows show up as separate main windows when I alt-tab away from the application. How can I make it so that only one window is shown when I (or later the user) uses alt-tab? I am guessing this behav...

Qt: best way to add a context menu to the central widget?

I do not understand why in the book Rapid GUI Programming with Python and Qt, a context menu is added to a central widget by calling addActions() on the main window (self), like so (p. 180): self.addActions(self.imageLabel, (editInvertAction, …)) where self is a QMainWindow, and imageLabel is a QLabel set as the centra...

What Qt widget(s) to use for read-only, scrollable, collapsible, icon list

I'm relatively new to Qt, and am not entirely familiar with the out-of-the-box widgets. I have a somewhat (but not very) complex widget to create, and don't want to reinvent any wheels. What is the best QWidget to use as a starting point to subclass and/or QWidgets to use to compose my widget. Here is the end-result I am looking for (apo...

How to hide a QWidget under its parent?

I have a modal QDialog, that on the click of a button slides a modeless child QDialog out from underneath it. The problem I have is that the child stays on top of its parent during the animation. I think I could get away with applying a mask over the portion of the child that overlaps the parent, but it feels like I'm missing a more obv...

Qt widget based on QWidget

Hello, I try to create my own widget based in QWidget. In constructor of the class i have: Square(QWidget *parent = 0, const char *name = 0, WFlags fl = 0); Square::Square(QWidget *parent = 0, const char *name = 0, WFlags fl) : QWidget(parent, name, f) { if (!name) setName("Game"); reset(); ...

QWidget and setVisible() problem

Hi! I create a QWidget: m_widget = new QWidget(parent); where parent is also a QWidget then I set visible of m_widget to false m_widget->setVisible(false); after that I need to show m_widget m_widget->setVisible(true); and this line of code hangs the application and only in release build on symbian platform what's wrong? why does th...

Qt Hide Taskbar Item

I have a custom QWidget and I simple don't want it to show up in the taskbar. I have a QSystemTrayIcon for managing exiting/minimizing etc. ...