void DClusterUserHasDevicesListPage::initializeWidget()
{
    //导航栏
    QString strLeftBtn = tr("上一步");
    QString strTitle = tr("成员所属设备");
    navigationMenuBar = new NavigationMenuBar(this);
    navigationMenuBar->setLeftText(strLeftBtn);
    navigationMenuBar->setTitleText(strTitle);
    connect(navigationMenuBar, SIGNAL(leftClicked()), this, SLOT(on_btnPrepage_clicked()));

    MenuBar* menuBar = navigationMenuBar->getMenuBar();
    addDeviceAction = menuBar->addAction(tr("添加设备"));
    deleteDeviceAction = menuBar->addAction(tr("删除设备"));
    connect(addDeviceAction, SIGNAL(triggered()),this,SLOT(on_addDeviceAction_clicked()));
    connect(deleteDeviceAction, SIGNAL(triggered()), this, SLOT(on_deleteDeviceAction_clicked()));

    QHBoxLayout* pHLTop = new QHBoxLayout();
    pHLTop->addWidget(navigationMenuBar);
    pHLTop->setSpacing(0);
    pHLTop->setMargin(0);
    this->setTopbarLayout(pHLTop);

    //成员信息
    QPixmap pixmapLeft(ImagePath::USER_PORTRAIT);
    QPixmap pixmapRight(ImagePath::RIGHT_HOLLOW_ARROWS);
    btnUserDetail = new GroupButton(this);
    btnUserDetail->setPixMap(pixmapLeft);
    btnUserDetail->setReserve(pixmapRight);
    btnUserDetail->setAttribute(Qt::WA_LayoutUsesWidgetRect);
    btnUserDetail->setFixedHeight(this->screenHeight()*0.12);
    btnUserDetail->setStyleSheet(SheetStyle::GROUPBUTTON_BOTTOMBORDER);
    connect(btnUserDetail, SIGNAL(clicked()), this, SLOT(on_btnUserDetail_clicked()));

    //成员所属设备列表
    devListWidget = new GListWidget(this);
    this->setGListWidget(devListWidget);
    connect(devListWidget, SIGNAL(flexClicked(int)), this, SLOT(on_btnListWidgetFlex_clicked(int)));

    //主体布局
    QVBoxLayout* vbLayout = new QVBoxLayout;
    vbLayout->addWidget(btnUserDetail);
    vbLayout->addSpacing(this->screenHeight()*0.037);
    vbLayout->addWidget(devListWidget);
    vbLayout->setSpacing(0);
    vbLayout->setMargin(0);
    vbLayout->addStretch(0);
    this->setBodyPartLayout(vbLayout);
    curFixedContentHeight += this->screenHeight()*0.037;

    //屏幕触摸滚动设置
    this->installScrollViewportArea();
    this->loadLocalData();
    timerID = this->startTimer(ConstNum::MAX_TIME_INTERVAL);
}
Esempio n. 2
0
MainWindow::MainWindow(QWidget *parent)
	: DropShadowWidget(parent)
{
	ui.setupUi(this);
	//系统日志线程启动
	usbControl = new USBControl(this);
	//ui.menuBar->setPalette(palette1);
// 	QString ss("QMenuBar::item { background: green; color: orange }");
// 	ui.menuBar->setStyleSheet(ss);
	//ui.btnLeft->setPalette(palette);
	
// 	USBThread* usbThread = new USBThread();
// 	usbControl->moveToThread(usbThread);
	//启动试采样
// 	QObject::connect(this, SIGNAL(startOscAcq()), usbControl, SLOT(onButtonRd()));
// 	//启动采集
// 	QObject::connect(this, SIGNAL(startOscAcq()), usbControl, SLOT(onButtonRd()));
/*	usbThread->start();*/

	QPixmap pixmapLeft(":/MainWindow/Resources/Images/TestLeft.png");
// 	ui.labelLeft->setPixmap(pixmapLeft);
// 	ui.labelLeft->setMask(pixmapLeft.mask());
	ui.btnLeft->setMask(pixmapLeft.mask());
	QPixmap pixmapRight(":/MainWindow/Resources/Images/TestRight.png");
// 	ui.labelRight->setPixmap(pixmapRight);
// 	ui.labelRight->setMask(pixmapRight.mask());
	ui.btnRight->setMask(pixmapRight.mask());


	this->setWindowTitle("QQ ");
	this->setWindowIcon(QIcon(":/images/po.jpg"));



	titleWidget = new TitleWidget();
	QVBoxLayout *main_layout = new QVBoxLayout();
	main_layout->addWidget(titleWidget);
	//main_layout->addLayout(center_layout);
	main_layout->setSpacing(0);
	main_layout->setContentsMargins(SHADOW_WIDTH, SHADOW_WIDTH, SHADOW_WIDTH, SHADOW_WIDTH);
	setLayout(main_layout);

}