• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ setMinimumSize函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: setMinimumSize

void Window3D::setFixedSize(QSize size)
{
    setMinimumSize(size);
    setMaximumSize(size);
}
开发者ID:Andrey540,项目名称:faststart_Egoshin_Andrey,代码行数:5,代码来源:window3d.cpp


示例2: QMainWindow

MainWindow::MainWindow(QWidget *parent)
	: QMainWindow(parent)
{
	QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
	setMinimumSize(450, 480);
	
	newGameMenu = menuBar()->addMenu("New game");
	optionsMenu = menuBar()->addMenu("Options");
	helpMenu = menuBar()->addMenu("Help");

	easyGame = new QAction("Easy", this);
	newGameMenu->addAction(easyGame);
	connect(easyGame, SIGNAL(triggered()), this, SLOT(generateEasy()));
	easyGame->setShortcut(Qt::CTRL + Qt::Key_1);
	
	mediumGame = new QAction("Medium", this);
	newGameMenu->addAction(mediumGame);
	connect(mediumGame, SIGNAL(triggered()), this, SLOT(generateMedium()));
	mediumGame->setShortcut(Qt::CTRL + Qt::Key_2);
	
	hardGame = new QAction("Hard", this);
	newGameMenu->addAction(hardGame);
	connect(hardGame, SIGNAL(triggered()), this, SLOT(generateHard()));
	hardGame->setShortcut(Qt::CTRL + Qt::Key_3);
	
	/*randomGame = new QAction("Random", this);
	newGameMenu->addAction(randomGame);
	connect(randomGame, SIGNAL(triggered()), this, SLOT(generateRandom()));
	randomGame->setShortcut(Qt::CTRL + Qt::Key_4);*/

	solve = new QAction("Solve", this);
	optionsMenu->addAction(solve);
	connect(solve, SIGNAL(triggered()), this, SLOT(showSolution()));
	solve->setShortcut(Qt::CTRL + Qt::Key_F);
	
	stopSolving = new QAction("Stop solving", this);
	optionsMenu->addAction(stopSolving);
	connect(stopSolving, SIGNAL(triggered()), this, SLOT(solvingStopped()));
	stopSolving->setShortcut(Qt::CTRL + Qt::Key_R);
	
	previousMove = new QAction("Move back", this);
	optionsMenu->addAction(previousMove);
	connect(previousMove, SIGNAL(triggered()), this, SLOT(moveBack()));
	previousMove->setShortcut(Qt::CTRL + Qt::Key_Z);
	
	nextMove = new QAction("Move forward", this);
	optionsMenu->addAction(nextMove);
	connect(nextMove, SIGNAL(triggered()), this, SLOT(moveForward()));
	nextMove->setShortcut(Qt::CTRL + Qt::Key_Y);
	
	getInfo = new QAction("Instructions", this);
	helpMenu->addAction(getInfo);
	connect(getInfo, SIGNAL(triggered()), this, SLOT(showInstructions()));
	getInfo->setShortcut(Qt::Key_F1);

	gview = new Graphics();
	setCentralWidget(gview);

	scene = new QGraphicsScene();
	scene->setBackgroundBrush(QColor("#e0e0e0"));

	gview->setScene(scene);
	gview->setEnabled(true);

	counter = new QLabel();
	
	for (int i = 1; i <= 15; i++)
		tiles[i] = NULL;
	
	srand(time(NULL));
	gameBoard = NULL;
	
	generateEasy();

	statusBar()->addWidget(counter);

	timer = new QTimer(this);
	timer->setInterval(400);
	connect(timer, SIGNAL(timeout()), this, SLOT(moveForward()));
}
开发者ID:tomciokotar,项目名称:Game-of-Fifteen,代码行数:80,代码来源:mainWindow.cpp


示例3: QDialog

    CreateUserDialog::CreateUserDialog(const QStringList &databases, const QString &serverName,
                                       const QString &database, const MongoUser &user,
                                       QWidget *parent) : QDialog(parent),
        _user(user)
    {
        setWindowTitle("Add User");
        setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); // Remove help button (?)
        setMinimumSize(minimumSize);

        Indicator *serverIndicator = new Indicator(GuiRegistry::instance().serverIcon(), serverName);
        Indicator *databaseIndicator = new Indicator(GuiRegistry::instance().databaseIcon(), database);

        QFrame *hline = new QFrame();
        hline->setFrameShape(QFrame::HLine);
        hline->setFrameShadow(QFrame::Sunken);

        _userNameLabel = new QLabel("Name:");
        _userNameEdit = new QLineEdit();
        _userNameEdit->setText(QtUtils::toQString(user.name()));
        _userPassLabel = new QLabel("Password:");
        _userPassEdit = new QLineEdit();
        _userPassEdit->setEchoMode(QLineEdit::Password);
        _userSourceLabel = new QLabel("UserSource:");
        _userSourceComboBox = new QComboBox();
        _userSourceComboBox->addItems(QStringList() << "" << databases); //setText(QtUtils::toQString(user.userSource()));
        utils::setCurrentText(_userSourceComboBox, QtUtils::toQString(user.userSource()));

        QGridLayout *gridRoles = new QGridLayout();
        MongoUser::RoleType userRoles = user.role();
        for (unsigned i = 0; i<RolesCount; ++i)
        {
            int row = i%3;
            int col = i/3;
            _rolesArray[i] = new QCheckBox(rolesText[i], this);
            MongoUser::RoleType::const_iterator it = std::find(userRoles.begin(), userRoles.end(), rolesText[i]);
            _rolesArray[i]->setChecked(it!= userRoles.end());
            gridRoles->addWidget(_rolesArray[i], row, col);
        }

        QDialogButtonBox *buttonBox = new QDialogButtonBox(this);
        buttonBox->setOrientation(Qt::Horizontal);
        buttonBox->setStandardButtons(QDialogButtonBox::Cancel | QDialogButtonBox::Save);
        VERIFY(connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept())));
        VERIFY(connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())));

        QHBoxLayout *hlayout = new QHBoxLayout();
        hlayout->addStretch(1);
        hlayout->addWidget(buttonBox);

        QHBoxLayout *vlayout = new QHBoxLayout();
        vlayout->addWidget(serverIndicator, 0, Qt::AlignLeft);
        vlayout->addWidget(databaseIndicator, 0, Qt::AlignLeft);
        vlayout->addStretch(1);

        QGridLayout *namelayout = new QGridLayout();
        namelayout->setContentsMargins(0, 7, 0, 7);
        namelayout->addWidget(_userNameLabel, 0, 0);
        namelayout->addWidget(_userNameEdit,  0, 1);
        namelayout->addWidget(_userPassLabel, 1, 0);
        namelayout->addWidget(_userPassEdit,  1, 1);
        namelayout->addWidget(_userSourceLabel, 2, 0);
        namelayout->addWidget(_userSourceComboBox,  2, 1);
        namelayout->addLayout(gridRoles,  3, 1);

        QVBoxLayout *layout = new QVBoxLayout();
        layout->addLayout(vlayout);
        layout->addWidget(hline);
        layout->addLayout(namelayout);
        layout->addLayout(hlayout);
        setLayout(layout);

        _userNameEdit->setFocus();
    }
