本文整理汇总了C++中QSplitter::setFrameStyle方法的典型用法代码示例。如果您正苦于以下问题:C++ QSplitter::setFrameStyle方法的具体用法?C++ QSplitter::setFrameStyle怎么用?C++ QSplitter::setFrameStyle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QSplitter
的用法示例。
在下文中一共展示了QSplitter::setFrameStyle方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
int LuaSplitter2::setFrameStyle(lua_State *L)
{
QSplitter* obj = ObjectHelper<QSplitter>::check( L, 1 );
int style = luaL_checknumber( L, 2 );
int shadow = Q3Frame::Plain;
if( lua_gettop(L) > 2 )
shadow = luaL_checknumber( L, 3 );
obj->setFrameStyle( style | shadow );
return 0;
}
示例2: fileName
MainWindow::MainWindow(QFrame *parent)
: QFrame(parent),isLeftNaviVisuable(true)
{
setWindowFlags(Qt::FramelessWindowHint);
setMouseTracking(true);
setAttribute(Qt::WA_Hover, true);
QString fileName("/style/system.qss");
QFile file(fileName);
if (!file.open(QFile::ReadOnly)) {
file.setFileName(":/style/system.qss");
file.open(QFile::ReadOnly);
}
setStyleSheet(file.readAll());
file.close();
ptrHeaderBar = new HeaderBar(this);//创建标题栏
ptrStatusBar = new StatusBar(this);//创建状态栏
QString msg = "Ready";
ptrStatusBar->setMessage(msg);
lft = new LeftNavi(this);
lft->setFrameStyle(QFrame::NoFrame);
rgt = new QStackedWidget(this);
rgt->setObjectName("rgt");
rgt->setFrameStyle(QFrame::NoFrame);
NetPlanView *tpview = new NetPlanView();
rgt->addWidget(tpview);
NetResView *resview = new NetResView();
rgt->addWidget(resview);
QSplitter *mainSplitter = new QSplitter(this);
mainSplitter->setFrameStyle(QFrame::NoFrame);
mainSplitter->setHandleWidth(1);
mainSplitter->setStyleSheet(
QString("QSplitter::handle {background: qlineargradient("
"x1: 0, y1: 0, x2: 0, y2: 1,"
"stop: 0 %1, stop: 0.07 %2);}").
arg(qApp->palette().background().color().name()).
arg(qApp->palette().color(QPalette::Dark).name()));
mainSplitter->setChildrenCollapsible(false);
mainSplitter->addWidget(lft);
mainSplitter->addWidget(rgt);
mainSplitter->setStretchFactor(20,80);
createToolBarNull();
QHBoxLayout *ptrHLayout = new QHBoxLayout();
ptrHLayout->setMargin(0);
ptrHLayout->setSpacing(0);
ptrHLayout->addWidget(pushButtonNull_);
ptrHLayout->addWidget(mainSplitter);
QVBoxLayout *ptrVLayout = new QVBoxLayout();//创建布局
ptrVLayout->addWidget(ptrHeaderBar);//将部件加入到布局中
ptrVLayout->addLayout(ptrHLayout);
ptrVLayout->addWidget(ptrStatusBar);
ptrVLayout->setSpacing(0); //设置间距与边缘空白
ptrVLayout->setContentsMargins(VALUE_DIS,VALUE_DIS,VALUE_DIS,VALUE_DIS);
setLayout(ptrVLayout);
setMinimumWidth(800);
setMinimumHeight(600);
createActions();
FramelessHelper *pHelper = new FramelessHelper(this);
pHelper->activateOn(this); //激活当前窗体
pHelper->setBorderWidth(VALUE_DIS);
pHelper->setTitleHeight(HEADER_H); //设置窗体的标题栏高度
pHelper->setWidgetMovable(true); //设置窗体可移动
pHelper->setWidgetResizable(true); //设置窗体可缩放
connect(ptrHeaderBar, SIGNAL(signal_menu(QPoint)), this, SLOT(showMenu(QPoint)));
connect(ptrHeaderBar, SIGNAL(signal_maxrestore()), this, SLOT(showMaxRestore()));
//lft->setDatabase(db.db());
}