i solved the toolbar problem like this:
background: blue;
}
QToolBar#myToolBar > QWidget {
background: blue;
}
To copy to clipboard, switch view to plain text mode
if i do this:
background: blue;
}
QToolBar#myToolBar {
background: blue;
}
To copy to clipboard, switch view to plain text mode
only the action buttons get colored.
i got some other problems with style though.
problem appears if I use my own class inherited from QWidget
class my_widget_class
: public QWidget{
Q_OBJECT
public:
};
class my_widget_class : public QWidget
{
Q_OBJECT
public:
my_widget_class(QWidget* );
QListView * listView;
void mouseMoveEvent(QMouseEvent* pEvent);
};
To copy to clipboard, switch view to plain text mode
implementation looks like this:
my_widget_class* my_widget;
/* some ui code here */
my_widget = new my_widget_class (centralWidget);
my_widget->setObjectName("my_widget_00");
my_widget
->setGeometry
(QRect(100,
100,
100,
200));
my_widget_class* my_widget;
/* some ui code here */
my_widget = new my_widget_class (centralWidget);
my_widget->setObjectName("my_widget_00");
my_widget->setGeometry(QRect(100,100,100,200));
To copy to clipboard, switch view to plain text mode
the style sheet is like this:
my_widget_classt#my_widget_00 {
background-color: blue;
border-style: outset;
border-width: 2px;
border-radius: 20px;
border-color: red;
font: bold 14px;
min-width: 10em;
padding: 6px;
}
my_widget_classt#my_widget_00 {
background-color: blue;
border-style: outset;
border-width: 2px;
border-radius: 20px;
border-color: red;
font: bold 14px;
min-width: 10em;
padding: 6px;
}
To copy to clipboard, switch view to plain text mode
i also tried style with QWidget#my_widget
it works if i replace my_widget_class with QWidget in the code (like: "my_widget = new QWidget(centralWidget);" )
is this a normal behaviour? i think it should recognise my new class as QWidget...
i use the same method for my main window class, but this works fine.
Bookmarks