开发者ID:Aahanbhatt,项目名称:robomongo,代码行数:73,代码来源:CreateUserDialog.cpp


示例4: QDialog

CollectionDialog::CollectionDialog(SLManager *slm,int selC,QWidget *parent,const char *name) : QDialog(parent,name,TRUE)
{
setCaption(i18n("Collections Manager"));
ok=new KPushButton(KStdGuiItem::ok(),this);
ok->setGeometry(140,200,100,30);
connect(ok,SIGNAL(clicked()),SLOT(accept()) );
cancel=new KPushButton(KStdGuiItem::cancel(),this);
cancel->setGeometry(250,200,100,30);
connect(cancel,SIGNAL(clicked()),SLOT(reject()) );

label=new QLabel(i18n("Available collections:"),this);
label->adjustSize();
label->move(10,10);
collections=new QListBox(this,"collectionlist");
collections->setGeometry(10,20+label->height(),340,90);
connect(collections,SIGNAL(highlighted(int)),SLOT(collectionselected(int)));
connect(collections,SIGNAL(selected(int)),SLOT(changeCollectionName(int)));
slman=slm;
for (int i=0;i<=slman->numberOfCollections();i++)
    {
    collections->insertItem(i18n( slman->getCollectionName(i) ),i);
#ifdef COLLECTDLGDEBUG
    printf("Name : %s\n",slman->getCollectionName(i));
#endif
    };
selectedC=selC;
#ifdef COLLECTDLGDEBUG
printf("selectedC : %d\n",selectedC);
#endif

label2=new QLabel(i18n("Songs in selected collection:"),this);
label2->adjustSize();
label2->move(10,collections->y()+collections->height()+10);

songs=new QListBox(this,"songlist");
songs->setGeometry(10,label2->y()+label2->height()+10,340,120);
connect(songs,SIGNAL(highlighted(int)),SLOT(songselected(int)));
currentsl=slman->getCollection(selectedC);
if (slman->numberOfCollections()>0)
    {
    collections->setCurrentItem(selectedC);
    collections->centerCurrentItem();
    };
//fillInSongList();
newC=new QPushButton(i18n("&New..."),this);
newC->adjustSize();
newC->move(360,collections->y()+5);
connect(newC,SIGNAL(clicked()),SLOT(newCollection()) );
copyC=new QPushButton(i18n("&Copy..."),this);
copyC->adjustSize();
copyC->move(360,newC->y()+newC->height()+5);
connect(copyC,SIGNAL(clicked()),SLOT(copyCollection()) );
deleteC=new QPushButton(i18n("Delete"),this);
deleteC->adjustSize();
deleteC->move(360,copyC->y()+copyC->height()+5);
connect(deleteC,SIGNAL(clicked()),SLOT(deleteCollection()) );

addS=new QPushButton(i18n("&Add..."),this);
addS->adjustSize();
addS->move(360,songs->y()+5);
connect(addS,SIGNAL(clicked()),SLOT(addSong()) );
delS=new QPushButton(i18n("&Remove"),this);
delS->adjustSize();
delS->move(360,addS->y()+addS->height()+5);
connect(delS,SIGNAL(clicked()),SLOT(removeSong()) );

ok->move(ok->x(),songs->y()+songs->height()+10);
cancel->move(ok->x()+ok->width()+5,ok->y());

setMinimumSize(400,ok->y()+ok->height()+5);
//setMaximumSize(360,240);
}
开发者ID:serghei,项目名称:kde3-kdemultimedia,代码行数:72,代码来源:collectdlg.cpp


示例5: QWidget

