当前位置: 首页>>代码示例>>C++>>正文


C++ QToolButton::setStyleSheet方法代码示例

本文整理汇总了C++中QToolButton::setStyleSheet方法的典型用法代码示例。如果您正苦于以下问题:C++ QToolButton::setStyleSheet方法的具体用法?C++ QToolButton::setStyleSheet怎么用?C++ QToolButton::setStyleSheet使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QToolButton的用法示例。


在下文中一共展示了QToolButton::setStyleSheet方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: newToolButton

QToolButton* MenuToolWidget::newToolButton(const QPixmap& icon, QString strToolTip)
{
    QToolButton* toolButton = new QToolButton(this);
    toolButton->setAutoRaise(true);
    toolButton->setIconSize( QSize(55,55) );
    toolButton->setFixedSize(55, 55);
    toolButton->setIcon(icon);
    toolButton->setStyleSheet("background:transparent;");
   // toolButton->setMask(icon.createHeuristicMask());
    toolButton->setToolTip(strToolTip);
//    toolButton->setStyleSheet("QToolButton{min-height:20;border-style:solid;border-top-left-radius:2px;"
//                              "border-top-right-radius:2px;""border:2px groove gray;border-radius:10px;padding:2px 4px;"
//                              "background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop:0 rgb(226,236,241), "
//                              "stop: 0.2 rgb(233,242,247),stop: 0.7 rgb(176,208,225),"
//                              "stop: 0.8 rgb(176,208,225),"
//                              "stop: 1 rgb(192,216,232));}");

    return toolButton;
}
开发者ID:zhangxiang2014,项目名称:cartoon-without-paper,代码行数:19,代码来源:menutool.cpp

示例2: createMenu

void SideDockWidget::createMenu(Qt::DockWidgetArea /*area*/)
{
//    QMenu *moveMenu = new QMenu(tr("Move To"),this);
//    QAction *act = new QAction(tr("OutputBar"),this);
//    act->setData(area);
//    moveMenu->addAction(act);
//    connect(act,SIGNAL(triggered()),this,SLOT(moveAction()));

    m_menu = new QMenu(this);

    QToolButton *btn = new QToolButton(m_toolBar);
    btn->setPopupMode(QToolButton::InstantPopup);
    btn->setIcon(QIcon("icon:images/movemenu.png"));
    btn->setMenu(m_menu);
    btn->setText(tr("SideBar"));
    btn->setToolTip(tr("Show SideBar"));
    btn->setStyleSheet("QToolButton::menu-indicator {image: none;}");
    m_toolBar->insertWidget(m_closeAct,btn);
}
开发者ID:CornerZhang,项目名称:liteide,代码行数:19,代码来源:sidewindowstyle.cpp

示例3: url

QToolButton * FilterItemWidget::createDeleteButton()
{
    QToolButton * deleteBtn = new QToolButton;
    deleteBtn->setFixedSize(16,16);
    deleteBtn->setStyleSheet("QToolButton { "
                               "border: none; "
                               "padding: 0px; "
                               "background: url(:/icons/close) center center no-repeat;"
                               "}"
                               "QToolButton:hover {"
                               "background: url(:/icons/close_hover) center center no-repeat;"
                               "}"
                               "QToolButton:pressed {"
                               "background: url(:/icons/close_pressed) center center no-repeat;"
                               "}");
    deleteBtn->setToolButtonStyle(Qt::ToolButtonIconOnly);
    deleteBtn->setToolTip(tr("Remove criterion"));
    return deleteBtn;
}
开发者ID:jassuncao,项目名称:myparts,代码行数:19,代码来源:filteritemwidget.cpp

示例4: addLocation

void GlobStore::addLocation()
{
    QAction* storeAction = new QAction(tr("&Store"), this);
    QToolButton *storeButton = new QToolButton;
    storeButton->setDefaultAction(storeAction);
    storeButton->setFixedSize(15, 25);
    storeAction->setIcon(QPixmap(filesave_xpm));
    connect(storeAction, SIGNAL(triggered()), storeSignalMapper, SLOT(map()));
    storeSignalMapper->setMapping(storeAction, widgetList.count());

    QAction* restoreAction = new QAction(tr("&Restore"), this);
    QToolButton *restoreButton = new QToolButton;
    restoreButton->setDefaultAction(restoreAction);
    restoreButton->setFixedSize(45, 25);
    restoreAction->setText(QString::number(widgetList.count() + 1));
    restoreButton->setStyleSheet("font: 18pt");
    restoreAction->setDisabled(true);
    restoreAction->setObjectName("-1");
    restoreAction->setProperty("index", widgetList.count() + 1);
    connect(restoreAction, SIGNAL(triggered()), this, SLOT(mapRestoreSignal()));

    QWidget* globWidget = new QWidget;
    QHBoxLayout* globLayout = new QHBoxLayout;
    globLayout->setSpacing(0);
    globLayout->setMargin(0);
    globLayout->addWidget(storeButton);
    globLayout->addWidget(restoreButton);
    globWidget->setLayout(globLayout);

    indivButtonLayout->itemAt(0)->layout()->itemAt(0)->layout()->addWidget(globWidget);

    if (widgetList.count()) {
        widgetList.last()->layout()->itemAt(1)->widget()->setEnabled(true);
    }
    widgetList.append(globWidget);
    modified = true;
}
开发者ID:emuse,项目名称:qmidiarp,代码行数:37,代码来源:globstore.cpp

示例5: type

Card::Card(int ct, int cn) :
        type(ct), cardNumber(cn)
{
    switch (type) {
    case 0:
        cardType = KUPA;
        break;

    case 1:
        cardType = KARO;
        break;

    case 2:
        cardType = SINEK;
        break;

    case 3:
        cardType = MACA;
        break;

    default:
        qDebug() << "Wrong card type";
    }

    cardName = this->toString();
    cardImageName = "./graphics/" + cardName.toLower();
    cardImageName.append(".png");

    QToolButton *foo = new QToolButton;
    foo->setMinimumSize(QSize(50, 60));
    foo->setStyleSheet(QString("border-image: url(%1)").arg(this->cardImageName));

    this->buttonPtr = static_cast<void *>(foo);

    //buttonPtr = (void *) getButton();
}
开发者ID:cakturk,项目名称:CardGame,代码行数:36,代码来源:card.cpp

