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


C++ createControls函数代码示例

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


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

示例1: setMenuBar

void TextureViewer::init()
{
    control=0;
    shaderName=0;
    setMenuBar(new QMenuBar);
    QMenu *fileMenu = menuBar()->addMenu(tr("&File"));

    //Open action
    QAction *openAct = new QAction( tr("&Open"), this );
    openAct->setShortcuts(QKeySequence::Open);
    openAct->setStatusTip(tr("Open"));
    connect(openAct, SIGNAL(triggered()), this, SLOT(openFile()));

    QAction *createControlsAct = new QAction( tr("&Controls"), this );
    createControlsAct->setStatusTip(tr("Create Controls"));
    connect(createControlsAct, SIGNAL(triggered()), this, SLOT(createControls()));

    //Quit action
    QAction *quitAct = new QAction( tr("&Quit"), this );
    quitAct->setShortcuts(QKeySequence::Quit);
    quitAct->setStatusTip(tr("Quit"));
    connect(quitAct, SIGNAL(triggered()), this, SLOT(close()));

    fileMenu->addAction(openAct);
    fileMenu->addAction(createControlsAct);
    fileMenu->addAction(quitAct);
}
开发者ID:mtao,项目名称:MSc,代码行数:27,代码来源:window.cpp

示例2: QWidget

ConnectionForm::ConnectionForm(QWidget *parent) :
    QWidget(parent)
{
    displayIp = displayPort = true;
    packetMode = true;
    createControls();
}
开发者ID:xbzmeng,项目名称:SocketTool,代码行数:7,代码来源:connectionform.cpp

示例3: m_inDialog