QgsLocatorWidget::QgsLocatorWidget( QWidget *parent )
  : QWidget( parent )
  , mLocator( new QgsLocator( this ) )
  , mLineEdit( new QgsFilterLineEdit() )
  , mLocatorModel( new QgsLocatorModel( this ) )
  , mResultsView( new QgsLocatorResultsView() )
{
  mLineEdit->setShowClearButton( true );
#ifdef Q_OS_MACX
  mLineEdit->setPlaceholderText( tr( "Type to locate (⌘K)" ) );
#else
  mLineEdit->setPlaceholderText( tr( "Type to locate (Ctrl+K)" ) );
#endif

  int placeholderMinWidth = mLineEdit->fontMetrics().width( mLineEdit->placeholderText() );
  int minWidth = std::max( 200, ( int )( placeholderMinWidth * 1.6 ) );
  resize( minWidth, 30 );
  QSizePolicy sizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::Preferred );
  sizePolicy.setHorizontalStretch( 0 );
  sizePolicy.setVerticalStretch( 0 );
  setSizePolicy( sizePolicy );
  setMinimumSize( QSize( minWidth, 0 ) );

  QHBoxLayout *layout = new QHBoxLayout();
  layout->setMargin( 0 );
  layout->setContentsMargins( 0, 0, 0, 0 );
  layout->addWidget( mLineEdit );
  setLayout( layout );

  setFocusProxy( mLineEdit );

  // setup floating container widget
  mResultsContainer = new QgsFloatingWidget( parent ? parent->window() : nullptr );
  mResultsContainer->setAnchorWidget( mLineEdit );
  mResultsContainer->setAnchorPoint( QgsFloatingWidget::BottomLeft );
  mResultsContainer->setAnchorWidgetPoint( QgsFloatingWidget::TopLeft );

  QHBoxLayout *containerLayout = new QHBoxLayout();
  containerLayout->setMargin( 0 );
  containerLayout->setContentsMargins( 0, 0, 0, 0 );
  containerLayout->addWidget( mResultsView );
  mResultsContainer->setLayout( containerLayout );
  mResultsContainer->hide();

  mProxyModel = new QgsLocatorProxyModel( mLocatorModel );
  mProxyModel->setSourceModel( mLocatorModel );
  mResultsView->setModel( mProxyModel );
  mResultsView->setUniformRowHeights( true );
  mResultsView->setIconSize( QSize( 16, 16 ) );
  mResultsView->recalculateSize();

  connect( mLocator, &QgsLocator::foundResult, this, &QgsLocatorWidget::addResult );
  connect( mLocator, &QgsLocator::finished, this, &QgsLocatorWidget::searchFinished );
  connect( mLineEdit, &QLineEdit::textChanged, this, &QgsLocatorWidget::scheduleDelayedPopup );
  connect( mResultsView, &QAbstractItemView::activated, this, &QgsLocatorWidget::acceptCurrentEntry );

  // have a tiny delay between typing text in line edit and showing the window
  mPopupTimer.setInterval( 100 );
  mPopupTimer.setSingleShot( true );
  connect( &mPopupTimer, &QTimer::timeout, this, &QgsLocatorWidget::performSearch );
  mFocusTimer.setInterval( 110 );
  mFocusTimer.setSingleShot( true );
  connect( &mFocusTimer, &QTimer::timeout, this, &QgsLocatorWidget::triggerSearchAndShowList );

  mLineEdit->installEventFilter( this );
  mResultsContainer->installEventFilter( this );
  mResultsView->installEventFilter( this );
  installEventFilter( this );
  window()->installEventFilter( this );

  mLocator->registerFilter( new QgsLocatorFilterFilter( this, this ) );

  mMenu = new QMenu( this );
  QAction *menuAction = mLineEdit->addAction( QgsApplication::getThemeIcon( QStringLiteral( "/search.svg" ) ), QLineEdit::LeadingPosition );
  connect( menuAction, &QAction::triggered, this, [ = ]
  {
    mFocusTimer.stop();
    mResultsContainer->hide();
    mMenu->exec( QCursor::pos() );
  } );
  connect( mMenu, &QMenu::aboutToShow, this, &QgsLocatorWidget::configMenuAboutToShow );

}
开发者ID:CS-SI,项目名称:QGIS,代码行数:83,代码来源:qgslocatorwidget.cpp


示例6: setFixedSize

 void setFixedSize(QSize size)
 {
     setMinimumSize(size);
     setMaximumSize(size);
 }
开发者ID:Jornason,项目名称:quick-cocos2d-x,代码行数:5,代码来源:CCEGLViewQt.cpp


示例7: QGLWidget

NavyPainter::NavyPainter(QWidget *parent, AutoLocation * location, int bgm) :
    QGLWidget(parent), Navy(location)
{
    setAutoFillBackground(false);

    if(bgm >= 3 || bgm < 0)
        bgm = 0;

    bgcode = bgm;

    t=0;

    backgrounds.push_back(QImage(":/Skin1.png"));
    backgrounds.push_back(QImage(":/Skin2.png"));
    backgrounds.push_back(QImage(":/Island3min.png"));

    bg= backgrounds[bgcode];

    tt.load(":/reflection.jpg");
    rr.load(":/boom.png");
    mbg.load(":/images/background.png");

    resize(m_w,m_h);
    setMinimumSize(m_w,m_h);
    setMaximumSize(m_w,m_h);

    splash.load(":/images/splash.png");
    boom.load(":/images/boom.png");
    death.load(":/images/death.png");

    timer = new QTimer(this);
    timer->setInterval(25);

    timer_fire = new QTimer(this);
    //timer_fire->setInterval(100);

    connect(timer, SIGNAL(timeout()), this, SLOT(animate()));
    //connect(timer_fire, SIGNAL(timeout()), this, SLOT(fire()));

    qsrand(::time(NULL));
    timer->start();

    show_shell = false;

    setMouseTracking(true);

    enemy = new Navy();
    cur_sursor = false;

    InitNoise();

    wire_frame = normals = xold = yold = 0;

    rotate_y = 35;
    rotate_x = 10;

    translate_z=2.5;

    time = 0;

    int flags = QGLFormat::openGLVersionFlags();
    useOpenGl = (flags & QGLFormat::OpenGL_Version_2_0);

    if(!useOpenGl)
        timer->stop();
}
开发者ID:DenisBabarykin,项目名称:SeaBattle,代码行数:66,代码来源:navypainter.cpp


示例8: setMinimumSize