示例6: DockWindow

SelectionView::SelectionView(Gui::Document* pcDocument, QWidget *parent)
  : DockWindow(pcDocument,parent)
{
    setWindowTitle( tr( "Property View" ) );

    QVBoxLayout* pLayout = new QVBoxLayout( this ); 
    pLayout->setSpacing( 0 );
    pLayout->setMargin ( 0 );

    QLineEdit* searchBox = new QLineEdit(this);
#if QT_VERSION >= 0x040700
    searchBox->setPlaceholderText( tr( "Search" ) );
#endif
    searchBox->setToolTip( tr( "Searches object labels" ) );
    pLayout->addWidget( searchBox );
    QHBoxLayout* llayout = new QHBoxLayout(searchBox);
    QToolButton* clearButton = new QToolButton(searchBox);
    clearButton->setFixedSize(18, 21);
    clearButton->setCursor(Qt::ArrowCursor);
    clearButton->setStyleSheet(QString::fromAscii("QToolButton {margin-bottom:6px}"));
    clearButton->setIcon(BitmapFactory().pixmap(":/icons/edit-cleartext.svg"));
    clearButton->setToolTip( tr( "Clears the search field" ) );
    llayout->addWidget(clearButton,0,Qt::AlignRight);

    selectionView = new QListWidget(this);
    selectionView->setContextMenuPolicy(Qt::CustomContextMenu);
    pLayout->addWidget( selectionView );
    resize( 200, 200 );

    QObject::connect(clearButton, SIGNAL(clicked()), searchBox, SLOT(clear()));
    QObject::connect(searchBox, SIGNAL(textChanged(QString)), this, SLOT(search(QString)));
    QObject::connect(selectionView, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(select(QListWidgetItem*)));
    QObject::connect(selectionView, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(onItemContextMenu(QPoint)));
    
    Gui::Selection().Attach(this);
}
开发者ID:CobraElDiablo,项目名称:FreeCAD_sf_master,代码行数:36,代码来源:SelectionView.cpp

示例7: createBarrageWidget

QWidget* MusicVideoControl::createBarrageWidget()
{
    QWidget *barrageWidget = new QWidget(this);
    m_pushBarrageOn = false;

    ///////////////////////////////////////////
    QWidgetAction *widgetAction = new QWidgetAction(barrageWidget);
    QWidget *barrageSettingWidget = new QWidget(barrageWidget);
    QVBoxLayout *settingLayout = new QVBoxLayout(barrageSettingWidget);

    QWidget *fontSizeWidget = new QWidget(barrageSettingWidget);
    QHBoxLayout *fontSizeLayout = new QHBoxLayout(fontSizeWidget);
    fontSizeLayout->setContentsMargins(0, 0, 0, 0);
    QLabel *fontSizeLabel = new QLabel(tr("Size"), this);

    QButtonGroup *fontSizeButtonGroup = new QButtonGroup(fontSizeWidget);
    fontSizeLayout->addWidget(fontSizeLabel);
    for(int i=1; i<=3; ++i)
    {
        QPushButton *button = createBarrageSizeButton(i);
        fontSizeButtonGroup->addButton(button, i);
        fontSizeLayout->addStretch(1);
        fontSizeLayout->addWidget(button);
    }
    fontSizeLayout->addStretch(1);
    fontSizeWidget->setLayout(fontSizeLayout);
    connect(fontSizeButtonGroup, SIGNAL(buttonClicked(int)), SLOT(barrageSizeButtonClicked(int)));

    QWidget *backgroundWidget = new QWidget(barrageSettingWidget);
    QHBoxLayout *backgroundLayout = new QHBoxLayout(backgroundWidget);
    backgroundLayout->setContentsMargins(0, 0, 0, 0);
    backgroundLayout->setSpacing(5);
    QLabel *backgroundLabel = new QLabel(tr("BgColor"), this);

    QButtonGroup *backgroundButtonGroup = new QButtonGroup(backgroundWidget);
    backgroundLayout->addWidget(backgroundLabel);
    for(int i=1; i<=8; ++i)
    {
        QPushButton *button = createBarrageColorButton(i);
        backgroundButtonGroup->addButton(button, i);
        backgroundLayout->addWidget(button);
    }
    backgroundWidget->setLayout(backgroundLayout);
    connect(backgroundButtonGroup, SIGNAL(buttonClicked(int)), SLOT(barrageColorButtonClicked(int)));

    settingLayout->addWidget(fontSizeWidget);
    settingLayout->addWidget(backgroundWidget);
    barrageSettingWidget->setLayout(settingLayout);

    widgetAction->setDefaultWidget(barrageSettingWidget);
    m_popupBarrage.addAction(widgetAction);
    ///////////////////////////////////////////

    QHBoxLayout *barrageLayout = new QHBoxLayout(barrageWidget);
    barrageLayout->setContentsMargins(0, 0, 0, 0);

    QToolButton *menuBarrage = new QToolButton(barrageWidget);
    menuBarrage->setStyleSheet(MusicUIObject::MToolButtonStyle04);
    menuBarrage->setIcon(QIcon(":/video/barrageStyle"));
    menuBarrage->setMenu(&m_popupBarrage);
    menuBarrage->setPopupMode(QToolButton::InstantPopup);
    MusicLocalSongSearchEdit *lineEditBarrage = new MusicLocalSongSearchEdit(barrageWidget);
    lineEditBarrage->addFilterText(tr("just one barrage!"));
    lineEditBarrage->setStyleSheet(MusicUIObject::MLineEditStyle01 + \
                                   "QLineEdit{color:white;}");
    connect(lineEditBarrage, SIGNAL(enterFinished(QString)), SIGNAL(addBarrageChanged(QString)));

    QLabel *labelBarrage = new QLabel(barrageWidget);
    labelBarrage->setStyleSheet("color:white;");
    labelBarrage->setText(tr("openBarrage"));
    m_pushBarrage = new QPushButton(barrageWidget);
    m_pushBarrage->setIconSize(QSize(40, 25));
    pushBarrageClicked();
    connect(m_pushBarrage, SIGNAL(clicked()), SLOT(pushBarrageClicked()));

    barrageLayout->addWidget(menuBarrage);
    barrageLayout->addWidget(lineEditBarrage);
    barrageLayout->addWidget(labelBarrage);
    barrageLayout->addWidget(m_pushBarrage);
    barrageWidget->setLayout(barrageLayout);

    return barrageWidget;
}
开发者ID:DchunWang,项目名称:TTKMusicplayer,代码行数:83,代码来源:musicvideocontrol.cpp

示例8: scrollButtonToolTip

BtBibleKeyWidget::BtBibleKeyWidget(const CSwordBibleModuleInfo *mod,
                                   CSwordVerseKey *key, QWidget *parent,
                                   const char *name)
   : QWidget(parent), m_key(key), m_dropDownHoverTimer(this)
{
    Q_UNUSED(name);

    updatelock = false;
    m_module = mod;

    setFocusPolicy(Qt::WheelFocus);

    QToolButton* clearRef = new QToolButton(this);
    clearRef->setIcon(CResMgr::icon_clearEdit());
    clearRef->setAutoRaise(true);
    clearRef->setStyleSheet("QToolButton{margin:0px;}");
    connect(clearRef, SIGNAL(clicked()), SLOT(slotClearRef()) );

    m_bookScroller = new CScrollerWidgetSet(this);

    m_textbox = new BtLineEdit( this );
    setFocusProxy(m_textbox);
    m_textbox->setContentsMargins(0, 0, 0, 0);

    m_chapterScroller = new CScrollerWidgetSet(this);
    m_verseScroller = new CScrollerWidgetSet(this);

    QHBoxLayout* m_mainLayout = new QHBoxLayout( this );
    m_mainLayout->setContentsMargins(0, 0, 0, 0);
    m_mainLayout->setSpacing(0);
    m_mainLayout->addWidget(clearRef);
    m_mainLayout->addWidget(m_bookScroller);
    m_mainLayout->addWidget(m_textbox);
    m_mainLayout->addWidget(m_chapterScroller);
    m_mainLayout->addWidget(m_verseScroller);


    setTabOrder(m_textbox, 0);
    m_dropDownButtons = new QWidget(0);
    m_dropDownButtons->setWindowFlags(Qt::Popup);
    m_dropDownButtons->setAttribute(Qt::WA_WindowPropagation);
    m_dropDownButtons->setCursor(Qt::ArrowCursor);
    QHBoxLayout *dropDownButtonsLayout(new QHBoxLayout(m_dropDownButtons));
    m_bookDropdownButton = new BtBookDropdownChooserButton(this);
    dropDownButtonsLayout->addWidget(m_bookDropdownButton, 2);
    m_chapterDropdownButton = new BtChapterDropdownChooserButton(this);
    dropDownButtonsLayout->addWidget(m_chapterDropdownButton, 1);
    m_verseDropdownButton = new BtVerseDropdownChooserButton(this);
    dropDownButtonsLayout->addWidget(m_verseDropdownButton, 1);
    dropDownButtonsLayout->setContentsMargins(0, 0, 0, 0);
    dropDownButtonsLayout->setSpacing(0);
    m_dropDownButtons->setLayout(dropDownButtonsLayout);
    m_dropDownButtons->hide();

    m_dropDownButtons->installEventFilter(this);

    m_dropDownHoverTimer.setInterval(500);
    m_dropDownHoverTimer.setSingleShot(true);
    connect(&m_dropDownHoverTimer, SIGNAL(timeout()),
            m_dropDownButtons, SLOT(hide()));

    QString scrollButtonToolTip(tr("Scroll through the entries of the list. Press the button and move the mouse to increase or decrease the item."));
    m_bookScroller->setToolTips(
        tr("Next book"),
        scrollButtonToolTip,
        tr("Previous book")
    );
    m_chapterScroller->setToolTips(
        tr("Next chapter"),
        scrollButtonToolTip,
        tr("Previous chapter")
    );
    m_verseScroller->setToolTips(
        tr("Next verse"),
        scrollButtonToolTip,
        tr("Previous verse")
    );

    // signals and slots connections

    connect(m_bookScroller, SIGNAL(change(int)), SLOT(slotStepBook(int)));
    connect(m_bookScroller, SIGNAL(scroller_pressed()), SLOT(slotUpdateLock()));
    connect(m_bookScroller, SIGNAL(scroller_released()), SLOT(slotUpdateUnlock()));
    connect(m_textbox, SIGNAL(returnPressed()), SLOT(slotReturnPressed()));
    connect(m_chapterScroller, SIGNAL(change(int)), SLOT(slotStepChapter(int)));
    connect(m_chapterScroller, SIGNAL(scroller_pressed()), SLOT(slotUpdateLock()));
    connect(m_chapterScroller, SIGNAL(scroller_released()), SLOT(slotUpdateUnlock()));
    connect(m_verseScroller, SIGNAL(change(int)), SLOT(slotStepVerse(int)));
    connect(m_verseScroller, SIGNAL(scroller_pressed()), SLOT(slotUpdateLock()));
    connect(m_verseScroller, SIGNAL(scroller_released()), SLOT(slotUpdateUnlock()));
    bool ok = connect(m_key->afterChangedSignaller(), SIGNAL(signal()), this, SLOT(updateText()));
    Q_ASSERT(ok);

    setKey(key);    // The order of these two functions is important.
    setModule();
}
开发者ID:betsegaw,项目名称:bibletime,代码行数:96,代码来源:btbiblekeywidget.cpp

示例9: file

