美化ui
This commit is contained in:
@ -126,10 +126,27 @@ void MyCarousel::contextMenuEvent(QContextMenuEvent* event)
|
||||
void MyCarousel::showContextMenu(const QPoint& pos)
|
||||
{
|
||||
QMenu menu(this);
|
||||
menu.setStyleSheet(R"(
|
||||
QMenu {
|
||||
background-color: #2a5dec;
|
||||
color: white;
|
||||
}
|
||||
QMenu::item:selected {
|
||||
background-color: #1a4ddc;
|
||||
}
|
||||
QMenu::separator {
|
||||
height: 1px;
|
||||
background: white;
|
||||
}
|
||||
)");
|
||||
|
||||
QAction* startAct = menu.addAction(QString::fromLocal8Bit("开始轮播"));
|
||||
QAction* stopAct = menu.addAction(QString::fromLocal8Bit("停止轮播"));
|
||||
|
||||
menu.addSeparator();
|
||||
QAction* incAct = menu.addAction("+1");
|
||||
QAction* decAct = menu.addAction("-1");
|
||||
|
||||
if (!m_isLocked)
|
||||
startAct->setEnabled(false);
|
||||
|
||||
@ -142,6 +159,15 @@ void MyCarousel::showContextMenu(const QPoint& pos)
|
||||
startAutoPlay();
|
||||
else if (act == stopAct)
|
||||
stopAutoPlay();
|
||||
else if (act == incAct) {
|
||||
m_playInterval += 1000;
|
||||
m_autoPlayerTimer->setInterval(m_playInterval);
|
||||
}
|
||||
else if (act == decAct) {
|
||||
if (m_playInterval > 1)
|
||||
m_playInterval -= 1000;
|
||||
m_autoPlayerTimer->setInterval(m_playInterval);
|
||||
}
|
||||
}
|
||||
|
||||
void MyCarousel::startAutoPlay()
|
||||
|
||||
@ -31,7 +31,7 @@ HPPA::HPPA(QWidget* parent)
|
||||
s_instance = this;
|
||||
ui.setupUi(this);
|
||||
|
||||
//setWindowFlags(Qt::FramelessWindowHint);
|
||||
setWindowFlags(Qt::FramelessWindowHint);
|
||||
|
||||
// register MapLayer* metatype for queued signal/slot across threads
|
||||
qRegisterMetaType<MapLayer*>("MapLayer*");
|
||||
@ -276,8 +276,9 @@ sizePolicy1.setHeightForWidth(graphicsView_delete->sizePolicy().hasHeightForWidt
|
||||
connect(m_layerTreeView->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
|
||||
this, SLOT(onLayerTreeSelectionChanged(QItemSelection,QItemSelection)));
|
||||
|
||||
dock_layers->setWidget(dock_layersWidgetContents);
|
||||
dock_layersWidgetContents->setStyleSheet(qss_DockWidget_contentWidget);
|
||||
dock_layers->setWidget(tmp(dock_layersWidgetContents));
|
||||
|
||||
|
||||
//dock_layers->setMinimumWidth(449);
|
||||
//dock_layers->setMaximumWidth(450);
|
||||
@ -403,11 +404,12 @@ sizePolicy1.setHeightForWidth(graphicsView_delete->sizePolicy().hasHeightForWidt
|
||||
}
|
||||
)");
|
||||
|
||||
dock_hyperimgViewer->setWidget(dock_hyperimgViewerWidgetContents);
|
||||
mPanelMenu->addAction(dock_hyperimgViewer->toggleViewAction());
|
||||
QWidget* tmp6 = new QWidget();
|
||||
dock_hyperimgViewer->setTitleBarWidget(tmp6);
|
||||
|
||||
dock_hyperimgViewer->setWidget(tmp(dock_hyperimgViewerWidgetContents));
|
||||
|
||||
//轮播看板
|
||||
m_dock_carousel = new CustomDockWidgetBase(QString::fromLocal8Bit("轮播"), this);
|
||||
m_dock_carousel->setObjectName("mDockCarousel");
|
||||
@ -429,8 +431,8 @@ sizePolicy1.setHeightForWidth(graphicsView_delete->sizePolicy().hasHeightForWidt
|
||||
|
||||
border-top-left-radius: 0px;
|
||||
border-top-right-radius: 0px;
|
||||
border-bottom-left-radius: 0px;
|
||||
border-bottom-right-radius: 0px;
|
||||
border-bottom-left-radius: 10px;
|
||||
border-bottom-right-radius: 10px;
|
||||
}
|
||||
)");
|
||||
QGridLayout* gridLayout_carouselContainer = new QGridLayout(carouselContainer);
|
||||
@ -476,7 +478,7 @@ sizePolicy1.setHeightForWidth(graphicsView_delete->sizePolicy().hasHeightForWidt
|
||||
|
||||
gridLayout_carouselContainer->addWidget(m_carousel);
|
||||
|
||||
m_dock_carousel->setWidget(carouselContainer);
|
||||
m_dock_carousel->setWidget(tmp(carouselContainer));
|
||||
|
||||
//控制看板
|
||||
ui.mDockWidgetSpectrometer->setTile(QString::fromLocal8Bit("控制"));
|
||||
@ -484,6 +486,8 @@ sizePolicy1.setHeightForWidth(graphicsView_delete->sizePolicy().hasHeightForWidt
|
||||
initControlTabwidget();
|
||||
m_tabManager = new TabManager(ui.controlTabWidget, this);
|
||||
|
||||
ui.mDockWidgetSpectrometer->setWidget(tmp(ui.dockWidgetContents_4));
|
||||
|
||||
//3D模型看板
|
||||
ui.mDockWidgetSimulator->setTile(QString::fromLocal8Bit("3D模型"));
|
||||
//ui.mDockWidgetSimulator->show();
|
||||
@ -519,7 +523,7 @@ sizePolicy1.setHeightForWidth(graphicsView_delete->sizePolicy().hasHeightForWidt
|
||||
connect(m_view3DModelManager, SIGNAL(created3DModelPlantPhenotype()), this, SLOT(onCreated3DModelPlantPhenotype()));
|
||||
connect(m_view3DModelManager, SIGNAL(created3DModelOneMotor()), this, SLOT(onCreated3DModelOneMotor()));
|
||||
|
||||
ui.mDockWidgetSimulator->setWidget(modelWidgetContainer);
|
||||
ui.mDockWidgetSimulator->setWidget(tmp(modelWidgetContainer));
|
||||
|
||||
//看板排版
|
||||
splitDockWidget(dock_layers, dock_hyperimgViewer, Qt::Horizontal);
|
||||
@ -779,6 +783,22 @@ void HPPA::initMenubarToolbar()
|
||||
setMenuWidget(topWidget);
|
||||
}
|
||||
|
||||
QWidget* HPPA::tmp(QWidget* a)
|
||||
{
|
||||
QWidget* Background = new QWidget(this);
|
||||
Background->setObjectName("Background");
|
||||
QGridLayout* layout_Background = new QGridLayout(Background);
|
||||
layout_Background->setContentsMargins(0, 0, 0, 0);
|
||||
Background->setStyleSheet(R"(
|
||||
QWidget #Background{
|
||||
background: #040125;
|
||||
}
|
||||
)");
|
||||
layout_Background->addWidget(a);
|
||||
|
||||
return Background;
|
||||
}
|
||||
|
||||
void HPPA::initControlTabwidget()
|
||||
{
|
||||
//rgb相机
|
||||
@ -1102,6 +1122,29 @@ void HPPA::initPanelToolbar()
|
||||
ui.mWindowsMenu->addMenu(mPanelMenu);
|
||||
ui.mWindowsMenu->addMenu(mToolbarMenu);
|
||||
|
||||
mPanelMenu->setStyleSheet(R"(
|
||||
QMenu {
|
||||
background-color: #0A1245; /* 菜单背景色 */
|
||||
border: 1px solid gray; /* 可选,边框样式 */
|
||||
color: white; /* 根据你的背景调整文字颜色 */
|
||||
}
|
||||
QMenu::item:selected {
|
||||
background-color: rgba(255, 255, 255, 50); /* 选中时的背景色 */
|
||||
color: white; /* 选中项字体颜色,可选 */
|
||||
}
|
||||
)");
|
||||
mToolbarMenu->setStyleSheet(R"(
|
||||
QMenu {
|
||||
background-color: #0A1245; /* 菜单背景色 */
|
||||
border: 1px solid gray; /* 可选,边框样式 */
|
||||
color: white; /* 根据你的背景调整文字颜色 */
|
||||
}
|
||||
QMenu::item:selected {
|
||||
background-color: rgba(255, 255, 255, 50); /* 选中时的背景色 */
|
||||
color: white; /* 选中项字体颜色,可选 */
|
||||
}
|
||||
)");
|
||||
|
||||
mPanelMenu->addAction(ui.mDockWidgetSpectrometer->toggleViewAction());
|
||||
|
||||
mPanelMenu->addAction(ui.mDockWidgetSimulator->toggleViewAction());
|
||||
@ -1698,14 +1741,38 @@ void HPPA::onExit()
|
||||
|
||||
void HPPA::closeEvent(QCloseEvent* event)
|
||||
{
|
||||
QMessageBox::StandardButton ret;
|
||||
QMessageBox msgBox(this);
|
||||
msgBox.setWindowTitle(QString::fromLocal8Bit("退出确认"));
|
||||
msgBox.setText(QString::fromLocal8Bit("确定要退出程序吗?"));
|
||||
msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
|
||||
msgBox.setDefaultButton(QMessageBox::No);
|
||||
msgBox.setStyleSheet(R"(
|
||||
QMessageBox {
|
||||
background-color: #0D1233;
|
||||
}
|
||||
QMessageBox QLabel {
|
||||
color: #ACCDFF;
|
||||
font-size: 14px;
|
||||
}
|
||||
QPushButton {
|
||||
background-color: #142D7F;
|
||||
color: #e6eeff;
|
||||
border: 1px solid #2f6bff;
|
||||
border-radius: 6px;
|
||||
padding: 6px 20px;
|
||||
min-width: 60px;
|
||||
font-size: 13px;
|
||||
}
|
||||
QPushButton:hover {
|
||||
border: 1px solid #4d8dff;
|
||||
background-color: red;
|
||||
}
|
||||
QPushButton:pressed {
|
||||
background-color: #23345c;
|
||||
}
|
||||
)");
|
||||
|
||||
ret = QMessageBox::question(
|
||||
this,
|
||||
QString::fromLocal8Bit("退出确认"),
|
||||
QString::fromLocal8Bit("确定要退出程序吗?"),
|
||||
QMessageBox::Yes | QMessageBox::No
|
||||
);
|
||||
QMessageBox::StandardButton ret = static_cast<QMessageBox::StandardButton>(msgBox.exec());
|
||||
|
||||
if (ret == QMessageBox::Yes)
|
||||
{
|
||||
|
||||
@ -199,6 +199,7 @@ private:
|
||||
void initMenubarToolbar();
|
||||
void initPanelToolbar();
|
||||
void initControlTabwidget();
|
||||
QWidget* tmp(QWidget* a);
|
||||
|
||||
QLineEdit * frame_number;
|
||||
QLineEdit * m_FilenameLineEdit;
|
||||
|
||||
@ -11,11 +11,11 @@
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Hyper Plant Phenotypic Analysis</string>
|
||||
<string>Spectral Insight</string>
|
||||
</property>
|
||||
<property name="windowIcon">
|
||||
<iconset resource="HPPA.qrc">
|
||||
<normaloff>:/HPPA/HPPA.ico</normaloff>:/HPPA/HPPA.ico</iconset>
|
||||
<iconset>
|
||||
<normaloff>icon/all/png/Group 356_slices/22.png</normaloff>icon/all/png/Group 356_slices/22.png</iconset>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true"/>
|
||||
|
||||
@ -68,8 +68,8 @@ QVariant LayerTreeModel::data(const QModelIndex& index, int role) const
|
||||
}
|
||||
}
|
||||
|
||||
case Qt::CheckStateRole:
|
||||
return static_cast<int>(n->visible());
|
||||
//case Qt::CheckStateRole:
|
||||
// return static_cast<int>(n->visible());
|
||||
|
||||
case Qt::ToolTipRole:
|
||||
return (n->type() == LayerTreeNode::Type::Group) ? "Group" : "Layer";
|
||||
|
||||
@ -30,6 +30,19 @@ void LayerTreeView::contextMenuEvent(QContextMenuEvent* event)
|
||||
setCurrentIndex(QModelIndex());
|
||||
|
||||
QMenu* menu = m_menuProvider->createContextMenu();
|
||||
menu->setStyleSheet(R"(
|
||||
QMenu {
|
||||
background-color: #2a5dec;
|
||||
color: white;
|
||||
}
|
||||
QMenu::item:selected {
|
||||
background-color: #1a4ddc;
|
||||
}
|
||||
QMenu::separator {
|
||||
height: 1px;
|
||||
background: white;
|
||||
}
|
||||
)");
|
||||
if (menu)
|
||||
{
|
||||
menu->exec(event->globalPos());
|
||||
|
||||
@ -232,20 +232,44 @@ void TwoMotorControl::display_motors_connectivity(std::vector<int> connectivity)
|
||||
//std::cout << "-----------------------------------"<<connectivity.size()<< std::endl;
|
||||
if (connectivity[0])
|
||||
{
|
||||
this->ui.xMotorStateLabel->setStyleSheet("QLabel{background-color:rgb(0,255,0);}");
|
||||
this->ui.xMotorStateLabel->setStyleSheet(R"(
|
||||
QLabel
|
||||
{
|
||||
background-color: #08FACE;
|
||||
border-radius: 4px;
|
||||
}
|
||||
)");
|
||||
}
|
||||
else
|
||||
{
|
||||
this->ui.xMotorStateLabel->setStyleSheet("QLabel{background-color:rgb(255,0,0);}");
|
||||
this->ui.xMotorStateLabel->setStyleSheet(R"(
|
||||
QLabel
|
||||
{
|
||||
background-color: red;
|
||||
border-radius: 4px;
|
||||
}
|
||||
)");
|
||||
}
|
||||
|
||||
if (connectivity[1])
|
||||
{
|
||||
this->ui.yMotorStateLabel->setStyleSheet("QLabel{background-color:rgb(0,255,0);}");
|
||||
this->ui.yMotorStateLabel->setStyleSheet(R"(
|
||||
QLabel
|
||||
{
|
||||
background-color: #08FACE;
|
||||
border-radius: 4px;
|
||||
}
|
||||
)");
|
||||
}
|
||||
else
|
||||
{
|
||||
this->ui.yMotorStateLabel->setStyleSheet("QLabel{background-color:rgb(255,0,0);}");
|
||||
this->ui.yMotorStateLabel->setStyleSheet(R"(
|
||||
QLabel
|
||||
{
|
||||
background-color: red;
|
||||
border-radius: 4px;
|
||||
}
|
||||
)");
|
||||
}
|
||||
}
|
||||
|
||||
@ -440,7 +464,7 @@ void TwoMotorControl::onSaveRecordLine2File_btn()
|
||||
fclose(RecordLineFileHandle);
|
||||
delete[] data;
|
||||
|
||||
QMessageBox::information(this, QString::fromLocal8Bit("提示"), QString::fromLocal8Bit("保存成功!"));
|
||||
//QMessageBox::information(this, QString::fromLocal8Bit("提示"), QString::fromLocal8Bit("保存成功!"));
|
||||
}
|
||||
|
||||
void TwoMotorControl::onReadRecordLineFile_btn()
|
||||
@ -499,5 +523,5 @@ void TwoMotorControl::onReadRecordLineFile_btn()
|
||||
fclose(RecordLineFileHandle);
|
||||
delete[] data;
|
||||
|
||||
QMessageBox::information(this, QString::fromLocal8Bit("提示"), QString::fromLocal8Bit("读取成功!"));
|
||||
//QMessageBox::information(this, QString::fromLocal8Bit("提示"), QString::fromLocal8Bit("读取成功!"));
|
||||
}
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
</property>
|
||||
<property name="windowIcon">
|
||||
<iconset>
|
||||
<normaloff>HPPA.ico</normaloff>HPPA.ico</iconset>
|
||||
<normaloff>C:/Users/73505/.designer/backup/HPPA.ico</normaloff>C:/Users/73505/.designer/backup/HPPA.ico</iconset>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<property name="leftMargin">
|
||||
@ -93,7 +93,10 @@
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="iconLabel">
|
||||
<property name="text">
|
||||
<string> </string>
|
||||
<string/>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap>icon/all/png/Group 356_slices/22.png</pixmap>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -193,7 +196,7 @@ QPushButton:pressed
|
||||
<string/>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap>icon/all/png/Group 356_slices/Group 356.png</pixmap>
|
||||
<pixmap>C:/Users/73505/.designer/backup/icon/all/png/Group 356_slices/Group 356.png</pixmap>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QWidget" name="widget_2" native="true">
|
||||
@ -295,10 +298,6 @@ QPushButton:pressed
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<zorder>label_7</zorder>
|
||||
<zorder>widget_2</zorder>
|
||||
<zorder>widget_3</zorder>
|
||||
<zorder>companylname_label</zorder>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
|
||||
@ -6,13 +6,6 @@ aboutWindow::aboutWindow(QWidget* parent)
|
||||
{
|
||||
ui.setupUi(this);
|
||||
|
||||
QSvgRenderer svgRenderer(QString(".//icon//all//software_icon.svg"));
|
||||
QPixmap pixmap(24, 24);
|
||||
pixmap.fill(Qt::transparent); // <20><><EFBFBD><EFBFBD><EFBFBD><CDB8>
|
||||
QPainter painter(&pixmap);
|
||||
svgRenderer.render(&painter);
|
||||
ui.iconLabel->setPixmap(pixmap);
|
||||
|
||||
ui.companylname_label->setOpenExternalLinks(true);//<2F><><EFBFBD><EFBFBD>Ϊtrue<75><65><EFBFBD>ܴ<EFBFBD><DCB4><EFBFBD><EFBFBD><EFBFBD>ҳ
|
||||
QString text = ui.companylname_label->text();
|
||||
ui.companylname_label->setText("<a style='color: green; text-decoration: none' href = http://www.iris-rs.cn/pr.jsp?_jcp=3_10>" + text);
|
||||
|
||||
@ -64,13 +64,13 @@ ImageControl::ImageControl(QWidget* parent)
|
||||
}
|
||||
|
||||
QDoubleSpinBox::up-arrow {
|
||||
image: url(:/icons/up.svg);
|
||||
image: url(D:/cpp_project_vs2022/HPPA/HPPA/icon/all/arrow_up.svg);
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
}
|
||||
|
||||
QDoubleSpinBox::down-arrow {
|
||||
image: url(:/icons/down.svg);
|
||||
image: url(D:/cpp_project_vs2022/HPPA/HPPA/icon/all/arrow_down.svg);
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user