void
MyPluginGUI::createGUI(DefaultGUIModel::variable_t *var, int size)
{

  setMinimumSize(200, 300); // Qt API for setting window size

  //overall GUI layout with a "horizontal box" copied from DefaultGUIModel

  QBoxLayout *layout = new QHBoxLayout(this);

  //additional GUI layouts with "vertical" layouts that will later
  // be added to the overall "layout" above
  QBoxLayout *leftlayout = new QVBoxLayout();
  //QBoxLayout *rightlayout = new QVBoxLayout();

  // this is a "horizontal button group"
  QHButtonGroup *bttnGroup = new QHButtonGroup("Button Panel:", this);

  // we add two pushbuttons to the button group
  QPushButton *aBttn = new QPushButton("Button A", bttnGroup);
  QPushButton *bBttn = new QPushButton("Button B", bttnGroup);

  // clicked() is a Qt signal that is given to pushbuttons. The connect()
  // function links the clicked() event to a function that is defined
  // as a "private slot:" in the header.
  QObject::connect(aBttn, SIGNAL(clicked()), this, SLOT(aBttn_event()));
  QObject::connect(bBttn, SIGNAL(clicked()), this, SLOT(bBttn_event()));

  //these 3 utility buttons are copied from DefaultGUIModel
  QHBox *utilityBox = new QHBox(this);
  pauseButton = new QPushButton("Pause", utilityBox);
  pauseButton->setToggleButton(true);
  QObject::connect(pauseButton, SIGNAL(toggled(bool)), this, SLOT(pause(bool)));
  QPushButton *modifyButton = new QPushButton("Modify", utilityBox);
  QObject::connect(modifyButton, SIGNAL(clicked(void)), this, SLOT(modify(void)));
  QPushButton *unloadButton = new QPushButton("Unload", utilityBox);
  QObject::connect(unloadButton, SIGNAL(clicked(void)), this, SLOT(exit(void)));

  // add custom button group at the top of the layout
  leftlayout->addWidget(bttnGroup);

  // copied from DefaultGUIModel DO NOT EDIT
  // this generates the text boxes and labels
  QScrollView *sv = new QScrollView(this);
  sv->setResizePolicy(QScrollView::AutoOneFit);
  leftlayout->addWidget(sv);

  QWidget *viewport = new QWidget(sv->viewport());
  sv->addChild(viewport);
  QGridLayout *scrollLayout = new QGridLayout(viewport, 1, 2);

  size_t nstate = 0, nparam = 0, nevent = 0, ncomment = 0;
  for (size_t i = 0; i < num_vars; i++)
    {
      if (vars[i].flags & (PARAMETER | STATE | EVENT | COMMENT))
        {
          param_t param;

          param.label = new QLabel(vars[i].name, viewport);
          scrollLayout->addWidget(param.label, parameter.size(), 0);
          param.edit = new DefaultGUILineEdit(viewport);
          scrollLayout->addWidget(param.edit, parameter.size(), 1);

          QToolTip::add(param.label, vars[i].description);
          QToolTip::add(param.edit, vars[i].description);

          if (vars[i].flags & PARAMETER)
            {
              if (vars[i].flags & DOUBLE)
                {
                  param.edit->setValidator(new QDoubleValidator(param.edit));
                  param.type = PARAMETER | DOUBLE;
                }
              else if (vars[i].flags & UINTEGER)
                {
                  QIntValidator *validator = new QIntValidator(param.edit);
                  param.edit->setValidator(validator);
                  validator->setBottom(0);
                  param.type = PARAMETER | UINTEGER;
                }
              else if (vars[i].flags & INTEGER)
                {
                  param.edit->setValidator(new QIntValidator(param.edit));
                  param.type = PARAMETER | INTEGER;
                }
              else
                param.type = PARAMETER;
              param.index = nparam++;
              param.str_value = new QString;
            }
          else if (vars[i].flags & STATE)
            {
              param.edit->setReadOnly(true);
              param.edit->setPaletteForegroundColor(Qt::darkGray);
              param.type = STATE;
              param.index = nstate++;
            }
          else if (vars[i].flags & EVENT)
            {
              param.edit->setReadOnly(true);
//.........这里部分代码省略.........
开发者ID:El-Jefe,项目名称:plugin-template,代码行数:101,代码来源:my_plugin_gui.cpp


示例9: QWidget

//Le constructeur
Widget::Widget(): QWidget()
{
	//On initialise la fenetre
	this->setWindowTitle("Client B");
	setMinimumSize(640,480);

	//On crèe une table view non éditable
	QTableView *tableView=new QTableView();
	tableView->setEditTriggers(QAbstractItemView::NoEditTriggers);

	//On crèe le model à 2 colonnes de la qtableview
	this->model=new QStandardItemModel(0,2,tableView);

	//On écrit l'entete du model
	QStringList list;
	list<<"Evenement"<<"Heure";
	model->setHorizontalHeaderLabels(list);

	//On affecte le model à sa qtableview, et on configure cette dernière
	tableView->setModel(model);
	tableView->horizontalHeader()->setStretchLastSection(true);
	tableView->setColumnWidth(0,500);

	//On range la qtableview dans la fenetre avec une layout
	QHBoxLayout *layout = new QHBoxLayout;
	layout->addWidget(tableView);
	this->setLayout(layout);
	addRowToTable("Démarage de l'application",model);

	//On créé la configuration réseau
        ConfigurationNetwork *configurationNetwork=ConfigurationNetwork::createConfigurationNetwork("pchky",4321);
	if(configurationNetwork) addRowToTable("La configuration réseau a été crée",model);
	else {addRowToTable("Echec de la création de la configuration réseau",model);return;}

	//On créé la configuration d'identification
	ConfigurationIdentification *configurationIdentification=ConfigurationIdentification::createConfigurationIdentification("hky","hky");
	if(configurationIdentification) addRowToTable("La configuration d'identification' a été crée",model);
	else {addRowToTable("Echec de la création de la configuration d'indentification",model);return;}

	//On créé la configuration de fichier
	QList<Dir*> *depots=new QList<Dir*>();
        Dir *d1=Dir::createDir("/home/julien/test/A","/sd/1");depots->append(d1);
        if(!d1){addRowToTable("Echec de la création du repertoire 1",model);return;}
        //Dir *d2=Dir::createDir("/home/hky/test/B","/sd/1");depots->append(d2);
        //if(!d2){addRowToTable("Echec de la création du repertoire 2",model);return;}
	ConfigurationFile *configurationFile=ConfigurationFile::createConfigurationFile(depots);
	if(configurationFile) addRowToTable("Les configurations des repertoires surveillés ont été créés",model);
	else {addRowToTable("Echec de la création des configurations de repertoires surveillés",model);return;}

	//On créé la configuration totale
        this->configurationData=ConfigurationData::createConfigurationData(configurationNetwork,configurationIdentification,configurationFile,"/home/julien/test/config2.xml");

	//On créé l'interface réseau
	this->networkInterface=NetworkInterface::createNetworkInterface(configurationData);
	if(networkInterface) addRowToTable("L'interface réseau a été crée",model);
	else {addRowToTable("Echec de la création de l'interface réseau",model);return;}

	//On créé l'interface disque dur
	this->hddInterface=HddInterface::createHddInterface(configurationData,networkInterface,model);
	if(hddInterface) addRowToTable("L'interface disque a été crée",model);
	else {addRowToTable("Echec de la création de l'interface disque",model);return;}

	//On tente de se connecter au serveur
	addRowToTable("Tentative de connexion au serveur",model);
	bool a=networkInterface->connect();
	if(a) addRowToTable("Success: Connexion réuissie",model);
	else addRowToTable("Echec: Connexion échouée",model);
}
开发者ID:jguery,项目名称:dropbox-clone,代码行数:69,代码来源:widget.cpp


示例10: KDialogBase

KateConfigDialog::KateConfigDialog ( KateMainWindow *parent, Kate::View *view )
 : KDialogBase ( KDialogBase::TreeList,
                 i18n("Configure"),
                 KDialogBase::Ok | KDialogBase::Apply|KDialogBase::Cancel | KDialogBase::Help,
                 KDialogBase::Ok,
                 parent,
                 "configdialog" )
{
  TDEConfig *config = KateApp::self()->config();

  KWin::setIcons( winId(), KateApp::self()->icon(), KateApp::self()->miniIcon() );

  actionButton( KDialogBase::Apply)->setEnabled( false );

  mainWindow = parent;

  setMinimumSize(600,400);

  v = view;

  pluginPages.setAutoDelete (false);
  editorPages.setAutoDelete (false);

  TQStringList path;

  setShowIconsInTreeList(true);

  path.clear();
  path << i18n("Application");
  setFolderIcon (path, SmallIcon("kate", TDEIcon::SizeSmall));

  path.clear();

  //BEGIN General page
  path << i18n("Application") << i18n("General");
  TQFrame* frGeneral = addPage(path, i18n("General Options"), BarIcon("go-home", TDEIcon::SizeSmall));

  TQVBoxLayout *lo = new TQVBoxLayout( frGeneral );
  lo->setSpacing(KDialog::spacingHint());
  config->setGroup("General");

  // GROUP with the one below: "Appearance"
  TQButtonGroup *bgStartup = new TQButtonGroup( 1, Qt::Horizontal, i18n("&Appearance"), frGeneral );
  lo->addWidget( bgStartup );

  // show full path in title
  config->setGroup("General");
  cb_fullPath = new TQCheckBox( i18n("&Show full path in title"), bgStartup);
  cb_fullPath->setChecked( mainWindow->viewManager()->getShowFullPath() );
  TQWhatsThis::add(cb_fullPath,i18n("If this option is checked, the full document path will be shown in the window caption."));
  connect( cb_fullPath, TQT_SIGNAL( toggled( bool ) ), this, TQT_SLOT( slotChanged() ) );

  // sort filelist if desired
   cb_sortFiles = new TQCheckBox(bgStartup);
   cb_sortFiles->setText(i18n("Sort &files alphabetically in the file list"));
   cb_sortFiles->setChecked(parent->filelist->sortType() == KateFileList::sortByName);
   TQWhatsThis::add( cb_sortFiles, i18n(
         "If this is checked, the files in the file list will be sorted alphabetically.") );
   connect( cb_sortFiles, TQT_SIGNAL( toggled( bool ) ), this, TQT_SLOT( slotChanged() ) );

  // GROUP with the one below: "Behavior"
  bgStartup = new TQButtonGroup( 1, Qt::Horizontal, i18n("&Behavior"), frGeneral );
  lo->addWidget( bgStartup );

  // number of recent files
  TQHBox *hbNrf = new TQHBox( bgStartup );
  TQLabel *lNrf = new TQLabel( i18n("&Number of recent files:"), hbNrf );
  sb_numRecentFiles = new TQSpinBox( 0, 1000, 1, hbNrf );
  sb_numRecentFiles->setValue( mainWindow->fileOpenRecent->maxItems() );
  lNrf->setBuddy( sb_numRecentFiles );
  TQString numRecentFileHelpString ( i18n(
        "<qt>Sets the number of recent files remembered by Kate.<p><strong>NOTE: </strong>"
        "If you set this lower than the current value, the list will be truncated and "
        "some items forgotten.</qt>") );
  TQWhatsThis::add( lNrf, numRecentFileHelpString );
  TQWhatsThis::add( sb_numRecentFiles, numRecentFileHelpString );
  connect( sb_numRecentFiles, TQT_SIGNAL( valueChanged ( int ) ), this, TQT_SLOT( slotChanged() ) );

  // Use only one instance of kate (MDI) ?
  cb_useInstance = new TQCheckBox(bgStartup);
  cb_useInstance->setText(i18n("Always use the current instance of kate to open new files"));
  cb_useInstance->setChecked(parent->useInstance);
  TQWhatsThis::add( cb_useInstance, i18n(
        "When checked, all files opened from outside of Kate will only use the "
        "currently opened instance of Kate.") );
  connect( cb_useInstance, TQT_SIGNAL( toggled( bool ) ), this, TQT_SLOT( slotChanged() ) );

  // sync the konsole ?
  cb_syncKonsole = new TQCheckBox(bgStartup);
  cb_syncKonsole->setText(i18n("Sync &terminal emulator with active document"));
  cb_syncKonsole->setChecked(parent->syncKonsole);
  TQWhatsThis::add( cb_syncKonsole, i18n(
        "If this is checked, the built in Konsole will <code>cd</code> to the directory "
        "of the active document when started and whenever the active document changes, "
        "if the document is a local file.") );
  connect( cb_syncKonsole, TQT_SIGNAL( toggled( bool ) ), this, TQT_SLOT( slotChanged() ) );

  // modified files notification
  cb_modNotifications = new TQCheckBox(
      i18n("Wa&rn about files modified by foreign processes"), bgStartup );
//.........这里部分代码省略.........
开发者ID:Fat-Zer,项目名称:tdebase,代码行数:101,代码来源:kateconfigdialog.cpp


示例11: QMainWindow

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow),
    ui2(new Ui::Dialog),
    m_aboutDialog(nullptr),
    m_baiduTranslater(new CBaiduTranslater(this)),
    m_from("auto"),
    m_to("auto"),
    m_statusInfo(new QLabel(this)),
    m_pinWindow(new QToolButton(this)),
    //m_updateStyle(new QToolButton(this)),
    m_about(new QToolButton(this))
{
    ui->setupUi(this);

    /* Stay on top tool button */
//    m_pinWindow = new QToolButton(this);
    m_pinWindow->setObjectName(tr("pinWindow"));
    m_pinWindow->setText("置顶");
    m_pinWindow->setToolTip(tr("stay on top"));
    m_pinWindow->setToolButtonStyle(Qt::ToolButtonTextOnly);
    ui->statusBar->addWidget(m_pinWindow, 0);
    connect(m_pinWindow, &QToolButton::clicked, this, &MainWindow::togglePinWindow);

    /* Update style tool button */
//    m_updateStyle = new QToolButton(this);
    //m_updateStyle->setObjectName(tr("updateStyle"));
    //m_updateStyle->setToolTip(tr("update style"));
    //ui->statusBar->addWidget(m_updateStyle, 0);
    //connect(m_updateStyle, &QToolButton::clicked, this, &MainWindow::updateStyle);

    /* status display label */
//    m_statusInfo = new QLabel(this);
    m_statusInfo->setAlignment(Qt::AlignRight);
    ui->statusBar->addWidget(m_statusInfo, 1);

    /* About button */
//    m_about = new QToolButton(this);
    m_about->setObjectName(tr("about"));
    m_about->setToolTip(tr("关于 LBTrans"));
    m_about->setText("关于 LBTrans");
    m_about->setToolButtonStyle(Qt::ToolButtonTextOnly);
    ui->statusBar->insertWidget(2, m_about);
    connect(m_about, &QToolButton::clicked, this, &MainWindow::showAboutDialog);


    /* initialize translation direction */
    initComboBox(ui->comboBox, 0);
    initComboBox(ui->comboBoxObject, 1);

    // Set baidu translate seveice API key
    m_baiduTranslater->setAPI_Key("YaGqITH4r1i95Xp8izAhrxwT");

    /* translate */
    connect(ui->btnTranslate, SIGNAL(clicked()), this, SLOT(translate()));
    connect(m_baiduTranslater, &CBaiduTranslater::finished, this, &MainWindow::showResult);

    /* initialize waiting label */
    ui->label_statusPicture->setFileName(":/res/loading.gif");
    ui->label_statusPicture->hide();
    ui->label_translationStatus->setText(tr("正在翻译..."));
    ui->label_translationStatus->hide();

    /* Set MainWindow title */
    setWindowTitle(tr("LBTrans"));
    setWindowIcon(QIcon(":/res/windowIcon.ico"));
    /* Show in screen center */
    QSize screenSize = qApp->desktop()->availableGeometry().size();
    QSize mainWindowSize = size();
    QPoint destPos;
    destPos.setX((screenSize.width() - mainWindowSize.width()) / 2);
    destPos.setY((screenSize.height() - mainWindowSize.height()) / 2);
    this->move(destPos);

    /* contriant window size */
    setMaximumSize(size());
    setMinimumSize(size());
}
开发者ID:xuzhuoyi,项目名称:LBTrans,代码行数:78,代码来源:mainwindow.cpp


示例12: GLView

 InputPreview::InputPreview(QWidget* _parent) :
   GLView(_parent)
 {
   setMinimumSize(128 / devicePixelRatio(),128 / devicePixelRatio());
 }
开发者ID:flair2005,项目名称:omnidome,代码行数:5,代码来源:InputPreview.cpp


示例13: QDial

QgsDial::QgsDial( QWidget *parent ) : QDial( parent )
{
  setMinimumSize( QSize( 50, 50 ) );
}
开发者ID:AlisterH,项目名称:Quantum-GIS,代码行数:4,代码来源:qgsdial.cpp


示例14: QWidget

SwapObjectsIdsWidget::SwapObjectsIdsWidget(QWidget *parent, Qt::WindowFlags f) : QWidget(parent, f)
{
	try
	{
		QGridLayout *swap_objs_grid=new QGridLayout(this);
		vector<ObjectType> types=BaseObject::getObjectTypes(true, {OBJ_PERMISSION, OBJ_ROLE, OBJ_TEXTBOX,
																   OBJ_COLUMN, OBJ_CONSTRAINT });
		setupUi(this);

		PgModelerUiNS::configureWidgetFont(message_lbl, PgModelerUiNS::MEDIUM_FONT_FACTOR);

		src_object_sel=nullptr;
		dst_object_sel=nullptr;

		src_object_sel=new ObjectSelectorWidget(types, true, this);
		src_object_sel->enableObjectCreation(false);

		dst_object_sel=new ObjectSelectorWidget(types, true, this);
		dst_object_sel->enableObjectCreation(false);

		swap_objs_grid->setContentsMargins(4,4,4,4);
		swap_objs_grid->setSpacing(6);

		swap_objs_grid->addWidget(create_lbl, 0, 0);
		swap_objs_grid->addWidget(src_object_sel, 0, 1);
		swap_objs_grid->addWidget(src_id_lbl, 0, 2);
		swap_objs_grid->addWidget(src_ico_lbl, 0, 3);

		swap_objs_grid->addWidget(before_lbl, 1, 0);
		swap_objs_grid->addWidget(dst_object_sel, 1, 1);
		swap_objs_grid->addWidget(dst_id_lbl, 1, 2);
		swap_objs_grid->addWidget(dst_ico_lbl, 1, 3);

		QHBoxLayout *hlayout=new QHBoxLayout;
		hlayout->addSpacerItem(new QSpacerItem(10,10, QSizePolicy::Expanding));
		hlayout->addWidget(swap_values_tb);
		hlayout->addSpacerItem(new QSpacerItem(10,10, QSizePolicy::Expanding));

		swap_objs_grid->addLayout(hlayout, 2, 0, 1, 4);
		swap_objs_grid->addItem(new QSpacerItem(10,0,QSizePolicy::Minimum,QSizePolicy::Expanding), swap_objs_grid->count()+1, 0);
		swap_objs_grid->addWidget(alert_frm, swap_objs_grid->count()+1, 0, 1, 4);

		setModel(nullptr);

		connect(src_object_sel, SIGNAL(s_objectSelected(void)), this, SLOT(showObjectId(void)));
		connect(dst_object_sel, SIGNAL(s_objectSelected(void)), this, SLOT(showObjectId(void)));
		connect(src_object_sel, SIGNAL(s_selectorCleared(void)), this, SLOT(showObjectId(void)));
		connect(dst_object_sel, SIGNAL(s_selectorCleared(void)), this, SLOT(showObjectId(void)));

		connect(swap_values_tb, &QToolButton::clicked,
				[=](){ BaseObject *obj=src_object_sel->getSelectedObject();
			src_object_sel->setSelectedObject(dst_object_sel->getSelectedObject());
			dst_object_sel->setSelectedObject(obj); });

		setMinimumSize(550,150);
	}
	catch(Exception &e)
	{
		throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e);
	}
}
开发者ID:Ox0000,项目名称:pgmodeler,代码行数:61,代码来源:swapobjectsidswidget.cpp


示例15: window

/*
    Initializes histogram representation
        span : the period of time to be taken into account
        width, height : dimensions
*/
Histogram::Histogram(const QWidget* new_window, unsigned short span, const QColor& new_color, unsigned short width, unsigned short height) : window(new_window), painter(NULL), data(span, 0.0), max(0.0), min(0.0), color(new_color), col_border(QColor(Qt::grey)), col_background(QColor(Qt::black)), timer(0) 
{
    setSizePolicy(QtGui::QSizePolicy(QtGui::QSizePolicy::Fixed, QtGui::QSizePolicy::Fixed));
    setMinimumSize(width, height);
}
开发者ID:k0ral,项目名称:thereisnorush,代码行数:10,代码来源:histogram.cpp


示例16: QWidget

/* 
 *  Constructs a DebugTreiberGUI which is a child of 'parent', with the 
 *  name 'name' and widget flags set to 'f' 
 */
DebugTreiberGUI::DebugTreiberGUI( QWidget* parent,  const char* name, WFlags fl )
    : QWidget( parent, name, fl )
{
    if ( !name )
	setName( "DebugTreiberGUI" );
    resize( 240, 300 ); 
    setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, sizePolicy().hasHeightForWidth() ) );
    setMinimumSize( QSize( 240, 300 ) );
    setMaximumSize( QSize( 240, 300 ) );
    setCaption( tr( "DebugTreiberGUI" ) );

    Tab = new QTabWidget( this, "Tab" );
    Tab->setEnabled( TRUE );
    Tab->setGeometry( QRect( 0, 0, 240, 300 ) ); 
    QToolTip::add(  Tab, tr( "" ) );

    SendenTab = new QWidget( Tab, "SendenTab" );

    TextLabel1 = new QLabel( SendenTab, "TextLabel1" );
    TextLabel1->setGeometry( QRect( 10, 10, 75, 20 ) ); 
    TextLabel1->setText( tr( "Operation:" ) );

    TextLabel1_3 = new QLabel( SendenTab, "TextLabel1_3" );
    TextLabel1_3->setGeometry( QRect( 10, 40, 141, 20 ) ); 
    TextLabel1_3->setText( tr( "Anzahl Datenbytes:" ) );

    sendButton = new QPushButton( SendenTab, "sendButton" );
    sendButton->setGeometry( QRect( 60, 220, 120, 32 ) ); 
    sendButton->setText( tr( "Senden!" ) );
    sendButton->setDefault( TRUE );
    QToolTip::add(  sendButton, tr( "Daten absenden" ) );

    DatenBytes = new QGroupBox( SendenTab, "DatenBytes" );
    DatenBytes->setGeometry( QRect( 10, 70, 220, 150 ) ); 
    DatenBytes->setTitle( tr( "DatenBytes" ) );

    byte12 = new QSpinBox( DatenBytes, "byte12" );
    byte12->setEnabled( FALSE );
    byte12->setGeometry( QRect( 10, 110, 50, 26 ) ); 
    byte12->setMaxValue( 255 );
    QToolTip::add(  byte12, tr( "Byte 12" ) );

    byte14 = new QSpinBox( DatenBytes, "byte14" );
    byte14->setEnabled( FALSE );
    byte14->setGeometry( QRect( 110, 110, 50, 26 ) ); 
    byte14->setMaxValue( 255 );
    QToolTip::add(  byte14, tr( "Byte 14" ) );

    byte5 = new QSpinBox( DatenBytes, "byte5" );
    byte5->setEnabled( FALSE );
    byte5->setGeometry( QRect( 60, 50, 50, 26 ) ); 
    byte5->setMaxValue( 255 );
    QToolTip::add(  byte5, tr( "Byte 5" ) );

    byte4 = new QSpinBox( DatenBytes, "byte4" );
    byte4->setEnabled( FALSE );
    byte4->setGeometry( QRect( 10, 50, 50, 26 ) ); 
    byte4->setMaxValue( 255 );
    QToolTip::add(  byte4, tr( "Byte 4" ) );

    byte8 = new QSpinBox( DatenBytes, "byte8" );
    byte8->setEnabled( FALSE );
    byte8->setGeometry( QRect( 10, 80, 50, 26 ) ); 
    byte8->setMaxValue( 255 );
    QToolTip::add(  byte8, tr( "Byte 8" ) );

    byte13 = new QSpinBox( DatenBytes, "byte13" );
    byte13->setEnabled( FALSE );
    byte13->setGeometry( QRect( 60, 110, 50, 26 ) ); 
    byte13->setMaxValue( 255 );
    QToolTip::add(  byte13, tr( "Byte 13" ) );

    byte9 = new QSpinBox( DatenBytes, "byte9" );
    byte9->setEnabled( FALSE );
    byte9->setGeometry( QRect( 60, 80, 50, 26 ) ); 
    byte9->setMaxValue( 255 );
    QToolTip::add(  byte9, tr( "Byte 9" ) );

    byte10 = new QSpinBox( DatenBytes, "byte10" );
    byte10->setEnabled( FALSE );
    byte10->setGeometry( QRect( 110, 80, 50, 26 ) ); 
    byte10->setMaxValue( 255 );
    QToolTip::add(  byte10, tr( "Byte 10" ) );

    byte1 = new QSpinBox( DatenBytes, "byte1" );
    byte1->setEnabled( FALSE );
    byte1->setGeometry( QRect( 60, 20, 50, 26 ) ); 
    byte1->setMaxValue( 255 );
    QToolTip::add(  byte1, tr( "Byte 1" ) );

    byte2 = new QSpinBox( DatenBytes, "byte2" );
    byte2->setEnabled( FALSE );
    byte2->setGeometry( QRect( 110, 20, 50, 25 ) ); 
    byte2->setMaxValue( 255 );
    QToolTip::add(  byte2, tr( "Byte 2" ) );

//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:laeufer,代码行数:101,代码来源:debugTreiberGUI.cpp


示例17: QWidget

InstrumentRack::InstrumentRack( QWidget *pParent )
 : QWidget( pParent )
 , Object( __class_name )
{
	INFOLOG( "INIT" );

	resize( 290, 405 );
	setMinimumSize( width(), height() );
	setFixedWidth( width() );


// TAB buttons
	QWidget *pTabButtonsPanel = new QWidget( NULL );
	pTabButtonsPanel->setFixedHeight( 24 );
	pTabButtonsPanel->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) );

	// instrument editor button
	m_pShowInstrumentEditorBtn = new ToggleButton(
			pTabButtonsPanel,
			"/instrumentEditor/instrument_show_on.png",
			"/instrumentEditor/instrument_show_off.png",
			"/instrumentEditor/instrument_show_off.png",
			QSize( 130, 24 )
	);
	m_pShowInstrumentEditorBtn->setToolTip( trUtf8( "Show Instrument editor" ) );
	m_pShowInstrumentEditorBtn->setText( trUtf8( "Instrument" ) );
	connect( m_pShowInstrumentEditorBtn, SIGNAL( clicked( Button* ) ), this, SLOT( on_showInstrumentEditorBtnClicked() ) );

	// show sound library button
	m_pShowSoundLibraryBtn = new ToggleButton(
			pTabButtonsPanel,
			"/instrumentEditor/library_show_on.png",
			"/instrumentEditor/library_show_off.png",
			"/instrumentEditor/library_show_off.png",
			QSize( 150, 24 )
	);
	m_pShowSoundLibraryBtn->setToolTip( trUtf8( "Show sound library" ) );
	m_pShowSoundLibraryBtn->setText( trUtf8( "Sound library" ) );
	connect( m_pShowSoundLibraryBtn, SIGNAL( clicked( Button* ) ), this, SLOT( on_showSoundLibraryBtnClicked() ) );

	QHBoxLayout *pTabHBox = new QHBoxLayout();
	pTabHBox->setSpacing( 0 );
	pTabHBox->setMargin( 0 );
	pTabHBox->addWidget( m_pShowInstrumentEditorBtn );
	pTabHBox->addWidget( m_pShowSoundLibraryBtn );

	pTabButtonsPanel->setLayout( pTabHBox );

//~ TAB buttons


	InstrumentEditorPanel::get_instance()->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) );

	m_pSoundLibraryPanel = new SoundLibraryPanel( NULL );

	// LAYOUT
	QGridLayout *pGrid = new QGridLayout();
	pGrid->setSpacing( 0 );
	pGrid->setMargin( 0 );

	pGrid->addWidget( pTabButtonsPanel, 0, 0, 1, 3 );
	pGrid->addWidget( InstrumentEditorPanel::get_instance(), 2, 1 );
	pGrid->addWidget( m_pSoundLibraryPanel, 2, 1 );

	this->setLayout( pGrid );

	on_showInstrumentEditorBtnClicked();	// show the instrument editor as default
}
开发者ID:draekko,项目名称:hydrogen,代码行数:68,代码来源:InstrumentRack.cpp


示例18: bus_

该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ setMinimumWidth函数代码示例发布时间:2022-05-30
下一篇:
C++ setMinimumHeight函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap