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


C++ setObjectName函数代码示例

本文整理汇总了C++中setObjectName函数的典型用法代码示例。如果您正苦于以下问题:C++ setObjectName函数的具体用法?C++ setObjectName怎么用?C++ setObjectName使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: NatureSlash

FireSlash::FireSlash(Suit suit, int number)
    : NatureSlash(suit, number, DamageStruct::Fire)
{
    setObjectName("fire_slash");
    nature = DamageStruct::Fire;
}
开发者ID:popkc,项目名称:QSanguosha-v2,代码行数:6,代码来源:maneuvering.cpp

示例2: QWidget

	LoginPage::LoginPage(QWidget* parent)
		: QWidget(parent)
		, country_code_(new LineEditEx(this))
		, phone_(new LineEditEx(this))
		, combobox_(new CountrySearchCombobox(this))
		, remaining_seconds_(0)
		, timer_(new QTimer(this))
	{
        setStyleSheet(Utils::LoadStyle(":/main_window/login_page.qss", Utils::get_scale_coefficient(), true));
        if (objectName().isEmpty())
            setObjectName(QStringLiteral("login_page"));
        setProperty("LoginPageWidget", QVariant(true));
        QVBoxLayout* verticalLayout = new QVBoxLayout(this);
        verticalLayout->setSpacing(0);
        verticalLayout->setObjectName(QStringLiteral("verticalLayout"));
        verticalLayout->setContentsMargins(0, 0, 0, 0);
        
        auto back_button_widget = new QWidget(this);
        auto back_button_layout = new QHBoxLayout(back_button_widget);
        Utils::ApplyStyle(back_button_widget, "background-color: transparent;");
        back_button_widget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
        back_button_layout->setSpacing(0);
        back_button_layout->setContentsMargins(Utils::scale_value(14), Utils::scale_value(14), 0, 0);
        back_button_layout->setAlignment(Qt::AlignLeft);
        {
            prev_page_link_ = new BackButton(back_button_widget);
            prev_page_link_->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
            prev_page_link_->setFlat(true);
            prev_page_link_->setFocusPolicy(Qt::NoFocus);
            prev_page_link_->setCursor(Qt::PointingHandCursor);
            {
                const QString s = "QPushButton { width: 20dip; height: 20dip; border: none; background-color: transparent; border-image: url(:/resources/contr_back_100.png); margin: 10dip; } QPushButton:hover { border-image: url(:/resources/contr_back_100_hover.png); } QPushButton#back_button:pressed { border-image: url(:/resources/contr_back_100_active.png); }";
                Utils::ApplyStyle(prev_page_link_, s);
            }
            back_button_layout->addWidget(prev_page_link_);
        }
        verticalLayout->addWidget(back_button_widget);
        
        /*
        QWidget* back_button_widget = new QWidget(this);
        back_button_widget->setObjectName(QStringLiteral("back_button_widget"));
        back_button_widget->setProperty("BackButtonWidget", QVariant(true));
        QHBoxLayout* back_button_layout = new QHBoxLayout(back_button_widget);
        back_button_layout->setSpacing(0);
        back_button_layout->setObjectName(QStringLiteral("back_button_layout"));
        back_button_layout->setContentsMargins(Utils::scale_value(14), Utils::scale_value(14), 0, 0);
        prev_page_link_ = new BackButton(back_button_widget);
        prev_page_link_->setObjectName(QStringLiteral("prev_page_link"));
        prev_page_link_->setCursor(QCursor(Qt::PointingHandCursor));
        prev_page_link_->setProperty("LoginBackButton", QVariant(true));
        back_button_layout->addWidget(prev_page_link_);
        
        QSpacerItem* horizontalSpacer_3 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
        back_button_layout->addItem(horizontalSpacer_3);

        verticalLayout->addWidget(back_button_widget);
        */
         
        QSpacerItem* verticalSpacer = new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding);
        
        verticalLayout->addItem(verticalSpacer);
        
        QWidget* main_widget = new QWidget(this);
        main_widget->setObjectName(QStringLiteral("main_widget"));
        QSizePolicy sizePolicy(QSizePolicy::Minimum, QSizePolicy::Expanding);
        sizePolicy.setHorizontalStretch(0);
        sizePolicy.setVerticalStretch(0);
        sizePolicy.setHeightForWidth(main_widget->sizePolicy().hasHeightForWidth());
        main_widget->setSizePolicy(sizePolicy);
        main_widget->setProperty("CenterControlWidgetBack", QVariant(true));
        QHBoxLayout* main_layout = new QHBoxLayout(main_widget);
        main_layout->setSpacing(0);
        main_layout->setObjectName(QStringLiteral("main_layout"));
        main_layout->setContentsMargins(0, 0, 0, 0);
        QSpacerItem* horizontalSpacer_6 = new QSpacerItem(0, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
        
        main_layout->addItem(horizontalSpacer_6);
        
        QWidget* controls_widget = new QWidget(main_widget);
        controls_widget->setObjectName(QStringLiteral("controls_widget"));
        QSizePolicy sizePolicy1(QSizePolicy::Minimum, QSizePolicy::Minimum);
        sizePolicy1.setHorizontalStretch(0);
        sizePolicy1.setVerticalStretch(0);
        sizePolicy1.setHeightForWidth(controls_widget->sizePolicy().hasHeightForWidth());
        controls_widget->setSizePolicy(sizePolicy1);
        controls_widget->setProperty("CenterContolWidget", QVariant(true));
        QVBoxLayout* controls_layout = new QVBoxLayout(controls_widget);
        controls_layout->setSpacing(0);
        controls_layout->setObjectName(QStringLiteral("controls_layout"));
        controls_layout->setContentsMargins(0, 0, 0, 0);
        PictureWidget* logo_widget = new PictureWidget(controls_widget, ":/resources/main_window/content_logo_100.png");
        logo_widget->setFixedHeight(Utils::scale_value(80));
        logo_widget->setFixedWidth(Utils::scale_value(80));
        controls_layout->addWidget(logo_widget);
        controls_layout->setAlignment(logo_widget, Qt::AlignHCenter);
        
        QLabel* welcome_label = new QLabel(controls_widget);
        welcome_label->setObjectName(QStringLiteral("welcome_label"));
        welcome_label->setAlignment(Qt::AlignCenter);
        welcome_label->setProperty("WelcomeTitle", QVariant(true));
//.........这里部分代码省略.........
开发者ID:4ynyky,项目名称:icqdesktop,代码行数:101,代码来源:LoginPage.cpp

示例3: setObjectName

void KviWindow::setWindowName(const QString & szName)
{
	m_szName = szName;
	setObjectName(szName);
	emit windowNameChanged();
}
开发者ID:HasClass0,项目名称:KVIrc,代码行数:6,代码来源:KviWindow.cpp

示例4: KDialog

/*
	InputDialog
*/
InputDialog::InputDialog(const QString &caption, uint options, const QStringList& history, const QString& hint, const QString& alter, KileInfo *ki, QWidget *parent, const char *name)
	: KDialog (parent), m_ki(ki)
{
	setModal(true);
	setButtons(Ok | Cancel);
	setDefaultButton(Ok);
	showButtonSeparator(true);
	setObjectName(name);

	QString newcaption = caption;
	setCaption(newcaption.remove('&'));

	m_labelprefix = ( newcaption == "chapter" ) ? "chap:" : "sec:";

	m_usedSelection = false;

	QWidget *page = new QWidget(this);
	setMainWidget(page);
	QGridLayout *gbox = new QGridLayout(page);

	QLabel *lb = new QLabel(hint, page);
	gbox->addWidget(lb, 0, 0, 1, 3);

	m_tag.clear();
	QWidget *focus;
	if((options & KileAction::KeepHistory) || (options & KileAction::FromLabelList) || (options & KileAction::FromBibItemList)) {
		KComboBox *input = new KComboBox(true, page);
		input->setObjectName("input_dialog_input");
		input->setCompletionMode(KGlobalSettings::CompletionAuto);
		input->setMinimumWidth(300);
		focus = input;

		connect(input, SIGNAL(textChanged(const QString&)), this, SLOT(setTag(const QString&)));
		connect(this,  SIGNAL(setInput(const QString&)), input, SLOT(setEditText(const QString&)));
		if(options & KileAction::ShowBrowseButton) {
			gbox->addWidget(input, 1, 0);
		}
		else {
			gbox->addWidget(input, 1, 0, 1, 3);
		}

		QStringList list;

		if(options & KileAction::FromLabelList) {
			list = ki->allLabels();
			if(list.size() > 0) {
				input->addItems(list);
				m_tag = list.first();
			}
		}
		else if(options & KileAction::FromBibItemList) {
			list = ki->allBibItems();
			if(list.size() > 0) {
				input->addItems(list);
				m_tag = list.first();
			}
		}
		else {
			if(history.size() > 0){
				input->addItems(history);
				m_tag = history.first();
			}
		}
	}
开发者ID:fagu,项目名称:kileip,代码行数:67,代码来源:kileactions.cpp

示例5: QDialog

BaselineDialog::BaselineDialog( QWidget* parent, Qt::WFlags fl )
	: QDialog( parent, fl ),
	d_baseline(NULL),
	d_table(NULL),
	d_picker_tool(NULL)
{
	setObjectName( "BaselineDialog" );
	setWindowTitle(tr("QtiPlot") + " - " + tr("Baseline"));
	setAttribute(Qt::WA_DeleteOnClose);
	setSizeGripEnabled( true );

	QGroupBox *gb1 = new QGroupBox();
	QGridLayout *gl1 = new QGridLayout(gb1);

	gl1->addWidget(new QLabel(tr("Curve")), 0, 0);

	boxInputName = new QComboBox();
	gl1->addWidget(boxInputName, 0, 1);

	boxPoints = new QSpinBox();
	boxPoints->setMinimum(2);
	boxPoints->setMaximum(INT_MAX);

	gl1->addWidget(new QLabel(tr("Points")), 1, 0);
	gl1->addWidget(boxPoints, 1, 1);

	btnAutomatic = new QRadioButton(tr("&Interpolation"));
	btnAutomatic->setChecked(true);
	gl1->addWidget(btnAutomatic, 2, 0);

	boxInterpolationMethod = new QComboBox();
	boxInterpolationMethod->addItems(QStringList() << tr("Linear") << tr("Cubic") << tr("Non-rounded Akima"));
	gl1->addWidget(boxInterpolationMethod, 2, 1);

	btnEquation = new QRadioButton(tr("User Defined &Equation Y ="));
	btnEquation->setChecked(false);
	gl1->addWidget(btnEquation, 3, 0);

	boxEquation = new QLineEdit();
	gl1->addWidget(boxEquation, 3, 1);

	btnDataset = new QRadioButton(tr("Existing &Dataset"));
	btnDataset->setChecked(false);
	gl1->addWidget(btnDataset, 4, 0);

	boxTableName = new QComboBox();
	boxColumnName = new QComboBox();

	QHBoxLayout *hb0 = new QHBoxLayout();
	hb0->addWidget(boxTableName);
	hb0->addWidget(boxColumnName);
	gl1->addLayout(hb0, 4, 1);

	gl1->setColumnStretch(1, 1);
	gl1->setRowStretch(5, 1);

	ApplicationWindow *app = (ApplicationWindow *)parent;
	boxTableName->addItems(app->tableNames());
	updateTableColumns(0);

	buttonCreate = new QPushButton(tr( "Create &Baseline" ));
	buttonCreate->setDefault( true );
	buttonSubtract = new QPushButton(tr( "&Subtract" ));
	buttonUndo = new QPushButton(tr( "&Undo Subtraction" ));
	buttonModify = new QPushButton(tr( "&Modify" ));
	buttonModify->setCheckable(true);
	buttonCancel = new QPushButton(tr( "&Close" ));

	QVBoxLayout *vl = new QVBoxLayout();
	vl->addWidget(buttonCreate);
	vl->addWidget(buttonModify);
	vl->addWidget(buttonSubtract);
	vl->addWidget(buttonUndo);
	vl->addStretch();
	vl->addWidget(buttonCancel);

	QHBoxLayout *hb = new QHBoxLayout(this);
	hb->addWidget(gb1);
	hb->addLayout(vl);

	enableBaselineOptions();

	connect(boxTableName, SIGNAL(activated(int)), this, SLOT(updateTableColumns(int)));
	connect(buttonCancel, SIGNAL(clicked()), this, SLOT(close()));
	connect(buttonCreate, SIGNAL(clicked()), this, SLOT(createBaseline()));
	connect(buttonSubtract, SIGNAL(clicked()), this, SLOT(subtractBaseline()));
	connect(buttonUndo, SIGNAL(clicked()), this, SLOT(undo()));
	connect(buttonModify, SIGNAL(clicked()), this, SLOT(modifyBaseline()));

	connect(btnAutomatic, SIGNAL(toggled(bool)), this, SLOT(enableBaselineOptions()));
	connect(btnEquation, SIGNAL(toggled(bool)), this, SLOT(enableBaselineOptions()));
	connect(btnDataset, SIGNAL(toggled(bool)), this, SLOT(enableBaselineOptions()));
}
开发者ID:BackupTheBerlios,项目名称:qtiplot-svn,代码行数:93,代码来源:BaselineDialog.cpp

示例6: QDialog

ProgressDialog::ProgressDialog( QWidget* pParent, QStatusBar* pStatusBar )
: QDialog(pParent), m_pStatusBar(pStatusBar)
{
   m_pGuiThread = QThread::currentThread();

   setObjectName("ProgressDialog");
   m_bStayHidden = false;
   setModal(true);
   QVBoxLayout* layout = new QVBoxLayout(this);

   m_pInformation = new QLabel( " ", this );
   layout->addWidget( m_pInformation );

   m_pProgressBar = new QProgressBar();
   m_pProgressBar->setRange(0,1000);
   layout->addWidget( m_pProgressBar );

   m_pSubInformation = new QLabel( " ", this);
   layout->addWidget( m_pSubInformation );

   m_pSubProgressBar = new QProgressBar();
   m_pSubProgressBar->setRange(0,1000);
   layout->addWidget( m_pSubProgressBar );

   m_pSlowJobInfo = new QLabel( " ", this);
   layout->addWidget( m_pSlowJobInfo );

   QHBoxLayout* hlayout = new QHBoxLayout();
   layout->addLayout(hlayout);
   hlayout->addStretch(1);
   m_pAbortButton = new QPushButton( i18n("&Cancel"), this);
   hlayout->addWidget( m_pAbortButton );
   connect( m_pAbortButton, SIGNAL(clicked()), this, SLOT(slotAbort()) );

   if (m_pStatusBar)
   {
      m_pStatusBarWidget = new QWidget;
      QHBoxLayout* pStatusBarLayout = new QHBoxLayout(m_pStatusBarWidget);
      pStatusBarLayout->setMargin(0);
      pStatusBarLayout->setSpacing(3);
      m_pStatusProgressBar = new QProgressBar;
      m_pStatusProgressBar->setRange(0, 1000);
      m_pStatusProgressBar->setTextVisible(false);
      m_pStatusAbortButton = new QPushButton( i18n("&Cancel") );
      connect(m_pStatusAbortButton, SIGNAL(clicked()), this, SLOT(slotAbort()));
      pStatusBarLayout->addWidget(m_pStatusProgressBar);
      pStatusBarLayout->addWidget(m_pStatusAbortButton);
      m_pStatusBar->addPermanentWidget(m_pStatusBarWidget,0);
      m_pStatusBarWidget->setFixedHeight(m_pStatusBar->height());
      m_pStatusBarWidget->hide();
   }
   else
   {
      m_pStatusProgressBar = 0;
      m_pStatusAbortButton = 0;
   }

   m_progressDelayTimer = 0;
   m_delayedHideTimer = 0;
   m_delayedHideStatusBarWidgetTimer = 0;
   resize(400, 100);
   m_t1.start();
   m_t2.start();
   m_bWasCancelled = false;
   m_eCancelReason = eUserAbort;
   m_pJob = 0;
}
开发者ID:Stibbons,项目名称:kdiff3,代码行数:67,代码来源:progress.cpp

示例7: QDockWidget

TileStampsDock::TileStampsDock(TileStampManager *stampManager, QWidget *parent)
    : QDockWidget(parent)
    , mTileStampManager(stampManager)
    , mTileStampModel(stampManager->tileStampModel())
    , mNewStamp(new QAction(this))
    , mAddVariation(new QAction(this))
    , mDelete(new QAction(this))
{
    setObjectName(QLatin1String("TileStampsDock"));

    mTileStampView = new TileStampView(this);
    mTileStampView->setModel(mTileStampModel);
    mTileStampView->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);
    mTileStampView->header()->setStretchLastSection(false);
#if QT_VERSION >= 0x050000
    mTileStampView->header()->setSectionResizeMode(0, QHeaderView::Stretch);
    mTileStampView->header()->setSectionResizeMode(1, QHeaderView::ResizeToContents);
#else
    mTileStampView->header()->setResizeMode(0, QHeaderView::Stretch);
    mTileStampView->header()->setResizeMode(1, QHeaderView::ResizeToContents);
#endif

    mTileStampView->setContextMenuPolicy(Qt::CustomContextMenu);
    connect(mTileStampView, SIGNAL(customContextMenuRequested(QPoint)),
            SLOT(showContextMenu(QPoint)));

    mNewStamp->setIcon(QIcon(QLatin1String(":images/16x16/document-new.png")));
    mAddVariation->setIcon(QIcon(QLatin1String(":/images/16x16/add.png")));
    mDelete->setIcon(QIcon(QLatin1String(":images/16x16/edit-delete.png")));

    Utils::setThemeIcon(mNewStamp, "document-new");
    Utils::setThemeIcon(mAddVariation, "add");
    Utils::setThemeIcon(mDelete, "edit-delete");

    connect(mNewStamp, SIGNAL(triggered()), stampManager, SLOT(newStamp()));
    connect(mAddVariation, SIGNAL(triggered()), SLOT(addVariation()));
    connect(mDelete, SIGNAL(triggered()), SLOT(delete_()));

    mDelete->setEnabled(false);
    mAddVariation->setEnabled(false);

    QWidget *widget = new QWidget(this);
    QVBoxLayout *layout = new QVBoxLayout(widget);
    layout->setMargin(5);

    QToolBar *buttonContainer = new QToolBar;
    buttonContainer->setFloatable(false);
    buttonContainer->setMovable(false);
    buttonContainer->setIconSize(QSize(16, 16));

    buttonContainer->addAction(mNewStamp);
    buttonContainer->addAction(mAddVariation);
    buttonContainer->addAction(mDelete);

    QVBoxLayout *listAndToolBar = new QVBoxLayout;
    listAndToolBar->setSpacing(0);
    listAndToolBar->addWidget(mTileStampView);
    listAndToolBar->addWidget(buttonContainer);

    layout->addLayout(listAndToolBar);

    QItemSelectionModel *selectionModel = mTileStampView->selectionModel();
    connect(selectionModel, SIGNAL(currentRowChanged(QModelIndex,QModelIndex)),
            this, SLOT(currentRowChanged(QModelIndex)));

    setWidget(widget);
    retranslateUi();
}
开发者ID:Ju2ender,项目名称:tiled,代码行数:68,代码来源:tilestampsdock.cpp

示例8: QAction

QAction *createAction(const QString &id, QObject *parent)
{
	auto action = new QAction(parent);
	action->setObjectName(id);
	return action;
}
开发者ID:h2so5,项目名称:PaintField,代码行数:6,代码来源:util.cpp

示例9: QgsSnappingDock

 QgsSnappingDock( const QString & title, QWidget * parent = 0, Qt::WindowFlags flags = 0 )
     : QDockWidget( title, parent, flags )
 {
   setObjectName( "Snapping and Digitizing Options" ); // set object name so the position can be saved
 }
开发者ID:carsonfarmer,项目名称:Quantum-GIS,代码行数:5,代码来源:qgssnappingdialog.cpp

示例10: MoonSpear

 MoonSpear(Suit suit = Card::Diamond, int number = 12)
     :Weapon(suit, number, 3){
     setObjectName("moon_spear");
     skill = new MoonSpearSkill;
 }
开发者ID:CharlieWalker,项目名称:QSanguosha,代码行数:5,代码来源:nostalgia.cpp

示例11: QDockWidget

RgShortestPathWidget::RgShortestPathWidget( QWidget* theParent, RoadGraphPlugin *thePlugin )   : QDockWidget( theParent ), mPlugin( thePlugin )
{
  setWindowTitle( tr( "Shortest path" ) );
  setObjectName( "ShortestPathDock" );
  setAllowedAreas( Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea );

  QWidget *myWidget = new QWidget( this );
  setWidget( myWidget );

  QVBoxLayout *v = new QVBoxLayout( myWidget );
  QHBoxLayout *h = NULL;
  QLabel *l = NULL;

  l = new QLabel( tr( "Start" ), myWidget );
  v->addWidget( l );
  h = new QHBoxLayout();
  mFrontPointLineEdit = new QLineEdit( myWidget );
  mFrontPointLineEdit->setReadOnly( true );
  QToolButton *selectFrontPoint = new QToolButton( myWidget );
  selectFrontPoint->setCheckable( true );
  selectFrontPoint->setIcon( QPixmap( ":/roadgraph/coordinate_capture.png" ) );
  h->addWidget( mFrontPointLineEdit );
  h->addWidget( selectFrontPoint );
  v->addLayout( h );

  l = new QLabel( tr( "Stop" ), myWidget );
  v->addWidget( l );
  h = new QHBoxLayout();
  mBackPointLineEdit = new QLineEdit( myWidget );
  mBackPointLineEdit->setReadOnly( true );
  QToolButton *selectBackPoint = new QToolButton( myWidget );
  selectBackPoint->setCheckable( true );
  selectBackPoint->setIcon( QPixmap( ":/roadgraph/coordinate_capture.png" ) );
  h->addWidget( mBackPointLineEdit );
  h->addWidget( selectBackPoint );
  v->addLayout( h );

  h = new QHBoxLayout();
  l = new QLabel( tr( "Criterion" ), myWidget );
  mCriterionName = new QComboBox( myWidget );
  mCriterionName->insertItem( 0, tr( "Length" ) );
  mCriterionName->insertItem( 1, tr( "Time" ) );
  h->addWidget( l );
  h->addWidget( mCriterionName );
  v->addLayout( h );

  h = new QHBoxLayout();
  l = new QLabel( tr( "Length" ), myWidget );
  mPathCostLineEdit = new QLineEdit( myWidget );
  mPathCostLineEdit->setReadOnly( true );
  h->addWidget( l );
  h->addWidget( mPathCostLineEdit );
  v->addLayout( h );

  h = new QHBoxLayout();
  l = new QLabel( tr( "Time" ), myWidget );
  mPathTimeLineEdit = new QLineEdit( myWidget );
  mPathTimeLineEdit->setReadOnly( true );
  h->addWidget( l );
  h->addWidget( mPathTimeLineEdit );
  v->addLayout( h );

  h = new QHBoxLayout();
  mCalculate = new QPushButton( tr( "Calculate" ), myWidget );
  h->addWidget( mCalculate );
  QPushButton *pbExport = new QPushButton( tr( "Export" ), myWidget );
  h->addWidget( pbExport );

  connect( pbExport, SIGNAL( clicked( bool ) ), this, SLOT( exportPath() ) );

  mClear =  new QPushButton( tr( "Clear" ), myWidget );
  h->addWidget( mClear );
  v->addLayout( h );

  h = new QHBoxLayout();
  QPushButton *helpButton = new QPushButton( tr( "Help" ), this );
  helpButton->setIcon( style()->standardIcon( QStyle::SP_DialogHelpButton ) );
  h->addWidget( helpButton );
  v->addLayout( h );

  v->addStretch();

  mFrontPointMapTool = new QgsMapToolEmitPoint( mPlugin->iface()->mapCanvas() );
  mFrontPointMapTool->setButton( selectFrontPoint );

  mBackPointMapTool  = new QgsMapToolEmitPoint( mPlugin->iface()->mapCanvas() );
  mBackPointMapTool->setButton( selectBackPoint );

  connect( selectFrontPoint, SIGNAL( clicked( bool ) ), this, SLOT( onSelectFrontPoint() ) );
  connect( mFrontPointMapTool, SIGNAL( canvasClicked( const QgsPoint&, Qt::MouseButton ) ),
           this, SLOT( setFrontPoint( const QgsPoint& ) ) );

  connect( selectBackPoint, SIGNAL( clicked( bool ) ), this, SLOT( onSelectBackPoint() ) );
  connect( mBackPointMapTool, SIGNAL( canvasClicked( const QgsPoint&, Qt::MouseButton ) ),
           this, SLOT( setBackPoint( const QgsPoint& ) ) );

  connect( helpButton, SIGNAL( clicked( bool ) ), this, SLOT( helpRequested() ) );
  connect( mCalculate, SIGNAL( clicked( bool ) ), this, SLOT( findingPath() ) );
  connect( mClear, SIGNAL( clicked( bool ) ), this, SLOT( clear() ) );

//.........这里部分代码省略.........
开发者ID:L-Infantini,项目名称:Quantum-GIS,代码行数:101,代码来源:shortestpathwidget.cpp

示例12: QDialog

ExpDecayDialog::ExpDecayDialog(int type, QWidget *parent, Qt::WFlags fl)
    : QDialog(parent, fl), fitter(nullptr), graph(nullptr), buttonFit(nullptr),
      buttonCancel(nullptr), boxName(nullptr), boxAmplitude(nullptr),
      boxFirst(nullptr), boxSecond(nullptr), boxThird(nullptr),
      boxStart(nullptr), boxYOffset(nullptr), thirdLabel(nullptr),
      dampingLabel(nullptr), boxColor(nullptr) {
  setObjectName("ExpDecayDialog");

  slopes = type;

  setWindowTitle(tr("MantidPlot - Verify initial guesses"));

  QGroupBox *gb1 = new QGroupBox();
  QGridLayout *gl1 = new QGridLayout();
  gl1->addWidget(new QLabel(tr("Exponential Fit of")), 0, 0);

  boxName = new QComboBox();
  connect(boxName, SIGNAL(activated(const QString &)), this,
          SLOT(activateCurve(const QString &)));
  gl1->addWidget(boxName, 0, 1);

  if (type < 0)
    dampingLabel = new QLabel(tr("Growth time"));
  else if (type == 1)
    dampingLabel = new QLabel(tr("Decay time"));
  else
    dampingLabel = new QLabel(tr("First decay time (t1)"));
  gl1->addWidget(dampingLabel, 1, 0);

  boxFirst = new QLineEdit();
  boxFirst->setText(tr("1"));
  gl1->addWidget(boxFirst, 1, 1);

  if (type > 1) {
    gl1->addWidget(new QLabel(tr("Second decay time (t2)")), 2, 0);

    boxSecond = new QLineEdit();
    boxSecond->setText(tr("1"));
    gl1->addWidget(boxSecond, 2, 1);

    thirdLabel = new QLabel(tr("Third decay time (t3)"));
    gl1->addWidget(thirdLabel, 3, 0);

    boxThird = new QLineEdit();
    boxThird->setText(tr("1"));
    gl1->addWidget(boxThird, 3, 1);

    if (type < 3) {
      thirdLabel->hide();
      boxThird->hide();
    }
  }

  if (type <= 1) {
    gl1->addWidget(new QLabel(tr("Amplitude")), 2, 0);
    boxAmplitude = new QLineEdit();
    boxAmplitude->setText(tr("1"));
    gl1->addWidget(boxAmplitude, 2, 1);
  }

  gl1->addWidget(new QLabel(tr("Y Offset")), 4, 0);
  boxYOffset = new QLineEdit();
  boxYOffset->setText(tr("0"));
  gl1->addWidget(boxYOffset, 4, 1);

  gl1->addWidget(new QLabel(tr("Initial time")), 5, 0);

  boxStart = new QLineEdit();
  boxStart->setText(tr("0"));
  gl1->addWidget(boxStart, 5, 1);

  gl1->addWidget(new QLabel(tr("Color")), 6, 0);
  boxColor = new ColorBox();
  boxColor->setColor(QColor(Qt::red));
  gl1->addWidget(boxColor, 6, 1);

  gb1->setLayout(gl1);

  buttonFit = new QPushButton(tr("&Fit"));
  buttonFit->setDefault(true);

  buttonCancel = new QPushButton(tr("&Close"));

  QBoxLayout *bl1 = new QBoxLayout(QBoxLayout::TopToBottom);
  bl1->addWidget(buttonFit);
  bl1->addWidget(buttonCancel);
  bl1->addStretch();

  QHBoxLayout *hlayout = new QHBoxLayout();
  hlayout->addWidget(gb1);
  hlayout->addLayout(bl1);
  setLayout(hlayout);

  // signals and slots connections
  connect(buttonFit, SIGNAL(clicked()), this, SLOT(fit()));
  connect(buttonCancel, SIGNAL(clicked()), this, SLOT(close()));
}
开发者ID:mantidproject,项目名称:mantid,代码行数:97,代码来源:ExpDecayDialog.cpp

示例13: BasicCard

Analeptic::Analeptic(Card::Suit suit, int number)
    : BasicCard(suit, number)
{
    setObjectName("analeptic");
    target_fixed = true;
}
开发者ID:popkc,项目名称:QSanguosha-v2,代码行数:6,代码来源:maneuvering.cpp

示例14: TrickCard

IronChain::IronChain(Card::Suit suit, int number)
    : TrickCard(suit, number)
{
    setObjectName("iron_chain");
    can_recast = true;
}
开发者ID:popkc,项目名称:QSanguosha-v2,代码行数:6,代码来源:maneuvering.cpp

示例15: QWidget

AlbumSelectWidget::AlbumSelectWidget(QWidget* const parent, PAlbum* const albumToSelect)
    : QWidget(parent),
      d(new Private)
{
    setObjectName("AlbumSelectWidget");

    d->albumModificationHelper = new AlbumModificationHelper(this, this);

    // TODO let this class implement StateSavingObject
    KConfigGroup group = KGlobal::config()->group(objectName());

    QGridLayout* const grid = new QGridLayout(this);
    d->albumModel           = new AlbumModel(AbstractAlbumModel::IgnoreRootAlbum, this);
    d->albumTreeView        = new AlbumSelectTreeView(d->albumModel, d->albumModificationHelper, this);
    d->albumTreeView->setDragEnabled(false);
    d->albumTreeView->setDropIndicatorShown(false);
    d->albumTreeView->setAcceptDrops(false);
    d->albumTreeView->setSelectAlbumOnClick(false);
    d->albumTreeView->setSelectOnContextMenu(false);
    d->albumTreeView->setEnableContextMenu(true);
    d->albumTreeView->setSortingEnabled(true);
    d->albumTreeView->setConfigGroup(group);
    d->albumTreeView->setEntryPrefix("AlbumTreeView");

    d->searchBar   = new SearchTextBar(this, "AlbumSelectWidgetSearchBar");
    d->searchBar->setModel(d->albumModel, AbstractAlbumModel::AlbumIdRole, AbstractAlbumModel::AlbumTitleRole);
    d->searchBar->setFilterModel(d->albumTreeView->albumFilterModel());
    d->searchBar->setConfigGroup(group);
    d->albumTreeView->setEntryPrefix("AlbumTreeView");

    d->newAlbumBtn = new KPushButton(KGuiItem(i18n("&New Album"), "albumfolder-new",
                                              i18n("Create new album")), this);

    grid->addWidget(d->albumTreeView, 0, 0, 1, 2);
    grid->addWidget(d->searchBar,     1, 0, 1, 1);
    grid->addWidget(d->newAlbumBtn,   1, 1, 1, 1);
    grid->setRowStretch(0, 10);
    grid->setMargin(0);
    grid->setSpacing(KDialog::spacingHint());

    // ------------------------------------------------------------------------------------

    PAlbum* select = albumToSelect;

    if (!select)
    {
        select = AlbumManager::instance()->currentPAlbum();
    }

    d->albumTreeView->setCurrentAlbums(QList<Album*>() << select, false);

    // ------------------------------------------------------------------------------------

    connect(d->albumTreeView, SIGNAL(currentAlbumChanged(Album*)),
            this, SIGNAL(itemSelectionChanged()));

    connect(AlbumManager::instance(), SIGNAL(signalAlbumRenamed(Album*)),
            this, SLOT(slotAlbumRenamed(Album*)));

    connect(d->newAlbumBtn, SIGNAL(clicked()),
            d->albumTreeView, SLOT(slotNewAlbum()));

    d->albumTreeView->loadState();
    d->searchBar->loadState();
}
开发者ID:rickysarraf,项目名称:digikam,代码行数:65,代码来源:albumselectwidget.cpp


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