MainWindow::MainWindow(HINSTANCE instance)
:	m_inDialog(false),
	m_parent(nullptr),
	m_instance(instance),
	m_emptyLink(nullptr)
{
	enableLogging(settings::settings()[L"general"][L"log"].asNumber() != 0);

	LOG(L"creating MainWindow");

	registerWindowClass(instance, loadString(instance, IDC_LAUNCHGRID).c_str());

	m_wnd = createMainWindow();

	createFonts();

	LOG(L"creating static controls");
	m_titleLabel = CreateWindow(L"STATIC", loadString(instance, IDS_APP_TITLE).c_str(), WS_CHILD | WS_VISIBLE, 8, 4, 120, 30, m_wnd, nullptr, instance, nullptr);
	SendMessage(m_titleLabel, WM_SETFONT, (WPARAM)m_titleFont, 0);

	m_menu = CreateWindow(L"BUTTON", L"Menu", WS_CHILD | WS_VISIBLE | BS_OWNERDRAW, 240 - 8 - 24, 4, 24, 24, m_wnd, nullptr, instance, nullptr);
	SetWindowLong(m_menu, GWL_ID, IDC_MENU);

	createControls();

	LOG(L"showing window");
	ShowWindow(m_wnd, settings::settings()[L"general"][L"bottomWindow"].asNumber() ? SW_SHOWNOACTIVATE : SW_SHOW);
	if (settings::settings()[L"general"][L"bottomWindow"].asNumber())
	{
		LOG(L"moving window to background");
		SetWindowPos(m_wnd, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
	}
	UpdateWindow(m_wnd);
}
开发者ID:filipppavlov,项目名称:LaunchGrid,代码行数:34,代码来源:MainWindow.cpp

示例4: LOG4CPP_INFO_S

QWidget *DlgSettingsColorFilter::createSubPanel ()
{
  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsColorFilter::createSubPanel";

  const int EMPTY_COLUMN_WIDTH = 40;

  QWidget *subPanel = new QWidget ();
  QGridLayout *layout = new QGridLayout (subPanel);
  subPanel->setLayout (layout);

  layout->setColumnStretch(0, 0); // Empty column
  layout->setColumnMinimumWidth(0, EMPTY_COLUMN_WIDTH);
  layout->setColumnStretch(1, 0); // Radio buttons
  layout->setColumnMinimumWidth(1, 210);
  layout->setColumnStretch(2, 0); // Empty column to put some space between previous and next columns, so they are not too close
  layout->setColumnMinimumWidth(2, 15);
  layout->setColumnStretch(3, 1); // Profile
  layout->setColumnMinimumWidth(4, EMPTY_COLUMN_WIDTH); // Empty column
  layout->setColumnStretch(4, 0);

  int rowLeft = 0, rowRight = 0;
  createControls (layout, rowLeft);
  createProfileAndScale (layout, rowRight);

  int row = qMax (rowLeft, rowRight);
  createPreview (layout, row);

  return subPanel;
}
开发者ID:keszybz,项目名称:engauge6,代码行数:29,代码来源:DlgSettingsColorFilter.cpp

示例5: SetupItem

SetupItemCheckBox::SetupItemCheckBox(std::string text, std::string description,
                                     std::string keyName,
                                     SetupTabScroll *parent,
                                     std::string eventName, bool mainConfig) :
    SetupItem(text, description, keyName, parent, eventName, mainConfig)
{
    createControls();
}
开发者ID:Evonline,项目名称:ManaPlus,代码行数:8,代码来源:setupitem.cpp

示例6: BaseDialog

UserDialog::UserDialog(wxWindow* parent, const wxString& title, bool isNewUser)
    : BaseDialog(parent, wxID_ANY, title), isNewUserM(isNewUser)
{
    createControls();
    setControlsProperties();
    layoutControls();
    updateButtons();
}
开发者ID:DragonZX,项目名称:flamerobin,代码行数:8,代码来源:UserDialog.cpp

示例7: BlockWidget

InfoWidget::InfoWidget(QWidget *parent, UserData *self) : BlockWidget(parent, self, lang(lng_settings_section_info)) {
	auto observeEvents = UpdateFlag::UsernameChanged | UpdateFlag::UserPhoneChanged | UpdateFlag::AboutChanged;
	subscribe(Notify::PeerUpdated(), Notify::PeerUpdatedHandler(observeEvents, [this](const Notify::PeerUpdate &update) {
		notifyPeerUpdated(update);
	}));

	createControls();
}
开发者ID:Federated-Blockchains-Initiative,项目名称:tdesktop,代码行数:8,代码来源:settings_info_widget.cpp

示例8: Q_UNUSED

void QgsVectorLayerSaveAsDialog::on_mFormatComboBox_currentIndexChanged( int idx )
{
  Q_UNUSED( idx );

  browseFilename->setEnabled( true );
  leFilename->setEnabled( true );

  if ( format() == "KML" )
  {
    mEncodingComboBox->setCurrentIndex( mEncodingComboBox->findText( "UTF-8" ) );
    mEncodingComboBox->setDisabled( true );
    mSkipAttributeCreation->setEnabled( true );
  }
  else if ( format() == "DXF" )
  {
    mSkipAttributeCreation->setChecked( true );
    mSkipAttributeCreation->setDisabled( true );
  }
  else
  {
    mEncodingComboBox->setEnabled( true );
    mSkipAttributeCreation->setEnabled( true );
  }

  QgsVectorFileWriter::MetaData driverMetaData;

  while ( mDatasourceOptionsGroupBox->layout()->count() )
  {
    QLayoutItem* item = mDatasourceOptionsGroupBox->layout()->takeAt( 0 );
    delete item->widget();
    delete item;
  }

  while ( mLayerOptionsGroupBox->layout()->count() )
  {
    QLayoutItem* item = mLayerOptionsGroupBox->layout()->takeAt( 0 );
    delete item->widget();
    delete item;
  }

  // workaround so the Q_FOREACH macro does not get confused by the ','
  typedef QPair<QLabel*, QWidget*> LabelControlPair;

  if ( QgsVectorFileWriter::driverMetadata( format(), driverMetaData ) )
  {
    if ( driverMetaData.driverOptions.size() != 0 )
    {
      mDatasourceOptionsGroupBox->setVisible( true );
      QList<QPair<QLabel*, QWidget*> > controls = createControls( driverMetaData.driverOptions );

      QFormLayout* datasourceLayout = dynamic_cast<QFormLayout*>( mDatasourceOptionsGroupBox->layout() );

      Q_FOREACH ( const LabelControlPair& control, controls )
      {
        datasourceLayout->addRow( control.first, control.second );
      }
    }
开发者ID:Benardi-atmadja,项目名称:QGIS,代码行数:57,代码来源:qgsvectorlayersaveasdialog.cpp

示例9: enableLogging

void MainWindow::applySettings()
{
	enableLogging(settings::settings()[L"general"][L"log"].asNumber() != 0);
	for (auto tab : m_tabs)
	{
		DestroyWindow(tab);
	}
	m_tabs.clear();
	for (auto table : m_tables)
	{
		delete table;
	}
	m_tables.clear();

	if (settings::settings()[L"general"][L"bottomWindow"].asNumber())
	{
		if (!m_parent)
		{
			auto newWnd = createMainWindow();
			SetParent(m_titleLabel, newWnd);
			SetParent(m_menu, newWnd);
			DestroyWindow(m_wnd);
			m_wnd = newWnd;
			ShowWindow(m_wnd, SW_SHOW);
		}
		if (settings::settings()[L"general"][L"autoStart"])
		{
			registerAutorun();
		}
		else
		{
			unregisterAutorun();
		}
	}
	else
	{
		if (m_parent)
		{
			auto parent = m_parent;
			
			auto newWnd = createMainWindow();
			SetParent(m_titleLabel, newWnd);
			SetParent(m_menu, newWnd);
			DestroyWindow(m_wnd);
			m_wnd = newWnd;
			ShowWindow(m_wnd, SW_SHOW);

			DestroyWindow(parent);
		}
		unregisterAutorun();
	}

	createControls();
	InvalidateRect(m_wnd, nullptr, TRUE);
}
开发者ID:filipppavlov,项目名称:LaunchGrid,代码行数:55,代码来源:MainWindow.cpp

示例10: BaseDialog

ReorderFieldsDialog::ReorderFieldsDialog(wxWindow* parent, Table* table)
    : BaseDialog(parent, -1, wxEmptyString)
{
    tableM = table;
    tableM->ensureChildrenLoaded();

    SetTitle(_("Reordering Fields of Table ") + table->getName_());
    createControls();
    layoutControls();
    tableM->attachObserver(this, true);
    button_ok->SetDefault();
}
开发者ID:AlfiyaZi,项目名称:flamerobin,代码行数:12,代码来源:ReorderFieldsDialog.cpp

示例11: QDialog

SceneBasicSelectDialog::SceneBasicSelectDialog(SceneViewCommon *sceneView, QWidget *parent) : QDialog(parent)
{
    m_sceneView = sceneView;

    setWindowIcon(icon(""));
    setWindowTitle(tr("Select edge"));

    createControls();

    setMinimumSize(sizeHint());
    setMaximumSize(sizeHint());
}
开发者ID:LeiDai,项目名称:agros2d,代码行数:12,代码来源:scenebasicselectdialog.cpp

示例12: QDialog

ConfigComputerDialog::ConfigComputerDialog(QWidget *parent) : QDialog(parent)
{
    setWindowIcon(icon("options"));
    setWindowTitle(tr("Options"));

    createControls();

    load();

    setMinimumSize(sizeHint());
    setMaximumSize(sizeHint());
}
开发者ID:LeiDai,项目名称:agros2d,代码行数:12,代码来源:confdialog.cpp

示例13: wxFrame

GRChangeMyGames::GRChangeMyGames(const wxFrame *parent,const wxString &title, const wxPoint &pos, const wxSize &size)
		: wxFrame((wxFrame *) parent, -1, title, pos, size)
{
	//Set some generic window options
	SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE));

	//Create controls
	createControls();

	//Center window
	CentreOnScreen();
}
开发者ID:chrismoos,项目名称:gameranger-client,代码行数:12,代码来源:GRChangeMyGames.cpp

示例14: QDialog

MaterialEditDialog::MaterialEditDialog(const QString &fileName, QWidget *parent) : QDialog(parent),
    m_fileName(fileName)
{
    setWindowIcon(icon(""));
    setWindowTitle(tr("Material editor"));

    createControls();

    readMaterial();

    QSettings settings;
    restoreGeometry(settings.value("MaterialEditDialog/Geometry", saveGeometry()).toByteArray());
}
开发者ID:deniq,项目名称:agros2d,代码行数:13,代码来源:materialbrowserdialog.cpp

示例15: BlockWidget

NotificationsWidget::NotificationsWidget(QWidget *parent, UserData *self) : BlockWidget(parent, self, lang(lng_settings_section_notify)) {
	createControls();

	subscribe(AuthSession::Current().notifications().settingsChanged(), [this](ChangeType type) {
		if (type == ChangeType::DesktopEnabled) {
			desktopEnabledUpdated();
		} else if (type == ChangeType::ViewParams) {
			viewParamUpdated();
		} else if (type == ChangeType::SoundEnabled) {
			_playSound->setChecked(Global::SoundNotify());
		}
	});
}
开发者ID:Peque,项目名称:tdesktop,代码行数:13,代码来源:settings_notifications_widget.cpp


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