ContractForm::ContractForm(QString id, QWidget *parent, bool onlyForRead) :
    QDialog(parent)
{
    indexTemp = id;
    QFile file(":/ToolButtonStyle.txt");
    file.open(QFile::ReadOnly);
    QString styleSheetString = QLatin1String(file.readAll());

    labelNumber = new QLabel(trUtf8("Number:"));
    editNumber = new LineEdit;
    editNumber->setReadOnly(onlyForRead);
    labelNumber->setBuddy(editNumber);

    labelDate = new QLabel(trUtf8("Date:"));
    editDate = new QDateEdit;
    editDate->setCalendarPopup(true);
    editDate->setReadOnly(onlyForRead);
    editDate->setDate(QDate::currentDate());

    labelEmployee = new QLabel(trUtf8("FIO:"));
    editEmployee = new LineEdit;
    editEmployee->setReadOnly(onlyForRead);
    labelEmployee->setBuddy(editEmployee);

    QSqlQueryModel *employeeModel = new QSqlQueryModel;
    employeeModel->setQuery("SELECT employeename FROM employee");
    QCompleter *employeeCompleter = new QCompleter(employeeModel);
    employeeCompleter->setCompletionMode(QCompleter::PopupCompletion);
    employeeCompleter->setCaseSensitivity(Qt::CaseSensitive);
    editEmployee->setCompleter(employeeCompleter);

    QToolButton *addButton = new QToolButton;
    QPixmap addPix(":/add.png");
    addButton->setIcon(addPix);
    addButton->setToolTip(trUtf8("Add new record"));
    connect(addButton,SIGNAL(clicked()),this,SLOT(addRecord()));
    addButton->setStyleSheet(styleSheetString);

    QToolButton *seeButton = new QToolButton;
    QPixmap seePix(":/see.png");
    seeButton->setIcon(seePix);
    seeButton->setToolTip(trUtf8("See select item"));
    connect(seeButton,SIGNAL(clicked()),this,SLOT(seeRecord()));
    seeButton->setStyleSheet(styleSheetString);

    QToolButton *listButton = new QToolButton;
    QPixmap listPix(":/list.png");
    listButton->setIcon(listPix);
    listButton->setToolTip(trUtf8("See list of item"));
    connect(listButton,SIGNAL(clicked()),this,SLOT(listRecord()));
    listButton->setStyleSheet(styleSheetString);

    QHBoxLayout *editLayout = new QHBoxLayout;
    editLayout->addWidget(labelEmployee);
    editLayout->addWidget(editEmployee);
    if(!onlyForRead){
        editLayout->addWidget(addButton);
        editLayout->addWidget(seeButton);
        editLayout->addWidget(listButton);
    }

    savePushButton = new QPushButton(trUtf8("Save"));
    connect(savePushButton,SIGNAL(clicked()),this,SLOT(editRecord()));
    savePushButton->setToolTip(trUtf8("Save And Close Button"));

    cancelPushButton = new QPushButton(trUtf8("Cancel"));
    cancelPushButton->setDefault(true);
    cancelPushButton->setStyleSheet("QPushButton:hover {color: red}");
    connect(cancelPushButton,SIGNAL(clicked()),this,SLOT(accept()));
    cancelPushButton->setToolTip(trUtf8("Cancel Button"));

    printPushButton = new QPushButton(trUtf8("Print"));
    //connect(savePushButton,SIGNAL(clicked()),this,SLOT(editRecord()));
    printPushButton->setToolTip(trUtf8("Print Contract Button"));

    buttonBox = new QDialogButtonBox;
    buttonBox->addButton(printPushButton,QDialogButtonBox::ActionRole);
    buttonBox->addButton(cancelPushButton,QDialogButtonBox::ActionRole);
    buttonBox->addButton(savePushButton,QDialogButtonBox::ActionRole);

    if(indexTemp != ""){
        QSqlQuery query;
        query.prepare("SELECT organizationname FROM organization WHERE organizationid = ?");
        query.addBindValue(indexTemp);
        query.exec();
        while(query.next()){
            //editOrganization->setText(query.value(0).toString());
        }
    }else{
        //editOrganization->clear();
    }

    QGridLayout *mainLayout = new QGridLayout;
    mainLayout->addWidget(labelNumber,0,0);
    mainLayout->addWidget(editNumber,0,1);
    mainLayout->addWidget(labelDate,0,2);
    mainLayout->addWidget(editDate,0,3);
    mainLayout->addLayout(editLayout,1,0,1,3);
    if(!onlyForRead){
        mainLayout->addWidget(buttonBox,2,3);
//.........这里部分代码省略.........
开发者ID:AndrewBatrakov,项目名称:EmployeeClient,代码行数:101,代码来源:contract.cpp

示例10: openIcon

StartupView::StartupView( QWidget * parent ) 
  : QWidget( parent )
{
  m_templateListModel = boost::shared_ptr<TemplateListModel>( new TemplateListModel() );

  setStyleSheet("openstudio--StartupView { background: #E6E6E6; }");
  
#ifdef Q_WS_MAC
  setWindowFlags(Qt::FramelessWindowHint);
#else
  setWindowFlags(Qt::CustomizeWindowHint);
#endif

  QWidget * recentProjectsView = new QWidget();
  recentProjectsView->setStyleSheet("QWidget { background: #F2F2F2; }");
  QVBoxLayout * recentProjectsLayout = new QVBoxLayout();
  recentProjectsLayout->setContentsMargins(10,10,10,10);
  QLabel * recentProjectsLabel = new QLabel("Recent Projects");
  recentProjectsLabel->setStyleSheet("QLabel { font: bold }");
  recentProjectsLayout->addWidget(recentProjectsLabel,0,Qt::AlignTop);
  recentProjectsView->setLayout(recentProjectsLayout);

  QToolButton * openButton = new QToolButton();
  openButton->setText("Open File");
  openButton->setStyleSheet("QToolButton { font: bold; }");
  openButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
  QIcon openIcon(":/images/open_file.png");
  openButton->setIcon(openIcon);
  openButton->setIconSize(QSize(40,40));
  connect( openButton, SIGNAL(clicked()), this, SIGNAL(openClicked()) );

  QToolButton * importButton = new QToolButton();
  importButton->setText("Import Idf");
  importButton->setStyleSheet("QToolButton { font: bold; }");
  importButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
  QIcon importIcon(":/images/import_file.png");
  importButton->setIcon(importIcon);
  importButton->setIconSize(QSize(40,40));
  connect( importButton, SIGNAL(clicked()), this, SIGNAL(importClicked()) );
/*  
  QToolButton * importSDDButton = new QToolButton();
  importSDDButton->setText("Import SDD");
  importSDDButton->setStyleSheet("QToolButton { font: bold; }");
  importSDDButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
  QIcon importSDDIcon(":/images/import_file.png");
  importSDDButton->setIcon(importSDDIcon);
  importSDDButton->setIconSize(QSize(40,40));
  connect( importSDDButton, SIGNAL(clicked()), this, SIGNAL(importSDDClicked()) );
*/
  QWidget * projectChooserView = new QWidget();
  projectChooserView->setFixedWidth(238);
  projectChooserView->setStyleSheet("QWidget { background: #F2F2F2; }");
  QVBoxLayout * projectChooserLayout = new QVBoxLayout();
  projectChooserLayout->setContentsMargins(10,10,10,10);
  QLabel * projectChooserLabel = new QLabel("Create New From Template");
  projectChooserLabel->setStyleSheet("QLabel { font: bold }");
  projectChooserLayout->addWidget(projectChooserLabel,0,Qt::AlignTop);
  m_listView = new QListView();
  m_listView->setViewMode(QListView::IconMode);
  m_listView->setModel(m_templateListModel.get());
  m_listView->setFocusPolicy(Qt::NoFocus);
  m_listView->setFlow(QListView::LeftToRight);
  m_listView->setUniformItemSizes(true);
  m_listView->setSelectionMode(QAbstractItemView::SingleSelection);
  projectChooserLayout->addWidget(m_listView);
  projectChooserView->setLayout(projectChooserLayout);

  m_projectDetailView = new QWidget();
  m_projectDetailView->setStyleSheet("QWidget { background: #F2F2F2; }");
  QVBoxLayout * projectDetailLayout = new QVBoxLayout();
  projectDetailLayout->setContentsMargins(10,10,10,10);
  m_projectDetailView->setLayout(projectDetailLayout);

  QWidget * footerView = new QWidget();
  footerView->setObjectName("FooterView");
  footerView->setStyleSheet("QWidget#FooterView { background: #E6E6E6; }");
  footerView->setMaximumHeight(50);
  footerView->setMinimumHeight(50);

  QPushButton * cancelButton = new QPushButton();
  cancelButton->setObjectName("StandardGrayButton");
  cancelButton->setMinimumSize(QSize(99,28));
  #ifdef OPENSTUDIO_PLUGIN
    cancelButton->setText("Cancel");
    connect( cancelButton, SIGNAL(clicked()), this, SLOT(hide()) );
  #else
    #ifdef Q_OS_MAC
      cancelButton->setText("Quit");
    #else
      cancelButton->setText("Exit");
    #endif
    connect( cancelButton, SIGNAL(clicked()), OpenStudioApp::instance(), SLOT(quit()) );
  #endif
  cancelButton->setStyleSheet("QPushButton { font: bold; }");

  QPushButton * chooseButton = new QPushButton();
  chooseButton->setObjectName("StandardBlueButton");
  chooseButton->setText("Choose");
  chooseButton->setMinimumSize(QSize(99,28));
  connect( chooseButton, SIGNAL(clicked()), this, SLOT(newFromTemplateSlot()) );
//.........这里部分代码省略.........
开发者ID:CUEBoxer,项目名称:OpenStudio,代码行数:101,代码来源:StartupView.cpp

示例11: query


//.........这里部分代码省略.........
    treeFaces->setSelectionModel(modelSelectionFaces);
    treeFaces->setEditTriggers(QAbstractItemView::NoEditTriggers);
    treeFaces->installEventFilter(this);

    treePartner->setObjectName("treeViewPartner");
    treePartner->setRootIsDecorated(false);
    treePartner->setAlternatingRowColors(true);
    treePartner->setModel(modelPartner);
    treePartner->setSelectionModel(modelSelectionPartner);
    treePartner->setEditTriggers(QAbstractItemView::NoEditTriggers);
    treePartner->installEventFilter(this);

    treeHuman->setObjectName("treeViewHuman");
    treeHuman->setRootIsDecorated(false);
    treeHuman->setAlternatingRowColors(true);
    treeHuman->setModel(modelHuman);
    treeHuman->setSelectionModel(modelSelectionHuman);
    treeHuman->setEditTriggers(QAbstractItemView::NoEditTriggers);
    treeHuman->installEventFilter(this);

    filter = new CFilter(this);
    filter->setObjectName("filter");
    filter->setPlaceholderText("Введите наименование");
    filter->installEventFilter(this);
    filter->setValidator(new QRegExpValidator(QRegExp(trUtf8("[а-яА-Яa-zA-Z0-9_]+")), this));
    ui->hLayoutSearchToItem->addWidget(filter);

    QToolButton *telephone = new QToolButton(this);
    QPixmap pixmapTelephone("data/picture/additionally/telephone.png");

    telephone->setIcon(QIcon(pixmapTelephone));
    telephone->setIconSize(QSize(24, 24));
    telephone->setCursor(Qt::PointingHandCursor);
    telephone->setStyleSheet("QToolButton { border: none; padding: 0px; }");
    ui->hLayoutSearchToItem->addWidget(telephone);

    QToolButton *meeting = new QToolButton(this);
    QPixmap pixmapMeeting("data/picture/additionally/meeting.png");

    meeting->setIcon(QIcon(pixmapMeeting));
    meeting->setIconSize(QSize(24, 24));
    meeting->setCursor(Qt::PointingHandCursor);
    meeting->setStyleSheet("QToolButton { border: none; padding: 0px; }");
    ui->hLayoutSearchToItem->addWidget(meeting);

    QToolButton *event = new QToolButton(this);
    QPixmap pixmapEvent("data/picture/additionally/event.png");

    event->setIcon(QIcon(pixmapEvent));
    event->setIconSize(QSize(24, 24));
    event->setCursor(Qt::PointingHandCursor);
    event->setStyleSheet("QToolButton { border: none; padding: 0px; }");
    ui->hLayoutSearchToItem->addWidget(event);

    QToolButton *task = new QToolButton(this);
    QPixmap pixmapTask("data/picture/additionally/task.png");

    task->setIcon(QIcon(pixmapTask));
    task->setIconSize(QSize(24, 24));
    task->setCursor(Qt::PointingHandCursor);
    task->setStyleSheet("QToolButton { border: none; padding: 0px; }");
    ui->hLayoutSearchToItem->addWidget(task);

    ui->labelCurrentUser->setText(QString("Пользователь: <b><u>" + currentUser() + "</u></b>"));

    mc.idCustomer      = -1;
开发者ID:dekalo64,项目名称:RLine,代码行数:67,代码来源:dct_customer.cpp

示例12: setWindowFlags

mainWindow::mainWindow()
{
    this->resize(440, 280);
    setWindowFlags(Qt::FramelessWindowHint);
    QLabel *background = new QLabel(this);
    background->setStyleSheet("background-color:lightblue");
    background->setGeometry(0,0,this->width(),this->height());

    int width = this->width();
    QToolButton *minButton = new QToolButton(this);
    QToolButton *closeButton = new QToolButton(this);

    connect(minButton,SIGNAL(clicked()),this,SLOT(showMinimized()));
    connect(closeButton, SIGNAL(clicked()), this, SLOT(close()));

    minButton->setGeometry(width-50,5,20,20);
    closeButton->setGeometry(width-25,5,20,20);

    QPixmap minPix = style()->standardPixmap(QStyle::SP_TitleBarMinButton);
    QPixmap closePix = style()->standardPixmap(QStyle::SP_TitleBarCloseButton);

    minButton->setIcon(minPix);
    closeButton->setIcon(closePix);
    minButton->setToolTip(tr("最小化"));
    closeButton->setToolTip(tr("关闭"));

    minButton->setStyleSheet("background-color:transparent");
    closeButton->setStyleSheet("background-color:transparent;");

    nickNameLabel.setParent(this);      //昵称处
    nickNameLabel.setGeometry(QRect(30, 10, 50, 25));
    nickNameLabel.setText("昵称");
    tipLabel.setParent(this);       //建议框
    tipLabel.setGeometry(QRect(100, 10, 220, 25));
    tipLabel.setText("您今天背诵了XX个单词");
    time.setParent(this);
    time.setGeometry(320, 10, 60, 25);
    QTimer *timer1 = new QTimer(this);
    timer1->start(1000);
    connect(timer1, SIGNAL(timeout()), this, SLOT(tim_slot()));
    inquireEdit.setParent(this);    //查询区
    inquireEdit.setGeometry(QRect(40, 60, 280, 30));
    inquireEdit.setText("请输入要查询的文本");
    inquireEdit.setFocus();
    search.setParent(this);         //搜索按钮
    search.setGeometry(QRect(330, 60, 100, 30));
    search.setText("开始查询");
    dayEnglish_1.setParent(this);   //每日英语
    dayEnglish_1.setGeometry(QRect(0, 100, 160, 220));
    dayEnglish_1.setWordWrap(true);
    dayEnglish_1.setAlignment(Qt::AlignTop);
    dayEnglish_1.setText("每\n日\n英\n语\n区");
    dayEnglish_1.setStyleSheet("background-color:lightgreen");
    wordEnglish_2.setParent(this);  //单词专区
    wordEnglish_2.setGeometry(QRect(160, 100,160, 220));
    wordEnglish_2.setWordWrap(true);
    wordEnglish_2.setAlignment(Qt::AlignTop);
    wordEnglish_2.setText("英\n语\n单\n词\n区");
    wordEnglish_2.setStyleSheet("background-color:lightyellow");
    testEnglish_3.setParent(this);  //测试专区
    testEnglish_3.setGeometry(QRect(320, 100, 160, 220));
    testEnglish_3.setWordWrap(true);
    testEnglish_3.setAlignment(Qt::AlignTop);
    testEnglish_3.setStyleSheet("background-color:purple");
    testEnglish_3.setText("英\n语\n测\n试\n区");
}
开发者ID:xingzb14,项目名称:wordProject,代码行数:66,代码来源:mainwindow.cpp

示例13: slotPopulateToolbar

// adds dynamic actions to the toolbar (example settings)
void RenderWindow::slotPopulateToolbar(bool completeRefresh)
{
	WriteLog("cInterface::PopulateToolbar(QWidget *window, QToolBar *toolBar) started", 2);
	QDir toolbarDir = QDir(systemData.dataDirectory + "toolbar");
	toolbarDir.setSorting(QDir::Time);
	QStringList toolbarFiles = toolbarDir.entryList(QDir::NoDotAndDotDot | QDir::Files);
	QSignalMapper *mapPresetsFromExamplesLoad = new QSignalMapper(this);
	QSignalMapper *mapPresetsFromExamplesRemove = new QSignalMapper(this);
	ui->toolBar->setIconSize(
		QSize(gPar->Get<int>("toolbar_icon_size"), gPar->Get<int>("toolbar_icon_size")));

	QList<QAction *> actions = ui->toolBar->actions();
	QStringList toolbarInActions;
	for (int i = 0; i < actions.size(); i++)
	{
		QAction *action = actions.at(i);
		if (action->objectName() == "actionAdd_Settings_to_Toolbar") continue;
		if (!toolbarFiles.contains(action->objectName()) || completeRefresh)
		{
			// preset has been removed
			ui->toolBar->removeAction(action);
		}
		else
		{
			toolbarInActions << action->objectName();
		}
	}

	for (int i = 0; i < toolbarFiles.size(); i++)
	{
		if (toolbarInActions.contains(toolbarFiles.at(i)))
		{
			// already present
			continue;
		}
		QString filename = systemData.dataDirectory + "toolbar/" + toolbarFiles.at(i);
		cThumbnailWidget *thumbWidget = NULL;

		if (QFileInfo(filename).suffix() == QString("fract"))
		{
			WriteLogString("Generating thumbnail for preset", filename, 2);
			cSettings parSettings(cSettings::formatFullText);
			parSettings.BeQuiet(true);

			if (parSettings.LoadFromFile(filename))
			{
				cParameterContainer *par = new cParameterContainer;
				cFractalContainer *parFractal = new cFractalContainer;
				InitParams(par);
				for (int i = 0; i < NUMBER_OF_FRACTALS; i++)
					InitFractalParams(&parFractal->at(i));

				/****************** TEMPORARY CODE FOR MATERIALS *******************/

				InitMaterialParams(1, par);

				/*******************************************************************/

				if (parSettings.Decode(par, parFractal))
				{
					thumbWidget = new cThumbnailWidget(
						gPar->Get<int>("toolbar_icon_size"), gPar->Get<int>("toolbar_icon_size"), 2, this);
					thumbWidget->UseOneCPUCore(true);
					thumbWidget->AssignParameters(*par, *parFractal);
				}
				delete par;
				delete parFractal;
			}
		}

		if (thumbWidget)
		{
			QWidgetAction *action = new QWidgetAction(this);
			QToolButton *buttonLoad = new QToolButton;
			QVBoxLayout *tooltipLayout = new QVBoxLayout;
			QToolButton *buttonRemove = new QToolButton;

			tooltipLayout->setContentsMargins(3, 3, 3, 3);
			tooltipLayout->addWidget(thumbWidget);
			QIcon iconDelete = QIcon::fromTheme("list-remove", QIcon(":system/icons/list-remove.svg"));
			buttonRemove->setIcon(iconDelete);
			buttonRemove->setMaximumSize(QSize(15, 15));
			buttonRemove->setStyleSheet("margin-bottom: -2px; margin-left: -2px;");
			tooltipLayout->addWidget(buttonRemove);
			buttonLoad->setToolTip(QObject::tr("Toolbar settings: ") + filename);
			buttonLoad->setLayout(tooltipLayout);
			action->setDefaultWidget(buttonLoad);
			action->setObjectName(toolbarFiles.at(i));
			ui->toolBar->addAction(action);

			mapPresetsFromExamplesLoad->setMapping(buttonLoad, filename);
			mapPresetsFromExamplesRemove->setMapping(buttonRemove, filename);
			QApplication::connect(buttonLoad, SIGNAL(clicked()), mapPresetsFromExamplesLoad, SLOT(map()));
			QApplication::connect(
				buttonRemove, SIGNAL(clicked()), mapPresetsFromExamplesRemove, SLOT(map()));
		}
	}
	QApplication::connect(
		mapPresetsFromExamplesLoad, SIGNAL(mapped(QString)), this, SLOT(slotMenuLoadPreset(QString)));
//.........这里部分代码省略.........
开发者ID:valera-rozuvan,项目名称:mandelbulber2,代码行数:101,代码来源:render_window_slots.cpp

示例14: pixmap

bossWindow::bossWindow(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::bossWindow)
{
    ui->setupUi(this);
#pragma region window initialize
    QPropertyAnimation *animation = new QPropertyAnimation(this, "windowOpacity");
    animation->setDuration(700);
    animation->setStartValue(0);
    animation->setEndValue(1);
    animation->start();
    //界面动画,改变透明度的方式出现0 - 1渐变
    //设置窗体标题栏隐藏并设置位于顶层
    QPalette palette;
    setWindowOpacity(1);
    QPixmap pixmap("image/uiBG.png");
    palette.setBrush(ui->Under->backgroundRole(),QBrush(pixmap));
    ui->Under->setPalette(palette);
    ui->Under->setMask(pixmap.mask());  //可以将图片中透明部分显示为透明的
    ui->Under->setAutoFillBackground(true);

    ui->lineEdit_passwd->setEchoMode(QLineEdit::Password);

    setWindowFlags(Qt::FramelessWindowHint);
    setAttribute(Qt::WA_TranslucentBackground);
    //构建最小化、最大化、关闭按钮
    QToolButton *minButton = new QToolButton(this);
    QToolButton *closeButton= new QToolButton(this);
    connect (minButton,SIGNAL(clicked()),this,SLOT(showMinimized()));
    connect (closeButton,SIGNAL(clicked()),this,SLOT(wind_close()));//构建新槽 关闭当前窗口=注销
    //获取最小化、关闭按钮图标
    QPixmap minPix  = style()->standardPixmap(QStyle::SP_TitleBarMinButton);
    QPixmap closePix = style()->standardPixmap(QStyle::SP_TitleBarCloseButton);
    //设置最小化、关闭按钮图标
    minButton->setIcon(minPix);
    closeButton->setIcon(closePix);
    //设置最小化、关闭按钮在界面的位置
    minButton->setGeometry(700-30,10,20,20);
    closeButton->setGeometry(700-8,10,20,20);
    //设置鼠标移至按钮上的提示信息
    minButton->setToolTip(tr("最小化"));
    closeButton->setToolTip(tr("关闭"));
    //设置最小化、关闭按钮的样式
    minButton->setStyleSheet("background-color:transparent;");
    closeButton->setStyleSheet("background-color:transparent;");
    qDebug()<< "asdasd";
//    ui->frame_menu->hide();
    ui->frame_order->hide();//查看页面隐藏
    ui->frame_scy->hide();
    ui->label_username->setText(all_SCY[active_scy].show_username());//用户名设置
    ui->lcdNumber_amount->display(all_SCY[active_scy].show_amount_count());//总金额
    ui->lcdNumber_counter->display(all_SCY[active_scy].show_order_count());//总订单数

#pragma endregion window initialize

    int i;

    /*菜单初始化*/
    model_menu2->setHorizontalHeaderItem(0,new QStandardItem(QObject::tr("Name")));//行标设置
    model_menu2->setHorizontalHeaderItem(1,new QStandardItem(QObject::tr("Price")));
    model_menu2->setHorizontalHeaderItem(2,new QStandardItem(QObject::tr("Rank")));
    ui->tableView_menu->setSelectionBehavior(QAbstractItemView::SelectRows);//点击选中行
    ui->tableView_menu->setEditTriggers(QAbstractItemView::NoEditTriggers);//不能编辑
    /*输出菜单至界面*/
    for (i = 0;i<all_food.size();i++)
    {
        model_menu2->setItem(i, 0, new QStandardItem(all_food[i].show_food_name()));//输出菜品名字
        model_menu2->setItem(i, 1, new QStandardItem(QString::number(all_food[i].show_food_price(),10)));//价格
        model_menu2->setItem(i, 2, new QStandardItem("★★★★★"));//评分
    }
    ui->tableView_menu->setModel(model_menu2);//讲model与tableview关联

    ui->tableView_menu->setColumnWidth(0,184);//设置列宽
    ui->tableView_menu->setColumnWidth(1,86);
    ui->tableView_menu->setColumnWidth(2,86);


    model_orders->setHorizontalHeaderItem(0,new QStandardItem(QObject::tr("OrderID")));
    model_orders->setHorizontalHeaderItem(1,new QStandardItem(QObject::tr("Address")));
    model_orders->setHorizontalHeaderItem(2,new QStandardItem(QObject::tr("Amount")));
    model_orders->setHorizontalHeaderItem(3,new QStandardItem(QObject::tr("state")));
    model_orders->setHorizontalHeaderItem(4,new QStandardItem(QObject::tr("Customer")));
    model_orders->setHorizontalHeaderItem(5,new QStandardItem(QObject::tr("Deliver")));
    ui->tableView_orders ->setSelectionBehavior(QAbstractItemView::SelectRows);
    ui->tableView_orders->setEditTriggers(QAbstractItemView::NoEditTriggers);
    ui->tableView_orders->setModel(model_orders);

    ui->tableView_orders->setColumnWidth(0,50);
    ui->tableView_orders->setColumnWidth(1,200);
    ui->tableView_orders->setColumnWidth(2,50);
    ui->tableView_orders->setColumnWidth(3,80);
    ui->tableView_orders->setColumnWidth(4,80);
    ui->tableView_orders->setColumnWidth(5,80);

    set_view_orders();

    model_scy->setHorizontalHeaderItem(0,new QStandardItem(QObject::tr("ID")));
    model_scy->setHorizontalHeaderItem(1,new QStandardItem(QObject::tr("Name")));
    model_scy->setHorizontalHeaderItem(2,new QStandardItem(QObject::tr("Delivering order")));
    model_scy->setHorizontalHeaderItem(3,new QStandardItem(QObject::tr("Amount count")));
//.........这里部分代码省略.........
开发者ID:bianxbx,项目名称:CFK2,代码行数:101,代码来源:bosswindow.cpp

示例15: setWindowFlags

loginWindow::loginWindow()
{
    this->resize(480,240);
    setWindowFlags(Qt::FramelessWindowHint);
    QLabel *background = new QLabel(this);
    background->setStyleSheet("background-color:lightblue");
    background->setGeometry(0,0,this->width(),this->height());

    int width = this->width();
    QToolButton *minButton = new QToolButton(this);
    QToolButton *closeButton = new QToolButton(this);

    connect(minButton, SIGNAL(clicked()), this, SLOT(showMinimized()));
    connect(closeButton, SIGNAL(clicked()), this, SLOT(close()));

    minButton->setGeometry(width-50, 5, 20, 20);
    closeButton->setGeometry(width-25, 5, 20, 20);

    QPixmap minPix = style()->standardPixmap(QStyle::SP_TitleBarMinButton);
    QPixmap closePix = style()->standardPixmap(QStyle::SP_TitleBarCloseButton);

    minButton->setIcon(minPix);
    closeButton->setIcon(closePix);
    minButton->setToolTip("最小化");
    closeButton->setToolTip("关闭");

    minButton->setStyleSheet("background-color:transparent");
    closeButton->setStyleSheet("background-color:transparent");

    logininLabel.setParent(this);
    logininLabel.setGeometry(QRect(20, 30, 150, 60));
    logininLabel.setText("登陆界面");
    logininLabel.setStyleSheet("font-size:30px;color:black");

    wordLearning.setParent(this);
    wordLearning.setGeometry(QRect(280, 20, 180, 80));
    wordLearning.setText("单词攻克者");
    wordLearning.setStyleSheet("font-size:30px");

    join_us.setParent(this);
    join_us.setGeometry(QRect(280, 120, 200, 40));
    join_us.setText("  如果还没有加入我们\n请点击注册以获得更佳体验");

    usernameLabel.setParent(this);
    usernameLabel.setGeometry(QRect(50, 100, 50, 20));
    usernameLabel.setText("用户名");

    passwordLabel.setParent(this);
    passwordLabel.setGeometry(QRect(50, 130, 50, 20));
    passwordLabel.setText("密码");

    usernameEdit.setParent(this);
    usernameEdit.setGeometry(QRect(105, 100, 120, 20));
    usernameEdit.setMaxLength(20);
    usernameEdit.setFocus();
    passwordEdit.setParent(this);
    passwordEdit.setGeometry(QRect(105, 130, 120, 20));
    passwordEdit.setMaxLength(25);
    passwordEdit.setEchoMode(QLineEdit::Password);

    loginButton.setParent(this);
    regisButton.setParent(this);
    loginButton.setGeometry(QRect(100, 180, 100, 30));
    loginButton.setText("login");
    regisButton.setGeometry(QRect(305, 180, 100, 30));
    regisButton.setText("点我注册");

    passwordBox.setParent(this);
    passwordBox.setGeometry(145, 155, 15, 15);
    rememberPasswordLabel.setParent(this);
    rememberPasswordLabel.setGeometry(165, 155, 70, 15);
    rememberPasswordLabel.setText("记住密码");

}
开发者ID:xingzb14,项目名称:wordProject,代码行数:74,代码来源:loginwindow.cpp


注:本文中的QToolButton::setStyleSheet方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。