git-svn-id: svn://db.shs.com.ru/libs@410 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
@@ -10,6 +10,18 @@ void EDockWidget::setFeatures(QDockWidget::DockWidgetFeatures features) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void EDockWidget::setWindowTitle(const QString & title) {
|
||||||
|
lbl_title->setText(title);
|
||||||
|
QDockWidget::setWindowTitle(title);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void EDockWidget::setWindowIcon(const QIcon & icon) {
|
||||||
|
lbl_icon->setPixmap(icon.pixmap(QSize(256, 256)));
|
||||||
|
QDockWidget::setWindowIcon(icon);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void EDockWidget::init() {
|
void EDockWidget::init() {
|
||||||
header = new QFrame();
|
header = new QFrame();
|
||||||
header->setFrameShape(QFrame::StyledPanel);
|
header->setFrameShape(QFrame::StyledPanel);
|
||||||
@@ -20,6 +32,11 @@ void EDockWidget::init() {
|
|||||||
QIcon wi = windowIcon();
|
QIcon wi = windowIcon();
|
||||||
if (!wi.isNull()) {
|
if (!wi.isNull()) {
|
||||||
lbl_icon->setPixmap(wi.pixmap(QSize(256,256)));
|
lbl_icon->setPixmap(wi.pixmap(QSize(256,256)));
|
||||||
|
/*#if QT_VERSION >= 0x500000
|
||||||
|
if (lbl_icon->pixmap())
|
||||||
|
const_cast<QPixmap*>(lbl_icon->pixmap())->setDevicePixelRatio(1.);
|
||||||
|
#endif*/
|
||||||
|
//qDebug() << windowTitle() << wi.pixmap(QSize(256,256)).size();
|
||||||
lbl_icon->setScaledContents(true);
|
lbl_icon->setScaledContents(true);
|
||||||
lbl_icon->setFixedSize(preferredIconSize(1.5));
|
lbl_icon->setFixedSize(preferredIconSize(1.5));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,8 +19,8 @@ public:
|
|||||||
~EDockWidget() {delete btn_hide; delete btn_dock; delete lbl_title; delete lbl_icon; delete header;}
|
~EDockWidget() {delete btn_hide; delete btn_dock; delete lbl_title; delete lbl_icon; delete header;}
|
||||||
|
|
||||||
void setFeatures(QDockWidget::DockWidgetFeatures features);
|
void setFeatures(QDockWidget::DockWidgetFeatures features);
|
||||||
void setWindowTitle(const QString & title) {lbl_title->setText(title); QDockWidget::setWindowTitle(title);}
|
void setWindowTitle(const QString & title);
|
||||||
void setWindowIcon(const QIcon & icon) {lbl_icon->setPixmap(icon.pixmap(QSize(24, 24))); QDockWidget::setWindowIcon(icon);}
|
void setWindowIcon(const QIcon & icon);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void init();
|
void init();
|
||||||
|
|||||||
Reference in New Issue
Block a user